auth_remote: rewrite header checking to be more readable
This commit is contained in:
parent
4e3ef7a4dd
commit
8a34084df1
|
@ -41,12 +41,14 @@ class Auth_Remote extends Plugin implements IAuthModule {
|
||||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||||
*/
|
*/
|
||||||
function authenticate($login, $password) {
|
function authenticate($login, $password) {
|
||||||
$try_login = $_SERVER["REMOTE_USER"];
|
$try_login = "";
|
||||||
if (!$try_login) $try_login = $_SERVER["HTTP_REMOTE_USER"];
|
|
||||||
|
|
||||||
// php-cgi
|
foreach (["REMOTE_USER", "HTTP_REMOTE_USER", "REDIRECT_REMOTE_USER", "PHP_AUTH_USER"] as $hdr) {
|
||||||
if (!$try_login) $try_login = $_SERVER["REDIRECT_REMOTE_USER"];
|
if (isset($_SERVER[$hdr])) {
|
||||||
if (!$try_login) $try_login = $_SERVER["PHP_AUTH_USER"];
|
$try_login = $_SERVER["hdr"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$try_login) $try_login = $this->get_login_by_ssl_certificate();
|
if (!$try_login) $try_login = $this->get_login_by_ssl_certificate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue