4 require_once
'Services/User/exceptions/class.ilUserException.php';
30 switch (strtolower(
$key)) {
31 case 'default_password_encoder':
48 new \ilBcryptPhpPasswordEncoder(
$config),
49 new \ilBcryptPasswordEncoder(
$config),
50 new \ilMd5PasswordEncoder(
$config),
64 if ($encoder->isSupportedByRuntime()) {
65 $this->encoders[$encoder->getName()] = $encoder;
100 $this->encoders = array();
101 foreach ($encoders as $encoder) {
103 throw new \ilUserException(sprintf(
'One of the passed encoders is not valid: %s.', json_encode($encoder)));
105 $this->encoders[$encoder->getName()] = $encoder;
125 if (!isset($this->encoders[
$name])) {
126 if (!$get_default_on_mismatch) {
127 throw new \ilUserException(sprintf(
'The encoder "%s" was not configured.', $name));
129 throw new \ilUserException(
'No default encoder specified, fallback not possible.');
131 throw new \ilUserException(
"No default encoder found for name: '{$this->getDefaultEncoder()}'.");
137 return $this->encoders[
$name];
149 foreach ($matchers as $encoderName => $callback) {
151 $encoder->getName() === $encoderName &&
152 is_callable($callback) && $callback($encoded) === true
__construct(array $config=array())
setEncoders(array $encoders)
getValidEncoders($config)
initEncoders(array $config)
getFirstEncoderForEncodedPasswordAndMatchers(string $encoded, array $matchers)
getSupportedEncoderNames()
setDefaultEncoder($default_encoder)
getEncoderByName($name, $get_default_on_mismatch=false)