[icinga-checkins] icinga.org: icingaweb2/master: ExternalBackendForm: Remove option to configure where to fetch a remote user

git at icinga.org git at icinga.org
Mon Nov 21 08:53:51 CET 2016


Module: icingaweb2
Branch: master
Commit: 2c817215cbd56d7c0df2926c0656376b293c7c79
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=2c817215cbd56d7c0df2926c0656376b293c7c79

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Wed Nov 16 12:06:58 2016 +0100

ExternalBackendForm: Remove option to configure where to fetch a remote user

refs #12164

---

 .../Config/UserBackend/ExternalBackendForm.php     |   26 --------------------
 .../setup/application/forms/AdminAccountPage.php   |    2 +-
 .../setup/application/forms/AuthenticationPage.php |   10 ++------
 3 files changed, 3 insertions(+), 35 deletions(-)

diff --git a/application/forms/Config/UserBackend/ExternalBackendForm.php b/application/forms/Config/UserBackend/ExternalBackendForm.php
index f178f53..f4a4639 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 b636063..3252ec1 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 97356ca..52e3c66 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 '



More information about the icinga-checkins mailing list