note 87470 rejected from features.http-auth by danbrown

From: Date: Sat, 06 Dec 2008 13:19:34 +0000
Subject: note 87470 rejected from features.http-auth by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-147748@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- ask for assistance, script it does not work why? <?php $selfSecure = 1; $shellUser = "demo"; $shellPswd = "demo"; $adminEmail = "admin email hier eingeben"; $fromEmail = $HTTP_SERVER_VARS["SERVER_ADMIN"]; $Version = "Your details here (for example The Webmaster - webmaster@xxx.com)"; if($selfSecure){ if ($PHP_AUTH_PW!=$shellUser exit;} else echo"{$PHP_AUTH_USER!=$shellPswd}" { Header('WWW-Authenticate: Basic realm="WWW-Authenticate"'); Header('HTTP/1.0 401 Unauthorized'); echo "<html> <head> <title>Error - Access Denied</title> </head> <h1>Access denied</h1> A warning message has been sent to the webmaster. Your IP address has also been recorded <hr> <em>$Version</em>"; if(isset($PHP_AUTH_USER)){ $warnMsg =" Somebody tried to access the script on: http://".$HTTP_SERVER_VARS["HTTP_HOST"]."$PHP_SELF using the wrong username or password: Date: ".date("Y-m-d H:i:s")." IP: ".$HTTP_SERVER_VARS["REMOTE_ADDR"]." User Agent: ".$HTTP_SERVER_VARS["HTTP_USER_AGENT"]." username used: $PHP_AUTH_USER password used: $PHP_AUTH_PW "; mail($adminEmail,"Unauthorized Access",$warnMsg, "From: $fromEmail\nX-Mailer:$Version AutoWarn System"); } exit; } } if(!$oCols)$oCols=$termCols; if(!$oRows)$oRows=$termRows; ?>

« previous php.notes (#147748) next »