3declare(strict_types=1);
40 switch (strtolower(
$key)) {
41 case 'default_password_encoder':
75 if ($encoder->isSupportedByRuntime()) {
76 $this->encoders[$encoder->getName()] = $encoder;
105 $this->encoders = [];
109 'One of the passed encoders is not valid: %s.',
110 json_encode($encoder, JSON_THROW_ON_ERROR)
113 $this->encoders[$encoder->getName()] = $encoder;
133 if (
$name !==
null && isset($this->encoders[
$name])) {
134 return $this->encoders[
$name];
137 if (!$get_default_on_mismatch) {
140 throw new ilUserException(
'No default encoder specified, fallback not possible.');
142 throw new ilUserException(
"No default encoder found for name: '{$this->getDefaultEncoder()}'.");
157 foreach ($matchers as $encoderName => $callback) {
159 is_callable($callback) &&
160 $encoder->getName() === $encoderName &&
161 $callback($encoded) ===
true
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setEncoders(array $encoders)
getValidEncoders(array $config)
getEncoderByName(?string $name, bool $get_default_on_mismatch=false)
initEncoders(array $config)
getSupportedEncoderNames()
setDefaultEncoder(string $defaultEncoder)
getFirstEncoderForEncodedPasswordAndMatchers(string $encoded, array $matchers)
__construct(array $config=[])