4 require_once
'Services/User/exceptions/class.ilUserException.php';
48 switch (strtolower(
$key)) {
49 case 'password_encoder':
52 case 'encoder_factory':
64 throw new ilUserException(sprintf(
'"encoder_factory" must be instance of ilUserPasswordEncoderFactory and set in %s.', json_encode(
$config)));
74 if (self::$instance instanceof
self) {
75 return self::$instance;
78 require_once
'Services/User/classes/class.ilUserPasswordEncoderFactory.php';
83 'default_password_encoder' =>
'bcryptphp',
84 'ignore_security_flaw' =>
true,
88 'password_encoder' =>
'bcryptphp' 92 self::$instance = $password_manager;
93 return self::$instance;
136 if ($encoder->requiresSalt()) {
137 require_once
'Services/Password/classes/class.ilPasswordUtils.php';
166 $user->resetPassword($raw, $raw);
170 if ($encoder->requiresReencoding($user->
getPasswd())) {
171 $user->resetPassword($raw, $raw);
verifyPassword(ilObjUser $user, $raw)
Class for user related exception handling in ILIAS.
encodePassword(ilObjUser $user, $raw)
__construct(array $config=array())
Please use the singleton method for instance creation The constructor is still public because of the ...
setEncoderFactory(ilUserPasswordEncoderFactory $encoder_factory)
static getBytes($length)
Generate random bytes using OpenSSL or Mcrypt and mt_rand() as fallback.
setPasswd($a_str, $a_type=IL_PASSWD_PLAIN)
set password public
setEncoderName($encoder_name)
isEncodingTypeSupported($name)
static getDataDir()
get data directory (outside webspace)
setPasswordSalt($password_salt)
setPasswordEncodingType($password_encryption_type)
getPasswordEncodingType()
static getInstance()
Single method to reduce footprint (included files, created instances)