From 3dfae49cda7f420d6bb43a0c086fd79c7498f38e Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Mon, 20 Dec 2010 22:28:33 +0000 Subject: [PATCH] Close #62 HTTP Auth for the panel fqdn/admin/login.php?http_auth=true --- bureau/admin/login.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bureau/admin/login.php b/bureau/admin/login.php index d9b2bcd6..332098c7 100644 --- a/bureau/admin/login.php +++ b/bureau/admin/login.php @@ -27,6 +27,20 @@ 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"); if (!$mem->checkid()) @@ -39,4 +53,4 @@ if (!$mem->checkid()) include("main.php"); exit; -?> \ No newline at end of file +?>