mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Autologin: Use REMOTE_USER for authentication
It's not safe to rely on PHP_AUTH_USER and PHP_AUTH_TYPE because PHP cgi handlers (fgcid for example) only set the REMOTE_USER environment variable and the authentication type for negogiation methods (Kerberos for example) is neither Basic nor Digest. We may have to add REDIRECT_REMOTE_USER for authentication for proxy setups.
This commit is contained in:
parent
c09341d77e
commit
63fc8eb27e
@ -53,11 +53,8 @@ class AutoLoginBackend extends UserBackend
|
|||||||
*/
|
*/
|
||||||
public function hasUser(User $user)
|
public function hasUser(User $user)
|
||||||
{
|
{
|
||||||
if (isset($_SERVER['PHP_AUTH_USER'])
|
if (isset($_SERVER['REMOTE_USER'])) {
|
||||||
&& isset($_SERVER['AUTH_TYPE'])
|
$username = $_SERVER['REMOTE_USER'];
|
||||||
&& in_array($_SERVER['AUTH_TYPE'], array('Basic', 'Digest')) === true
|
|
||||||
) {
|
|
||||||
$username = $_SERVER['PHP_AUTH_USER'];
|
|
||||||
|
|
||||||
if ($username !== false) {
|
if ($username !== false) {
|
||||||
if ($this->stripUsernameRegexp !== null) {
|
if ($this->stripUsernameRegexp !== null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user