mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 22:04:25 +02:00
setup/AuthenticationPage: don't show the warning about external backend configuration if REDIRECT_REMOTE_USER is set
refs #12164
This commit is contained in:
parent
be4a31c8e1
commit
d6ac6c8374
@ -57,7 +57,7 @@ class ExternalBackendForm extends Form
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach (array('REDIRECT_REMOTE_USER', 'REMOTE_USER') as $envvar) {
|
foreach (ExternalBackend::getRemoteUserEnvvars() as $envvar) {
|
||||||
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,15 @@ class ExternalBackend implements UserBackendInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get possible variables where to read the user from
|
||||||
|
*
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public static function getRemoteUserEnvvars()
|
||||||
|
{
|
||||||
|
return array('REDIRECT_REMOTE_USER', 'REMOTE_USER');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
@ -31,16 +31,24 @@ class AuthenticationPage extends Form
|
|||||||
*/
|
*/
|
||||||
public function createElements(array $formData)
|
public function createElements(array $formData)
|
||||||
{
|
{
|
||||||
if (isset($formData['type']) && $formData['type'] === 'external'
|
if (isset($formData['type']) && $formData['type'] === 'external') {
|
||||||
&& ExternalBackend::getRemoteUser(null) === null) {
|
$hasRemoteUser = false;
|
||||||
$this->info(
|
foreach (ExternalBackend::getRemoteUserEnvvars() as $envvar) {
|
||||||
$this->translate(
|
if (ExternalBackend::getRemoteUser($envvar) !== null) {
|
||||||
'You\'re currently not authenticated using any of the web server\'s authentication '
|
$hasRemoteUser = true;
|
||||||
. 'mechanisms. Make sure you\'ll configure such, otherwise you\'ll not be able to '
|
break;
|
||||||
. 'log into Icinga Web 2.'
|
}
|
||||||
),
|
}
|
||||||
false
|
if (! $hasRemoteUser) {
|
||||||
);
|
$this->info(
|
||||||
|
$this->translate(
|
||||||
|
'You\'re currently not authenticated using any of the web server\'s authentication '
|
||||||
|
. 'mechanisms. Make sure you\'ll configure such, otherwise you\'ll not be able to '
|
||||||
|
. 'log into Icinga Web 2.'
|
||||||
|
),
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$backendTypes = array();
|
$backendTypes = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user