basic setup and login mechanisms are done
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@23 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
parent
69f7fbb050
commit
4c553504b2
7 changed files with 300 additions and 7 deletions
20
php/wantauth.php
Normal file
20
php/wantauth.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* start a request for HTTP Authentication
|
||||
*/
|
||||
function authenticate() {
|
||||
header('WWW-Authenticate: Basic realm="GNU-viech administration tool"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo _("You are not allowed to use this application without valid authentication data.");
|
||||
printf(_("You entered: %s, %s (md5: %s)"),
|
||||
$_SERVER["PHP_AUTH_USER"],
|
||||
$_SERVER["PHP_AUTH_PW"],
|
||||
md5($_SERVER["PHP_AUTH_PW"]));
|
||||
exit;
|
||||
}
|
||||
|
||||
// common code to force that the user is authenticated
|
||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
authenticate();
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue