38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
///
|
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using log4net;
|
|
|
|
namespace TBF.Rig.DataContainers.BackupAndSecurityOptions
|
|
{
|
|
/// <summary>
|
|
/// Holds backup and security options.
|
|
/// </summary>
|
|
public class Component : ComponentBase
|
|
{
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
|
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
|
|
|
readonly ComponentCfg myCfg;
|
|
|
|
public int MinPasswdLength { get { return myCfg.MinPasswdLength; } }
|
|
public int PasswdExpirationPeriodDays { get { return myCfg.PasswdExpirationPeriodDays; } }
|
|
|
|
public Component() { }
|
|
|
|
public Component(Generic.IComponentCfg cfg)
|
|
: base(cfg)
|
|
{
|
|
myCfg = cfg as ComponentCfg;
|
|
}
|
|
|
|
public override void Initialize()
|
|
{
|
|
Users.GlobalData.MinPasswdLength = myCfg.MinPasswdLength;
|
|
Users.GlobalData.PasswdExpirationPeriodDays = myCfg.PasswdExpirationPeriodDays;
|
|
log.FatalFormat("{0} initialized: {1}", Name, this);
|
|
}
|
|
}
|
|
}
|