diff --git a/application/forms/Config/UserBackend/ExternalBackendForm.php b/application/forms/Config/UserBackend/ExternalBackendForm.php index f178f53a2..f4a463911 100644 --- a/application/forms/Config/UserBackend/ExternalBackendForm.php +++ b/application/forms/Config/UserBackend/ExternalBackendForm.php @@ -3,7 +3,6 @@ namespace Icinga\Forms\Config\UserBackend; -use Icinga\Authentication\User\ExternalBackend; use Zend_Validate_Callback; use Icinga\Web\Form; @@ -56,31 +55,6 @@ class ExternalBackendForm extends Form 'validators' => array($callbackValidator) ) ); - - $hasRemoteUser = false; - foreach (ExternalBackend::$remoteUserEnvvars as $envvar) { - if (ExternalBackend::getRemoteUser($envvar) !== null) { - $hasRemoteUser = true; - break; - } - } - if (! $hasRemoteUser) { - $envvar = 'REMOTE_USER'; - } - - $this->addElement( - 'text', - 'username_envvar', - array( - 'label' => $this->translate('Username Environment Variable'), - 'description' => $this->translate( - 'The environment variable the webserver assigns the authenticated user\'s name to.' - ), - 'required' => true, - 'value' => $envvar - ) - ); - $this->addElement( 'hidden', 'backend', diff --git a/modules/setup/application/forms/AdminAccountPage.php b/modules/setup/application/forms/AdminAccountPage.php index b636063c9..3252ec160 100644 --- a/modules/setup/application/forms/AdminAccountPage.php +++ b/modules/setup/application/forms/AdminAccountPage.php @@ -270,7 +270,7 @@ class AdminAccountPage extends Form */ protected function getUsername() { - $name = ExternalBackend::getRemoteUser($this->backendConfig['username_envvar']); + list($name, $_) = ExternalBackend::getRemoteUserInformation(); if ($name === null) { return ''; } diff --git a/modules/setup/application/forms/AuthenticationPage.php b/modules/setup/application/forms/AuthenticationPage.php index 97356cab8..52e3c66f8 100644 --- a/modules/setup/application/forms/AuthenticationPage.php +++ b/modules/setup/application/forms/AuthenticationPage.php @@ -32,14 +32,8 @@ class AuthenticationPage extends Form public function createElements(array $formData) { if (isset($formData['type']) && $formData['type'] === 'external') { - $hasRemoteUser = false; - foreach (ExternalBackend::$remoteUserEnvvars as $envvar) { - if (ExternalBackend::getRemoteUser($envvar) !== null) { - $hasRemoteUser = true; - break; - } - } - if (! $hasRemoteUser) { + list($username, $_) = ExternalBackend::getRemoteUserInformation(); + if ($username === null) { $this->info( $this->translate( 'You\'re currently not authenticated using any of the web server\'s authentication '