Created
March 1, 2013 17:56
-
-
Save SemanticallyNull/5066471 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!( | |
isset($_SERVER['PHP_AUTH_USER']) | |
&& 'username' == $_SERVER['PHP_AUTH_USER'] | |
&& isset($_SERVER['PHP_AUTH_PW']) | |
&& sha1('password') == sha1($_SERVER['PHP_AUTH_PW']) | |
)) { | |
header('WWW-Authenticate: Basic realm="Orchestra"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
echo "You must authenticate to use this site.\n\n"; | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment