IMetabasePasswordPolicy.HistoryLength

Syntax

HistoryLength: Integer;

HistoryLength: System.Int32;

Description

The HistoryLength property determines the number of old passwords that are stored and checked for coincidence with a new user's password.

Comments

Using this property enables applying restrictions on absolute coincidence of the old and a new password.

Example

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;
    
// Check out 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;
    
// Check out 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:

IMetabasePasswordPolicy