Login failtures for members now working
authorRoland Häder <roland@mxchange.org>
Wed, 17 Sep 2008 11:35:41 +0000 (11:35 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 17 Sep 2008 11:35:41 +0000 (11:35 +0000)
inc/databases.php
inc/modules/chk_login.php

index 9f32e23..1fd899b 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', "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);
index d8d3698..a96bc1d 100644 (file)
@@ -39,7 +39,7 @@ if (!defined('__SECURITY')) {
 
 // @TODO Replace with own template!
 OPEN_TABLE("500", "guest_login_header dashed", "center");
-OUTPUT_HTML("<br /><STRONG>".VALIDATING_LOGIN."</STRONG><br />");
+OUTPUT_HTML("<br /><strong>".VALIDATING_LOGIN."</strong><br />");
 
 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("<FONT class=\"tiny\">
+               OUTPUT_HTML("<font class=\"tiny\">
   ".BONUS_LOGIN_BONUS_ADDED_1."
-  <STRONG>".TRANSLATE_COMMA($_CONFIG['login_bonus'])." ".POINTS."</STRONG>
+  <strong>".TRANSLATE_COMMA($_CONFIG['login_bonus'])." ".POINTS."</strong>
   ".BONUS_LOGIN_BONUS_ADDED_2."
-</FONT>");
+</font>");
        } elseif (EXT_IS_ACTIVE("bonus")) {
                // No login bonus added!
-               OUTPUT_HTML("<FONT class=\"member_failed\">".BONUS_LOGIN_BONUS_NOT_ADDED."</FONT>");
+               OUTPUT_HTML("<font class=\"member_failed\">".BONUS_LOGIN_BONUS_NOT_ADDED."</font>");
        }
 
        // Redirect to member area