PromptToChangePassword Method Example
The following example checks the user's Windows account expiration status. If the account expired, this example prompts the user to change his password (if he has rights to do so). If the account has not expired, a message appears stating how many days are left until the password expires.
Dim ESig As Object
Dim bNodeSignEnabled As Boolean
Dim UserName As String
Dim PassWord As String
Dim UsrId As String
Dim bExpired As Boolean
Dim daysLeft As Long
Dim bCanChangePassword As Boolean
'user name of an iFix user using Windows security
UserName = "expire"
'Create the ESignature object
Set ESig = CreateObject("ElectronicSignature.ESignature")
'Check if node is enabled for electronic signature
ESig.IsNodeSignEnabled bNodeSignEnabled
If bNodeSignEnabled = True Then
'Check account status and user's right to change password
ESig.CheckAccountExpiration UserName, bExpired, bCanChangePassword, daysLeft
If bExpired <> False Then
If bCanChangePassword <> False Then
ESig.PromptToChangePassword UserName
End If
Else
'password is not expired
MsgBox "Password is due to expire in " & daysLeft & " days."
End If
Else
'the hardware key is not enabled for signature, security is disabled, or bypass signature is in effect
MsgBox “Signature is not enabled on this node.”
End If