[icinga-checkins] icinga.org: icingaweb2/bugfix/evaluate-redirect_remote_user-12164: ExternalBackendForm: set default username envvar explicitly

git at icinga.org git at icinga.org
Fri Nov 4 17:34:46 CET 2016


Module: icingaweb2
Branch: bugfix/evaluate-redirect_remote_user-12164
Commit: 846f8ec3d8a59155a187d54e45c668ca75057213
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=846f8ec3d8a59155a187d54e45c668ca75057213

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Fri Nov  4 17:31:52 2016 +0100

ExternalBackendForm: set default username envvar explicitly

refs #12164

---

 application/forms/Config/UserBackend/ExternalBackendForm.php |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/application/forms/Config/UserBackend/ExternalBackendForm.php b/application/forms/Config/UserBackend/ExternalBackendForm.php
index 61303b0..f178f53 100644
--- a/application/forms/Config/UserBackend/ExternalBackendForm.php
+++ b/application/forms/Config/UserBackend/ExternalBackendForm.php
@@ -57,11 +57,17 @@ class ExternalBackendForm extends Form
             )
         );
 
+        $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',



More information about the icinga-checkins mailing list