CheckPassword(User: IMetabaseUser; NewPassword: String; OldPassword: String);
User - the user, whose new password has to be validated.
NewPassword - a password that needs validating.
OldPassword - an old password, relatively to which the new one is validated.
The CheckPassword method validates user's new password for consistency according to the specified passwords policy in security manager. If password doesn't correspond to the specified passwords policy, an exception error is generated.
Sub Main;
Var
Mb: IMetabase;
Sec: IMetabaseSecurity;
User: IMetabaseUser;
Begin
Mb := MetabaseClass.Active;
Sec := Mb.Security;
User := Sec.Users.Item(0);
Sec.Policy.PasswordPolicy.CheckPassword(User, "qwe", "qwr");
End Sub Main;
After executing the example if a restriction for a minimum difference of old password from a new one for more than one character is set in passwords policy, an exception error is generated.
See also: