Autologin: Actually set the username upon authentication
Before, when using autologin the username of the authenticated user always was the empty string.
This commit is contained in:
parent
65a2bd41bc
commit
992ccf4f6d
|
@ -55,14 +55,17 @@ class AutoLoginBackend extends UserBackend
|
||||||
{
|
{
|
||||||
if (isset($_SERVER['REMOTE_USER'])) {
|
if (isset($_SERVER['REMOTE_USER'])) {
|
||||||
$username = $_SERVER['REMOTE_USER'];
|
$username = $_SERVER['REMOTE_USER'];
|
||||||
|
|
||||||
if ($username !== false) {
|
|
||||||
if ($this->stripUsernameRegexp !== null) {
|
if ($this->stripUsernameRegexp !== null) {
|
||||||
$username = preg_replace($this->stripUsernameRegexp, '', $username);
|
$stripped = preg_replace($this->stripUsernameRegexp, '', $username);
|
||||||
|
if ($stripped !== false) {
|
||||||
|
// TODO(el): PHP issues a warning when PHP cannot compile the regular expression. Should we log an
|
||||||
|
// additional message in that case?
|
||||||
|
$username = $stripped;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
$user->setUsername($username);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue