moving HTTP_AUTH from login.php to config.php, and use HTTP_AUTH if provided, even without ?http_auth=1
This commit is contained in:
parent
f40cb1bebe
commit
8c9f58d70f
|
@ -28,18 +28,6 @@
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// For people who want to authenticate with HTTP AUTH
|
|
||||||
if (isset($_GET['http_auth'])) $http_auth=strval($_GET['http_auth']);
|
|
||||||
if ($http_auth) {
|
|
||||||
if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW'])) {
|
|
||||||
header('WWW-Authenticate: Basic realm="Test Authentication System"');
|
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
|
||||||
} else {
|
|
||||||
// Gruiiik
|
|
||||||
$_REQUEST["username"]=$_SERVER['PHP_AUTH_USER'];
|
|
||||||
$_REQUEST["password"]=$_SERVER['PHP_AUTH_PW'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,22 @@ if (ini_get("safe_mode")) {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For people who want to authenticate with HTTP AUTH
|
||||||
|
if (isset($_GET['http_auth'])) $http_auth=strval($_GET['http_auth']);
|
||||||
|
if ($http_auth) {
|
||||||
|
if (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['PHP_AUTH_PW'])) {
|
||||||
|
header('WWW-Authenticate: Basic realm="Test Authentication System"');
|
||||||
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) {
|
||||||
|
// Gruiiik
|
||||||
|
$_REQUEST["username"]=$_SERVER['PHP_AUTH_USER'];
|
||||||
|
$_REQUEST["password"]=$_SERVER['PHP_AUTH_PW'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$help_baseurl="http://www.aide-alternc.org/";
|
$help_baseurl="http://www.aide-alternc.org/";
|
||||||
|
|
||||||
/* PHPLIB inclusions : */
|
/* PHPLIB inclusions : */
|
||||||
|
|
Loading…
Reference in New Issue