HistoryLength: Integer;
HistoryLength: System.Int32;
The HistoryLength property determines the number of old passwords that are stored and checked for coincidence with a new user's password.
Using this property enables applying restrictions on absolute coincidence of the old and a new password.
To execute the example, add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
MbSecurity: IMetabaseSecurity;
MbPolicy: IMetabasePolicy;
MbPassPolicy: IMetabasePasswordPolicy;
Lic: Object;
Begin
Mb := MetabaseClass.Active;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MbSecurity := Mb.Security;
MbPolicy := MbSecurity.Policy;
MbPassPolicy := MbPolicy.PasswordPolicy;
// Set number of old user passwords
MbPassPolicy.HistoryLength := 3;
// Save changes
MbSecurity.Apply;
// Check in license
Lic := Null;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params : StartParams);
Var
Mb: IMetabase;
MbSecurity: IMetabaseSecurity;
MbPolicy: IMetabasePolicy;
MbPassPolicy: IMetabasePasswordPolicy;
Lic: Object;
Begin
Mb := Params.Metabase;
// Get license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MbSecurity := Mb.Security;
MbPolicy := MbSecurity.Policy;
MbPassPolicy := MbPolicy.PasswordPolicy;
// Set number of old user passwords
MbPassPolicy.HistoryLength := 3;
// Save changes
MbSecurity.Apply();
// Check in license
Lic := Null;
End Sub;
After executing the example three old user's passwords are stored in the history.
See also: