PasswordChangedUser: IMetabaseUser;
PasswordChangedUser: Prognoz.Platform.Interop.Metabase.IMetabaseUser;
The PasswordChangedUser property returns the name of the user, that requested the password change.
The password change can be requested by the user, that has the "Change of users rights, distribution of passwords, distribution of user roles, change of policy" privilege.
To execute the example, make sure that security manager contains the USER user.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
MS: IMetabaseSecurity;
User, ChangedUser: IMetabaseUser;
Begin
MB := MetabaseClass.Active;
MS := MB.Security;
User := MS.ResolveName("USER") As IMetabaseUser;
ChangedUser := User.PasswordChangedUser;
If ChangedUser = Null Then
Debug.WriteLine("Password change was not required");
Else
Debug.WriteLine("Password change was required by the user " + ChangedUser.Name);
End If;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
User, ChangedUser: IMetabaseUser;
Begin
MB := Params.Metabase;
MS := MB.Security;
User := MS.ResolveName("USER") As IMetabaseUser;
ChangedUser := User.PasswordChangedUser;
If ChangedUser = Null Then
System.Diagnostics.Debug.WriteLine("Password change was not required");
Else
System.Diagnostics.Debug.WriteLine("Password change was required by the user " + ChangedUser.Name);
End If;
End Sub;
After executing the example the console displays result of password change requirement.
See also: