6use Ubiquity\utils\base\UConfigFile;
27 $this->config=$file->load();
33 return $this->config[
'useAjax']??true;
37 return $this->config[
'attemptsNumber']??
null;
41 return $this->config[
'userSessionKey']??
'activeUser';
45 return $this->config[
'attemptsTimeout']??(3*60);
49 return $this->config[
'displayInfoAsString']??false;
53 return $this->config[
'loginInputName']??
'email';
57 return $this->config[
'loginLabel']??\ucfirst($this->_getLoginInputName());
61 return $this->config[
'passwordInputName']??
'password';
65 return $this->config[
'passwordLabel']??\ucfirst ( $this->_getPasswordInputName () );
69 return $this->config[
'passwordConfLabel']??(\ucfirst ( $this->_getPasswordInputName () ).
' confirmation');
73 return $this->config[
'bodySelector']??
'main .container';
77 return $this->config[
'rememberCaption']??
'Remember me';
81 return $this->config[
'2FA.tokenSize']??6;
85 return $this->config[
'2FA.codePrefix']??
'U-';
89 return $this->config[
'hasAccountCreation']??false;
93 return $this->config[
'hasAccountRecovery']??false;
97 return $this->config[
'recoveryAccountCaption']??
'Forgot your password?';
100 public static function init(?
string $name=
null,?array $config=
null){
102 'attempsNumber'=>
null,
103 'userSessionKey'=>
'activeUser',
105 'attemptsTimeout'=>3*60,
106 'displayInfoAsString'=>
false,
107 'loginInputName'=>
'email',
108 'loginLabel'=>
'Email',
109 'passwordInputName'=>
'password',
110 'passwordLabel'=>
'Password',
111 'passwordConfLabel'=>
'Password confirmation',
112 'rememberCaption'=>
'Remember me',
113 'bodySelector'=>
'main .container',
115 '2FA.codePrefix'=>
'U-',
116 'hasAccountCreation'=>
false,
117 'hasAccountRecovery'=>
false,
118 'recoveryAccountCaption'=>
'Forgot your password?'
121 $name??=\lcfirst(ClassUtils::getClassSimpleName(static::class));
122 $file=
new UConfigFile($name);
123 $file->setData($config);
Manipulates class and namespace names Ubiquity\cache$ClassUtils This class is part of Ubiquity.
Ubiquity\controllers\auth$AuthControllerConfig This class is part of Ubiquity.
attemptsNumber()
To override Returns int the maximum number of allowed login attempts.
static init(?string $name=null,?array $config=null)
_displayInfoAsString()
Override to define if user info is displayed as string.
getTokenSize()
To override Returns the default size for generated tokens.
recoveryAccountCaption()
Returns the recovery account link caption.
initialize()
{{Method called before each action Can be override in derived class.}\Ubiquity\controllers\Controller...
_getUserSessionKey()
To override for defining user session key, default : "activeUser".
towFACodePrefix()
Returns the code prefix (which should not be entered by the user).