pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] rev 2232 - trunk/contrib/level_comment_tool


From: address@hidden
Subject: [Pingus-CVS] rev 2232 - trunk/contrib/level_comment_tool
Date: Fri, 09 Apr 2004 20:18:26 +0200

Author: torangan
Date: 2004-04-09 20:18:26 +0200 (Fri, 09 Apr 2004)
New Revision: 2232

Modified:
   trunk/contrib/level_comment_tool/README
   trunk/contrib/level_comment_tool/index.php
Log:
patch for better admin login


Modified: trunk/contrib/level_comment_tool/README
===================================================================
--- trunk/contrib/level_comment_tool/README     2004-04-09 14:04:34 UTC (rev 
2231)
+++ trunk/contrib/level_comment_tool/README     2004-04-09 18:18:26 UTC (rev 
2232)
@@ -20,7 +20,7 @@
 
 Copyright
 
-Pingus Level Feedback System is (c) 2003 by Jarno Elonen
+Pingus Level Feedback System is (c) 2003-2004 by Jarno Elonen
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
@@ -36,3 +36,9 @@
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston,
   MA  02111-1307, USA.
+
+NOTE: 
+
+  Unlike other parts, 'htpasswd.inc' is licensed under Modified BSD
+  license, which is less restrictive than GPL. You can, however,
+  relicense it under the GPL, if necessary.

Modified: trunk/contrib/level_comment_tool/index.php
===================================================================
--- trunk/contrib/level_comment_tool/index.php  2004-04-09 14:04:34 UTC (rev 
2231)
+++ trunk/contrib/level_comment_tool/index.php  2004-04-09 18:18:26 UTC (rev 
2232)
@@ -19,12 +19,17 @@
 require_once("xml-search.inc");
 require_once("level-cache.inc");
 require_once("mail-settings.inc");
+require_once("htpasswd.inc");
 
 // ==================================================================
 // Admin login.
 // ==================================================================
-$admin_passwd = "testadmin";
-$is_admin = ($_SERVER['PHP_AUTH_PW'] === $admin_passwd);
+
+$htpasswd = load_htpasswd();
+$is_admin = False;
+if ( isset($_SERVER['PHP_AUTH_PW']))
+  $is_admin = test_htpasswd( $htpasswd,  "admin", $_SERVER['PHP_AUTH_PW'] );
+
 if ( isset($_GET["adminlogin"]))
 {
   if (!isset($_SERVER['PHP_AUTH_USER']))
@@ -37,7 +42,7 @@
   else
   {
     if ( !isset($_SERVER['PHP_AUTH_PW']) ||
-      $_SERVER['PHP_AUTH_PW'] != $admin_passwd )
+      !test_htpasswd( $htpasswd,  "admin", $_SERVER['PHP_AUTH_PW'] ))
     {
       header('HTTP/1.0 401 Unauthorized');
       echo 'Wrong password. Hit Back.';





reply via email to

[Prev in Thread] Current Thread [Next in Thread]