From ccd9707eacd50fc34e20cbb9a570007020bc6c1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 17 Sep 2008 11:35:41 +0000 Subject: [PATCH] Login failtures for members now working --- inc/databases.php | 2 +- inc/modules/chk_login.php | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 9f32e235d7..1fd899b609 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', "347"); +define('CURR_SVN_REVISION', "348"); // 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/chk_login.php b/inc/modules/chk_login.php index d8d36986d4..a96bc1d651 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { // @TODO Replace with own template! OPEN_TABLE("500", "guest_login_header dashed", "center"); -OUTPUT_HTML("
".VALIDATING_LOGIN."
"); +OUTPUT_HTML("
".VALIDATING_LOGIN."
"); if (!empty($GLOBALS['userid']) && (isSessionVariableSet('u_hash')) && (isSessionVariableSet('lifetime'))) { // Login failtures are supported since 0.4.7 @@ -65,6 +65,13 @@ if (!empty($GLOBALS['userid']) && (isSessionVariableSet('u_hash')) && (isSession // Remmeber login failtures if available if (GET_EXT_VERSION("sql_patches") >= "0.4.7") { + // Reset login failtures + SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data +SET login_failtures=0, last_failture='0000-00-00 00:00:00' +WHERE userid=%s +LIMIT 1", + array($GLOBALS['userid']), __FILE__, __LINE__); + // Store it in session set_session('mxchange_member_failtures', $data['login_failtures']); set_session('mxchange_member_last_fail', $data['last_failture']); @@ -73,7 +80,6 @@ if (!empty($GLOBALS['userid']) && (isSessionVariableSet('u_hash')) && (isSession // Bonus is not given by default ;-) $bonus = false; if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1") && ($_CONFIG['bonus_login_yn'] == "N") && ($_CONFIG['bonus_login_yn'] == "Y")) { - // Update last login if far enougth away $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET last_login=UNIX_TIMESTAMP() @@ -89,14 +95,14 @@ LIMIT 1", if (($bonus) && ($_GET['mode'] == "bonus") && (EXT_IS_ACTIVE("bonus"))) { // Output message with added points - OUTPUT_HTML(" + OUTPUT_HTML(" ".BONUS_LOGIN_BONUS_ADDED_1." - ".TRANSLATE_COMMA($_CONFIG['login_bonus'])." ".POINTS." + ".TRANSLATE_COMMA($_CONFIG['login_bonus'])." ".POINTS." ".BONUS_LOGIN_BONUS_ADDED_2." -"); +"); } elseif (EXT_IS_ACTIVE("bonus")) { // No login bonus added! - OUTPUT_HTML("".BONUS_LOGIN_BONUS_NOT_ADDED.""); + OUTPUT_HTML("".BONUS_LOGIN_BONUS_NOT_ADDED.""); } // Redirect to member area -- 2.39.5