19declare(strict_types=1);
51 if (!empty($config)) {
52 foreach ($config as $key => $value) {
53 switch (strtolower($key)) {
62 case 'password_encoder':
66 case 'encoder_factory':
77 '"password_encoder" must be set in %s.',
78 print_r($config,
true)
86 '"encoder_factory" must be instance of LocalUserPasswordEncoderFactory and set in %s.',
87 print_r($config,
true)
102 if (self::$instance instanceof
self) {
111 'default_password_encoder' =>
'bcryptphp',
113 'memory_cost' => 19_456,
114 'ignore_security_flaw' =>
true,
119 'password_encoder' =>
'argon2id',
120 'settings' =>
$DIC->isDependencyAvailable(
'settings') ?
$DIC->settings() :
null,
121 'db' =>
$DIC->database(),
125 self::$instance = $password_manager;
164 if ($encoder->requiresSalt()) {
200 if ($encoder->requiresReencoding($user->
getPasswd())) {
212 $defaultAuthMode = $this->
settings->get(
'auth_mode');
213 $defaultAuthModeCondition =
'';
215 $defaultAuthModeCondition =
' OR auth_mode = ' . $this->db->quote(
'default',
'text');
218 $this->db->manipulateF(
219 "UPDATE usr_data SET passwd_policy_reset = %s WHERE (auth_mode = %s $defaultAuthModeCondition)",
236 return ilAuthUtils::isPasswordModificationHidden()
encodePassword(ilObjUser $user, string $raw)
resetLastPasswordChangeForLocalUsers()
setEncoderName(string $encoderName)
__construct(array $config=[])
Please use the singleton method for instance creation The constructor is still public because of the ...
allowPasswordChange(ilObjUser $user)
setSettings(?ilSetting $settings)
setEncoderFactory(LocalUserPasswordEncoderFactory $encoderFactory)
static getInstance()
Singleton method to reduce footprint (included files, created instances)
verifyPassword(ilObjUser $user, string $raw)
isEncodingTypeSupported(string $name)
LocalUserPasswordEncoderFactory $encoderFactory
static isPasswordModificationEnabled($a_authmode)
Check if password modification is enabled.
static getDataDir()
get data directory (outside webspace)
getAuthMode(bool $a_auth_key=false)
setPasswordSalt(?string $password_salt)
setPasswordEncodingType(?string $password_encryption_type)
isPasswordChangeDemanded()
setPasswd(string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
getPasswordEncodingType()
resetPassword(string $new_raw_password)
Class for user password exception handling in ILIAS.
static getBytes(int $length)
Generate random bytes using OpenSSL or Mcrypt and mt_rand() as fallback.
static get(string $a_var)