1 <?php declare(strict_types=1);
4 require_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();
102 foreach ($encoders as $encoder) {
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) {
131 throw new ilUserException(sprintf(
'The encoder "%s" was not configured.', $name));
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
Class for user related exception handling in ILIAS.
setEncoders(array $encoders)
getValidEncoders($config)
initEncoders(array $config)
__construct(array $config=[])
getFirstEncoderForEncodedPasswordAndMatchers(string $encoded, array $matchers)
setDefaultEncoder(string $defaultEncoder)
getSupportedEncoderNames()
getEncoderByName($name, $get_default_on_mismatch=false)