1<?
php declare(strict_types=1);
41 foreach (
$config as $key => $value) {
42 switch (strtolower($key)) {
49 case 'password_encoder':
52 case 'encoder_factory':
65 '"encoder_factory" must be instance of ilUserPasswordEncoderFactory and set in %s.',
81 if (self::$instance instanceof
self) {
89 'default_password_encoder' =>
'bcryptphp',
90 'ignore_security_flaw' =>
true,
94 'password_encoder' =>
'bcryptphp',
95 'settings' =>
$DIC->isDependencyAvailable(
'settings') ?
$DIC->settings() :
null,
96 'db' =>
$DIC->database(),
100 self::$instance = $password_manager;
161 if ($encoder->requiresSalt()) {
191 $user->resetPassword($raw, $raw);
195 if ($encoder->requiresReencoding((
string) $user->
getPasswd())) {
196 $user->resetPassword($raw, $raw);
210 $defaultAuthMode = $this->
settings->get(
'auth_mode');
211 $defaultAuthModeCondition =
'';
212 if ((
int) $defaultAuthMode === (
int)
AUTH_LOCAL) {
213 $defaultAuthModeCondition =
' OR auth_mode = ' . $this->db->quote(
'default',
'text');
216 $this->db->manipulateF(
219 SET passwd_policy_reset = %s
220 WHERE (auth_mode = %s $defaultAuthModeCondition)",
An exception for terminatinating execution or to throw for unit testing.
setPasswordEncodingType($password_encryption_type)
setPasswd($a_str, $a_type=IL_PASSWD_PLAIN)
set password @access public
setPasswordSalt($password_salt)
getPasswordEncodingType()
static getBytes($length)
Generate random bytes using OpenSSL or Mcrypt and mt_rand() as fallback.
Class for user related exception handling in ILIAS.
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()
Single method to reduce footprint (included files, created instances)
isEncodingTypeSupported(string $name)
setEncoderFactory(ilUserPasswordEncoderFactory $encoderFactory)
setSettings(?ilSetting $settings)
resetLastPasswordChangeForLocalUsers()
encodePassword(ilObjUser $user, string $raw)
static getDataDir()
get data directory (outside webspace)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...