From 846f8ec3d8a59155a187d54e45c668ca75057213 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 4 Nov 2016 17:31:52 +0100 Subject: [PATCH] ExternalBackendForm: set default username envvar explicitly refs #12164 --- .../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 61303b0f3..f178f53a2 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',