3declare(strict_types=1);
52 switch (strtolower(
$key)) {
59 case 'password_encoder':
62 case 'encoder_factory':
71 '"password_encoder" must be set in %s.',
72 json_encode(
$config, JSON_THROW_ON_ERROR)
78 '"encoder_factory" must be instance of ilUserPasswordEncoderFactory and set in %s.',
79 json_encode(
$config, JSON_THROW_ON_ERROR)
94 if (self::$instance instanceof
self) {
102 'default_password_encoder' =>
'bcryptphp',
103 'ignore_security_flaw' =>
true,
107 'password_encoder' =>
'bcryptphp',
108 'settings' =>
$DIC->isDependencyAvailable(
'settings') ?
$DIC->settings() :
null,
109 'db' =>
$DIC->database(),
113 self::$instance = $password_manager;
151 if ($encoder->requiresSalt()) {
175 if ($encoder->requiresReencoding($user->
getPasswd())) {
187 $defaultAuthMode = $this->
settings->get(
'auth_mode');
188 $defaultAuthModeCondition =
'';
190 $defaultAuthModeCondition =
' OR auth_mode = ' . $this->db->quote(
'default',
'text');
193 $this->db->manipulateF(
194 "UPDATE usr_data SET passwd_policy_reset = %s WHERE (auth_mode = %s $defaultAuthModeCondition)",
static getDataDir()
get data directory (outside webspace)
resetPassword(string $raw, string $raw_retype)
Resets the user password.
setPasswordSalt(?string $password_salt)
setPasswordEncodingType(?string $password_encryption_type)
setPasswd(string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
getPasswordEncodingType()
static getBytes(int $length)
Generate random bytes using OpenSSL or Mcrypt and mt_rand() as fallback.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setEncoderName(string $encoderName)
verifyPassword(ilObjUser $user, string $raw)
__construct(array $config=[])
Please use the singleton method for instance creation The constructor is still public because of the ...
static getInstance()
Singleton method to reduce footprint (included files, created instances)
isEncodingTypeSupported(string $name)
setEncoderFactory(ilUserPasswordEncoderFactory $encoderFactory)
setSettings(?ilSetting $settings)
resetLastPasswordChangeForLocalUsers()
ilUserPasswordEncoderFactory $encoderFactory
encodePassword(ilObjUser $user, string $raw)