fixed auth when proxy is involved #6183 (#6192)

This commit is contained in:
Neil Lathwood
2017-03-14 08:04:47 +00:00
committed by GitHub
parent 0f5091d273
commit c4ca5023a7

View File

@@ -46,7 +46,7 @@ if (isset($_POST['username']) && isset($_POST['password'])) {
$_SESSION['password'] = $_GET['password'];
} elseif (isset($_SERVER['REMOTE_USER'])) {
$_SESSION['username'] = $_SERVER['REMOTE_USER'];
} elseif (isset($_SERVER['PHP_AUTH_USER'])) {
} elseif (isset($_SERVER['PHP_AUTH_USER']) && $config['auth_mechanism'] === 'http-auth') {
$_SESSION['username'] = $_SERVER['PHP_AUTH_USER'];
}
@@ -97,7 +97,7 @@ if ((isset($_SESSION['username'])) || (isset($_COOKIE['sess_id'],$_COOKIE['token
$permissions = permissions_cache($_SESSION['user_id']);
if (isset($_POST['username'])) {
header('Location: '.$_SERVER['REQUEST_URI'], true, 303);
header('Location: '.$_SERVER['REQUEST_URI'] ?: $config['base_url'], true, 303);
exit;
}
} elseif (isset($_SESSION['username'])) {