3 declare(strict_types=1);
40 switch (strtolower(
$key)) {
41 case 'default_password_encoder':
74 foreach ($encoders as $encoder) {
75 if ($encoder->isSupportedByRuntime()) {
76 $this->encoders[$encoder->getName()] = $encoder;
105 $this->encoders = [];
106 foreach ($encoders as $encoder) {
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) {
138 throw new ilUserException(sprintf(
'The encoder "%s" was not configured.', $name));
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...
getEncoderByName(?string $name, bool $get_default_on_mismatch=false)
setEncoders(array $encoders)
initEncoders(array $config)
__construct(array $config=[])
getValidEncoders(array $config)
getFirstEncoderForEncodedPasswordAndMatchers(string $encoded, array $matchers)
setDefaultEncoder(string $defaultEncoder)
getSupportedEncoderNames()