fix: Fixed http-auth not honouring http_auth_guest (#6699)

* fix: Fixed http-auth not honouring http_auth_guest

* Always fall back to http_auth_guest.
Make sure $username is set, otherwise, we won't try to authenticate.

* reverted elseif to default to http-auth-guest

* Update authenticate.inc.php

simplify logic
This commit is contained in:
Neil Lathwood
2017-05-23 08:40:57 +01:00
committed by GitHub
parent 1570ea95c0
commit 14a143a6a7
2 changed files with 24 additions and 24 deletions

View File

@@ -56,9 +56,9 @@ try {
$username = clean($_REQUEST['username']);
$password = $_REQUEST['password'];
} elseif (isset($_SERVER['REMOTE_USER'])) {
$username = $_SERVER['REMOTE_USER'];
$username = clean($_SERVER['REMOTE_USER']);
} elseif (isset($_SERVER['PHP_AUTH_USER']) && $config['auth_mechanism'] === 'http-auth') {
$username = $_SERVER['PHP_AUTH_USER'];
$username = clean($_SERVER['PHP_AUTH_USER']);
}
// form authentication