mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
parent
274fc58d0f
commit
160a95e32d
@ -201,13 +201,19 @@ class Web extends ApplicationBootstrap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create user object and inject preference interface
|
* Create user object
|
||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
* @throws ConfigurationError
|
|
||||||
*/
|
*/
|
||||||
private function setupUser()
|
private function setupUser()
|
||||||
{
|
{
|
||||||
|
$authenticationManager = AuthenticationManager::getInstance();
|
||||||
|
|
||||||
|
if ($authenticationManager->isAuthenticated() === true) {
|
||||||
|
$this->user = $authenticationManager->getUser();
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$config = Config::app('authentication');
|
$config = Config::app('authentication');
|
||||||
} catch (NotReadableError $e) {
|
} catch (NotReadableError $e) {
|
||||||
@ -216,15 +222,13 @@ class Web extends ApplicationBootstrap
|
|||||||
);
|
);
|
||||||
$config = null;
|
$config = null;
|
||||||
}
|
}
|
||||||
$authenticationManager = AuthenticationManager::getInstance($config);
|
|
||||||
if ($config !== null && $config->global !== null &&
|
if ($config !== null && $config->global !== null &&
|
||||||
$config->global->get('authenticationMode', 'internal') === 'external'
|
$config->global->get('authenticationMode', 'internal') === 'external'
|
||||||
) {
|
) {
|
||||||
$authenticationManager->authenticateFromRemoteUser();
|
$authenticationManager->authenticateFromRemoteUser();
|
||||||
}
|
}
|
||||||
if ($authenticationManager->isAuthenticated() === true) {
|
|
||||||
$this->user = $authenticationManager->getUser();
|
|
||||||
}
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user