ExternalBackendForm: set default username envvar explicitly

refs #12164
This commit is contained in:
Alexander A. Klimov 2016-11-04 17:31:52 +01:00
parent d9330486e9
commit 846f8ec3d8

View File

@ -57,11 +57,17 @@ class ExternalBackendForm extends Form
) )
); );
$hasRemoteUser = false;
foreach (ExternalBackend::$remoteUserEnvvars as $envvar) { foreach (ExternalBackend::$remoteUserEnvvars as $envvar) {
if (ExternalBackend::getRemoteUser($envvar) !== null) { if (ExternalBackend::getRemoteUser($envvar) !== null) {
$hasRemoteUser = true;
break; break;
} }
} }
if (! $hasRemoteUser) {
$envvar = 'REMOTE_USER';
}
$this->addElement( $this->addElement(
'text', 'text',
'username_envvar', 'username_envvar',