Fix for not-updated admins extension
authorRoland Häder <roland@mxchange.org>
Thu, 18 Sep 2008 22:43:53 +0000 (22:43 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 18 Sep 2008 22:43:53 +0000 (22:43 +0000)
inc/databases.php
inc/modules/admin/admin-inc.php

index 55f30fc..fd84b00 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "363");
+define('CURR_SVN_REVISION', "364");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index ee90ca6..14f5067 100644 (file)
@@ -132,11 +132,15 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password)
                        // Store it in session
                        set_session('mxchange_admin_failtures', $data['login_failtures']);
                        set_session('mxchange_admin_last_fail', $data['last_failture']);
-               } // END - if
 
-               // Update password
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET password='%s',login_failtures=0,last_failture='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1",
-                array($data['password'], $admin_login), __FILE__, __LINE__);
+                       // Update password and reset login failtures
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET password='%s',login_failtures=0,last_failture='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1",
+                               array($data['password'], $admin_login), __FILE__, __LINE__);
+               } else {
+                       // Update password
+                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admins SET password='%s' WHERE login='%s' LIMIT 1",
+                               array($data['password'], $admin_login), __FILE__, __LINE__);
+               }
 
                // Rebuild cache
                REBUILD_CACHE("admins", "admin");
@@ -228,7 +232,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
                SQL_FREERESULT($result);
        }
 
-       //* DEBUG: */ echo __FUNCTION__.":".$pass."(".strlen($pass).")/".$password."(".strlen($password).")<br />\n";
+       //* DEBUG: */ echo __FUNCTION__.":".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")<br />\n";
 
        // Check if password matches
        if (($ret == "pass") && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {