PHP Classes

Please fix

Recommend this page to a friend!

      RSS Error  >  All threads  >  Please fix  >  (Un) Subscribe thread alerts  
Subject:Please fix
Summary:If no pass is provided, user gets a blank page
Messages:1
Author:Alexander Skakunov
Date:2007-07-17 22:29:15
 

  1. Please fix   Reply   Report abuse  
Picture of Alexander Skakunov Alexander Skakunov - 2007-07-17 22:29:15
Hey! The idea is very nice!

Anyway... :]

Please fix this part:

//Ok, I know, it's horrible. I promise fix it soon.
if(!isset($_GET["p"])) exit;
if($_GET["p"] != $this->args["password"] ) exit;

At least, like this:

if ((!isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) ||
$HTTP_SERVER_VARS['PHP_AUTH_USER']!=... ||
$HTTP_SERVER_VARS['PHP_AUTH_PW']!=...))
{
header("WWW-Authenticate: Basic realm=...");
header("HTTP/1.0 401 Unauthorized");
exit("...");
}

Otherwise user gets NO output. I think many developers just thrown you nice class away because of this sad issue.