add auth
This commit is contained in:
12
auth.php
Normal file
12
auth.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
include('config.inc.php');
|
||||
|
||||
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) ||
|
||||
$_SERVER['PHP_AUTH_USER'] !== $inc_username || $_SERVER['PHP_AUTH_PW'] !== $inc_password) {
|
||||
header('WWW-Authenticate: Basic realm="Protected Area"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo 'Access denied.';
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user