mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 05:44:36 +02:00
Autologin: Fix that the backend name must have been `autologin'
Before, the code validated the name of the backend instead of the `backend' directive against `autologin'.
This commit is contained in:
parent
74fe4199fa
commit
db73d324de
@ -85,7 +85,14 @@ abstract class UserBackend implements Countable
|
|||||||
}
|
}
|
||||||
return new $backendConfig->class($backendConfig);
|
return new $backendConfig->class($backendConfig);
|
||||||
}
|
}
|
||||||
if ($name === 'autologin') {
|
if (($backendType = $backendConfig->backend) === null) {
|
||||||
|
throw new ConfigurationError(
|
||||||
|
'Authentication configuration for backend "' . $name
|
||||||
|
. '" is missing the backend directive'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$backendType = strtolower($backendType);
|
||||||
|
if ($backendType === 'autologin') {
|
||||||
$backend = new AutoLoginBackend($backendConfig);
|
$backend = new AutoLoginBackend($backendConfig);
|
||||||
$backend->setName($name);
|
$backend->setName($name);
|
||||||
return $backend;
|
return $backend;
|
||||||
@ -96,12 +103,6 @@ abstract class UserBackend implements Countable
|
|||||||
. '" is missing the resource directive'
|
. '" is missing the resource directive'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (($backendType = $backendConfig->backend) === null) {
|
|
||||||
throw new ConfigurationError(
|
|
||||||
'Authentication configuration for backend "' . $name
|
|
||||||
. '" is missing the backend directive'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
$resourceConfig = ResourceFactory::getResourceConfig($backendConfig->resource);
|
$resourceConfig = ResourceFactory::getResourceConfig($backendConfig->resource);
|
||||||
} catch (ProgrammingError $e) {
|
} catch (ProgrammingError $e) {
|
||||||
@ -110,7 +111,7 @@ abstract class UserBackend implements Countable
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
$resource = ResourceFactory::createResource($resourceConfig);
|
$resource = ResourceFactory::createResource($resourceConfig);
|
||||||
switch (strtolower($backendType)) {
|
switch ($backendType) {
|
||||||
case 'db':
|
case 'db':
|
||||||
$backend = new DbUserBackend($resource);
|
$backend = new DbUserBackend($resource);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user