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
1 changed files with 6 additions and 0 deletions

View File

@ -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',