]> git.mxchange.org Git - mailer.git/commitdiff
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 55f30fc1720328c8f4b6a60e2c6e80c784db2010..fd84b00e0e7799d0b6cf36d9e8e220086a3dcaa8 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 ee90ca6bc94f638cd7b0789528b825d66b091e23..14f50673679a3e20dbac801e214e00f2f7f5f729 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)))) {