From: Roland Häder Date: Thu, 18 Sep 2008 22:43:53 +0000 (+0000) Subject: Fix for not-updated admins extension X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7fbaac24c4f4f701c2f0e75fab418a6e2894a3a9;p=mailer.git Fix for not-updated admins extension --- diff --git a/inc/databases.php b/inc/databases.php index 55f30fc172..fd84b00e0e 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -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); diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index ee90ca6bc9..14f5067367 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -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).")
\n"; + //* DEBUG: */ echo __FUNCTION__.":".generatePassString($pass)."(".strlen($pass).")/".$password."(".strlen($password).")
\n"; // Check if password matches if (($ret == "pass") && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {