HTTP Auth for the panel
fqdn/admin/login.php?http_auth=true
This commit is contained in:
Alan Garcia 2010-12-20 22:28:33 +00:00
parent a40a2b8cfa
commit 3dfae49cda
1 changed files with 15 additions and 1 deletions

View File

@ -27,6 +27,20 @@
Purpose of file: Purpose of file:
---------------------------------------------------------------------- ----------------------------------------------------------------------
*/ */
// 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");
if (!$mem->checkid()) if (!$mem->checkid())