Issue
How to automatically disable access for Personnel who's expiry date has passed?
Environment
Continuum Access Control
Cause
Want to automatically disable Personnel who's cards have gone beyond the expiry date.
Resolution
The below code sample can be used as a basis to provide this feature.
It is a fallthru Workstation Program that can be triggered from one of the time related SystemVariables such as Hour or Minute.
It uses the OpenList function to go through all Personnel in a specific folder and compare their expiry dates to the current Date and then disables them if required.
==========================================
'Fall thru program that will search through the Personnel class for
' an expiration date that is less than today’s date.
Object oAPerson
Numeric nResult
Line 1
nResult = OpenList("Personnel", oAPerson, Root\CardHolders) 'specify CH path
Line 2
If nResult = Success then
While GetObject(oAPerson) = Success
'The next line will fail when the Expiration Date attribute is greater than 12/31/2037 (12/31/2099, by default)
If (Date > oAPerson ExpirationDate) then
Set oAPerson State = Disabled
Else
Set oAPerson State = Enabled
Endif
Print oAPerson Name, " is ", oAPerson State 'prints to message window for testing
Endwhile
Endif
==========================================