[ActiveLock-Development] CVS: activelock2/src ActiveLock.cls,1.4,1.5 IActiveLock.cls,1.4,1.5
Brought to you by:
ialkan
From: Thanh H. T. <th...@us...> - 2003-07-23 03:53:46
|
Update of /cvsroot/activelock/activelock2/src In directory sc8-pr-cvs1:/tmp/cvs-serv12306 Modified Files: ActiveLock.cls IActiveLock.cls Log Message: Added IActiveLock_GetLockString() interface Index: ActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/ActiveLock.cls,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ActiveLock.cls 21 Jul 2003 08:48:27 -0000 1.4 +++ ActiveLock.cls 23 Jul 2003 03:53:43 -0000 1.5 @@ -55,9 +55,10 @@ ' / MODULE TO DO LIST / ' /////////////////////////////////////////////////////////////////////// ' -' [ ] Finish implementing IActiveLock_Acquire +' [ ] Implement IActiveLock_GetLockString() for locktypes other than MAC +' [ ] IActiveLock_Acquire: Check if license has not expired ' [ ] Implement IActiveLock_Release -' [ [ Implement IActiveLock_Transfer +' [ ] Implement IActiveLock_Transfer ' /////////////////////////////////////////////////////////////////////// ' / MODULE CHANGE LOG / ' /////////////////////////////////////////////////////////////////////// @@ -96,6 +97,28 @@ Set IActiveLock_EventNotifier = MyNotifier End Property +Private Function IActiveLock_GetLockString(Optional Lic As ProductLicense = Nothing) As String + Dim strLock As String + + If (mLockTypes And lockMAC) = lockMAC Then + strLock = strLock & modMACAddress.GetMACAddress() + End If + If mLockTypes And lockComp Then + ' TODO: strLock = strLock & GetComputerName() + End If + If mLockTypes And lockHD Then + ' TODO: strLock = strLock & GetComputerName() + End If + If mLockTypes And lockWindows Then + ' TODO: strLock = strLock & GetWindowSerial() + End If + If Lic Is Nothing Then + IActiveLock_GetLockString = strLock + Else + IActiveLock_GetLockString = Lic.ToString() & vbCrLf & strLock + End If +End Function + Private Sub IActiveLock_Init(Arg1 As Variant, ParamArray OtherArgs() As Variant) ' Do nothing. No extra initialization needed for now. End Sub @@ -111,30 +134,23 @@ Err.Raise ActiveLockErrCodeConstants.alerrNoLicense, "IActiveLock_Acquire", "No valid license" End If Dim varResult As Variant - MyNotifier.Notify "ValidateKey", GetLockString(Lic), Lic.LicenseKey, varResult + MyNotifier.Notify "ValidateKey", IActiveLock_GetLockString(Lic), Lic.LicenseKey, varResult ' Check varResult for an affirmative If CLng(varResult) <> modActiveLock.MAGICNUMBER_YES Then Err.Raise ActiveLockErrCodeConstants.alerrLicenseInvalid, "IActiveLock_RegisteredDate", "License invalid." End If + ' TODO: Check if license has not expired End Sub -'' -' Retrieves the lock string from the specified license -Private Function GetLockString(Lic As ProductLicense) As String - Dim strLic As String - strLic = Lic.ToString() & vbLf & modMACAddress.GetMACAddress() ' LOCK TO MAC - GetLockString = strLic -End Function - Private Property Get IActiveLock_RegisteredDate() As String Dim Lic As ProductLicense - Set Lic = mKeyStore.Retrieve(mSoftwareCode) + Set Lic = mKeyStore.Retrieve(mSoftwareName) If Lic Is Nothing Then Err.Raise ActiveLockErrCodeConstants.alerrNoLicense, "IActiveLock_RegisteredDate", "No license." End If ' Validate the License. Dim varResult As Variant - MyNotifier.Notify "ValidateKey", GetLockString(Lic), Lic.LicenseKey, varResult + MyNotifier.Notify "ValidateKey", IActiveLock_GetLockString(Lic), Lic.LicenseKey, varResult If CLng(varResult) <> modActiveLock.MAGICNUMBER_YES Then Err.Raise ActiveLockErrCodeConstants.alerrLicenseInvalid, "IActiveLock_RegisteredDate", "License invalid." End If @@ -185,7 +201,7 @@ ' - registered user ' - expiry date Dim varResult As Variant - MyNotifier.Notify "ValidateKey", GetLockString(Lic), Lic.LicenseKey, varResult + MyNotifier.Notify "ValidateKey", IActiveLock_GetLockString(Lic), Lic.LicenseKey, varResult If CLng(varResult) <> modActiveLock.MAGICNUMBER_YES Then Err.Raise ActiveLockErrCodeConstants.alerrLicenseInvalid, "IActiveLock_Register", "License invalid." End If Index: IActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock2/src/IActiveLock.cls,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- IActiveLock.cls 21 Jul 2003 08:48:27 -0000 1.4 +++ IActiveLock.cls 23 Jul 2003 03:53:43 -0000 1.5 @@ -202,6 +202,15 @@ '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '' +' Returns the lock string corresponding to the set LockType. +' Optionally, if a product license is specified, then a lock string specific to that license is returned. +' +Public Function GetLockString(Optional Lic As ProductLicense = Nothing) As String + +End Function + + +'' ' Registers the following product license. ' Public Sub Register(Lic As ProductLicense) |