2019-09-14 08:44:20 +00:00
|
|
|
|
///
|
|
|
|
|
|
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
|
|
|
|
|
///
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using log4net;
|
|
|
|
|
|
|
2019-09-18 07:09:00 +00:00
|
|
|
|
namespace TBF.BenchControl.DataContainers.BackupAndSecurityOptions
|
2019-09-14 08:44:20 +00:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Holds backup and security options.
|
|
|
|
|
|
/// </summary>
|
2019-09-18 07:09:00 +00:00
|
|
|
|
public class Component : ComponentBase
|
2019-09-14 08:44:20 +00:00
|
|
|
|
{
|
|
|
|
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
2021-04-07 07:57:42 +00:00
|
|
|
|
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
2019-09-14 08:44:20 +00:00
|
|
|
|
|
|
|
|
|
|
readonly ComponentCfg myCfg;
|
|
|
|
|
|
|
|
|
|
|
|
public int MinPasswdLength { get { return myCfg.MinPasswdLength; } }
|
|
|
|
|
|
public int PasswdExpirationPeriodDays { get { return myCfg.PasswdExpirationPeriodDays; } }
|
|
|
|
|
|
|
2021-04-07 07:57:42 +00:00
|
|
|
|
public Component() { }
|
2019-09-14 08:44:20 +00:00
|
|
|
|
|
|
|
|
|
|
public Component(Generic.IComponentCfg cfg)
|
|
|
|
|
|
: base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
myCfg = cfg as ComponentCfg;
|
2021-04-07 07:57:42 +00:00
|
|
|
|
}
|
2019-09-14 08:44:20 +00:00
|
|
|
|
|
2021-04-07 07:57:42 +00:00
|
|
|
|
public override void Initialize()
|
|
|
|
|
|
{
|
2019-09-18 07:09:00 +00:00
|
|
|
|
Users.GlobalData.MinPasswdLength = myCfg.MinPasswdLength;
|
|
|
|
|
|
Users.GlobalData.PasswdExpirationPeriodDays = myCfg.PasswdExpirationPeriodDays;
|
2021-04-07 07:57:42 +00:00
|
|
|
|
log.FatalFormat("{0} initialized: {1}", Name, this);
|
2019-09-14 08:44:20 +00:00
|
|
|
|
}
|
2021-04-07 07:57:42 +00:00
|
|
|
|
}
|
2019-09-14 08:44:20 +00:00
|
|
|
|
}
|