AutolockPeriod: Integer;
AutolockPeriod: System.Int32;
The AutoLockPeriod property determines user inactivity period in days, when it expires the user account is blocked.
By default the property is set to 0, there is not blockings.
To execute the example, place the Button and IntegerEdit component (for Fore.NET example use the NumericUpDown component) named Button1, IntegerEdit1/numericUpDown1 correspondingly on the form.
Add links to the Metabase, ForeSystem (for the Fore.NET example) system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Policy: IMetabasePolicy;
Lic: Object;
Begin
MB := MetabaseClass.Active;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
MS := MB.Security;
Policy := MS.Policy;
// Set user inactivity period
Policy.AutoLockPeriod := IntegerEdit1.Value;
// Save changes
MS.Apply;
// Check in license
Lic := Null;
End Sub Button1OnClick;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
MS: IMetabaseSecurity;
Policy: IMetabasePolicy;
Lic: Object;
Begin
MB := Self.Metabase;
// Check out license to work with security manager
Lic := MB.RequestLicense(UiLicenseFeatureType.lftAdm);
MS := MB.Security;
Policy := MS.Policy;
// Set user inactivity period
Policy.AutoLockPeriod := decimal.ToInt32(numericUpDown1.Value);
// Save changes
MS.Apply();
// Check in license
Lic := Null;
End Sub;
After clicking the button, the user inactivity period will be set, specified in the IntegerEdit/NumericUpDown component, after the expiry of which the user credential is blocked.
See also: