| version 1.2, 2002/10/16 21:19:22 |
version 1.3, 2003/12/15 13:48:25 |
|
|
| <?php
|
<?php |
|
|
|
| /**************************************************************************
|
/************************************************************************** |
| *
|
* |
| * auth.php
|
* auth.php |
| *
|
* |
| * This is a plugin for phpWebFileManager that allows you to restrict
|
* This is a plugin for phpWebFileManager that allows you to restrict |
| * access to phpWebFileManager script using HTTP authentication. Edit
|
* access to phpWebFileManager script using HTTP authentication. Edit |
| * username and password constants below.
|
* username and password constants below. |
| *
|
* |
| **************************************************************************/
|
**************************************************************************/ |
|
|
|
| /* $Platon: $ */
|
/* $Platon: phpWebFileManager/plugins/auth.php,v 1.2 2002/10/16 21:19:22 nepto Exp $ */ |
|
|
|
| if (! isset($PHP_AUTH_USER) || ! isset($PHP_AUTH_PW)
|
if (! isset($PHP_AUTH_USER) || ! isset($PHP_AUTH_PW) |
| || $PHP_AUTH_USER != 'username' || $PHP_AUTH_PW != 'password') {
|
|| $PHP_AUTH_USER != 'username' || $PHP_AUTH_PW != 'password') { |
|
|
|
| header('WWW-Authenticate: Basic realm="phpWebFileManager authentication"');
|
header('WWW-Authenticate: Basic realm="phpWebFileManager authentication"'); |
| header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized'); |
| echo '<center><h1>Authentication required</h1></center>';
|
echo '<center><h1>Authentication required</h1></center>'; |
| exit;
|
exit; |
|
|
|
| } else {
|
} else { |
|
|
|
| // sucessfully authenticated
|
// sucessfully authenticated |
|
|
|
| }
|
} |
|
|
|
| ?>
|
?> |