InvalidCount for days code

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@923 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
brandysb
2009-07-29 14:54:48 +00:00
parent eaa22af69c
commit 84f9ba551c
4 changed files with 20 additions and 3 deletions

View File

@ -1,2 +1,3 @@
[Keys]
OnGuard demo=$E5,$8F,$84,$D6,$92,$C9,$A4,$D8,$1A,$FA,$6F,$8D,$AB,$FC,$DF,$B4
Ck-Etykiety=$C0,$0A,$27,$C2,$93,$7B,$06,$0D,$24,$84,$DF,$A1,$1E,$B9,$0D,$AF

View File

@ -45,7 +45,7 @@
<ResourceBaseClass Value="Form"/>
<UnitName Value="exrgregu"/>
<CursorPos X="59" Y="108"/>
<TopLine Value="67"/>
<TopLine Value="80"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>

View File

@ -7,7 +7,8 @@ Table of contents
2. Package names
3. Installation
4. Version history
4.1 Release 1.13
4.1 Release 1.13
==============================================
@ -40,6 +41,12 @@ To install TurboPower OnGuard into your IDE, take the following steps:
4. Version history
4.3 July 27, 2009
Initial addition of features:
- InvalidCount which allow limited count of valid code even if trial period is expired
(useful due to user mistakes causing incorect system date sometimes)
- instead of logical volume serial number , hardware hdd ide disk serial number is no used if available
- compilation with newest Lazarus SVN problems fixed
4.3 July 28 2009
- initial support for InvalidCount value allowing 'breaking the rules' limited , for example run program a few times if trial period expired

View File

@ -1989,20 +1989,26 @@ begin
MixBlock(T128bit(Key), Work, False);
Result := (Work.CheckValue = DaysCheckCode) and
(ExpandDate(Work.LastAccess) <= Date);
if (not Result) and (Work.InvalidCount >0) then Result := true;
end;
procedure DecDaysCode(const Key : TKey; var Code : TCode);
var
X : LongInt;
Valid : Boolean;
begin
if not IsDaysCodeValid(Key,Code) then DecInvalidCountCode(Key,Code);
MixBlock(T128bit(Key), Code, False);
Valid := (Code.CheckValue = DaysCheckCode) and
(ExpandDate(Code.LastAccess) <= Date);
X := ShrinkDate(Date);
if (Code.LastAccess <> X) then begin
if Code.Days > 0 then {!!.02}
Code.Days := Max(0, Code.Days - 1); {!!.02}
Code.LastAccess := X;
end;
if (not Valid) and (Code.InvalidCount>0) then
Code.InvalidCount := Code.InvalidCount-1;
MixBlock(T128bit(Key), Code, True);
end;
@ -2016,7 +2022,10 @@ begin
(ExpandDate(Work.LastAccess) <= Date) then
Result := Work.Days
else
begin
Result := 0;
if Work.InvalidCount>0 then Result := Work.Days;
end;
end;