Changeset - 6c07ae1b7762
[Not reviewed]
default
0 2 0
Ethan Zonca - 15 years ago 2010-12-02 22:02:07
ez@ethanzonca.com
Config changes and minor fixes for admin auth
2 files changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
admin.php
Show inline comments
 
@@ -25,10 +25,11 @@
 
  if(!isset($admin_pass)) {
 
    echo "<p>Administration password not configured. See config.inc for more information.</p>";
 
    $adminpage->foot();
 
    exit;
 
  }
 

	
 
  // Force authentication
 
  else if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_PW'] != $admin_pass) {
 
  else if (!isset($_SERVER['PHP_AUTH_USER']) || (!isset($_SERVER['PHP_AUTH_PW'])) || $_SERVER['PHP_AUTH_PW'] != $admin_pass) {
 
    header('WWW-Authenticate: Basic realm="My Realm"');
 
    header('HTTP/1.0 401 Unauthorized');
 
    echo '<p>You must authenticate to view this page.</p>';
inc/config.inc.example
Show inline comments
 
@@ -68,4 +68,10 @@
 
/* $reCaptcha_priv = ''; */
 
/* $reCaptcha_pub = ''; */ 
 

	
 
/**
 
 * \brief
 
 *   Password to be used for administration page (admin.php). Setting this variable enables the administration page.
 
 *
 
 */
 
/* $admin_pass = ''; */
 

	
0 comments (0 inline, 0 general)