1<?
php declare(strict_types=1);
4require_once
'Services/User/exceptions/class.ilUserException.php';
28 foreach (
$config as $key => $value) {
29 switch (strtolower($key)) {
30 case 'default_password_encoder':
65 if ($encoder->isSupportedByRuntime()) {
66 $this->encoders[$encoder->getName()] = $encoder;
101 $this->encoders = array();
105 'One of the passed encoders is not valid: %s.',
106 json_encode($encoder)
109 $this->encoders[$encoder->getName()] = $encoder;
129 if (!isset($this->encoders[
$name])) {
130 if (!$get_default_on_mismatch) {
133 throw new ilUserException(
'No default encoder specified, fallback not possible.');
135 throw new ilUserException(
"No default encoder found for name: '{$this->getDefaultEncoder()}'.");
141 return $this->encoders[
$name];
153 foreach ($matchers as $encoderName => $callback) {
155 $encoder->getName() === $encoderName &&
156 is_callable($callback) && $callback($encoded) ===
true
An exception for terminatinating execution or to throw for unit testing.
Class for user related exception handling in ILIAS.
getEncoderByName($name, $get_default_on_mismatch=false)
setEncoders(array $encoders)
initEncoders(array $config)
getSupportedEncoderNames()
setDefaultEncoder(string $defaultEncoder)
getFirstEncoderForEncodedPasswordAndMatchers(string $encoded, array $matchers)
__construct(array $config=[])
getValidEncoders($config)