19 declare(strict_types=1);
44 if (!empty($config)) {
45 foreach ($config as $key => $value) {
46 switch (strtolower($key)) {
47 case 'default_password_encoder':
79 $this->supported_encoders = [];
82 foreach ($encoders as $encoder) {
83 if ($encoder->isSupportedByRuntime()) {
84 $this->supported_encoders[$encoder->getName()] = $encoder;
113 $this->supported_encoders = [];
114 foreach ($supported_encoders as $encoder) {
115 if (!($encoder instanceof
ilPasswordEncoder) || !$encoder->isSupportedByRuntime()) {
117 'One of the passed encoders is not valid: %s.',
118 print_r($encoder,
true)
121 $this->supported_encoders[$encoder->getName()] = $encoder;
138 if ($name !==
null && isset($this->supported_encoders[$name])) {
139 return $this->supported_encoders[$name];
143 throw new ilUserException(
'No default encoder specified, fallback not possible.');
147 throw new ilUserException(
"No default encoder found for name: '{$this->getDefaultEncoder()}'.");
setDefaultEncoder(string $default_encoder)
array $supported_encoders
getEncoders(array $config)
__construct(array $config=[])
getEncoderByName(?string $name)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
initEncoders(array $config)
getSupportedEncoderNames()
setSupportedEncoders(array $supported_encoders)