script does now also regonize the difference between payout in withdraw in wernis...
[mailer.git] / inc / modules / chk_login.php
index c04d711..e64ac5a 100644 (file)
@@ -40,9 +40,9 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 
 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']) && !empty($_COOKIE['u_hash']) && !empty($_COOKIE['lifetime']))
+if (!empty($GLOBALS['userid']) && !empty($_SESSION['u_hash']) && !empty($_SESSION['lifetime']))
 {
        // Get theme from profile
        $result = SQL_QUERY_ESC("SELECT curr_theme FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",
@@ -51,16 +51,16 @@ if (!empty($GLOBALS['userid']) && !empty($_COOKIE['u_hash']) && !empty($_COOKIE[
        SQL_FREERESULT($result);
 
        // Change to new theme
-       @setcookie("mxchange_theme", $NewTheme, (time() + 60*60*24*365), COOKIE_PATH);
-       $_COOKIE['mxchange_theme'] = $NewTheme;
+       set_session("mxchange_theme", $NewTheme, (time() + 60*60*24*365), COOKIE_PATH);
+       $_SESSION['mxchange_theme'] = $NewTheme;
 
        $bonus = false;
-       if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1") && ($CONFIG['bonus_login_yn'] == 'Y')) {
+       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
                $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data
 SET last_login=UNIX_TIMESTAMP()
 WHERE userid=%d AND last_login < (UNIX_TIMESTAMP() - %d)
-LIMIT 1", array($GLOBALS['userid'], $CONFIG['login_timeout']),
+LIMIT 1", array($GLOBALS['userid'], $_CONFIG['login_timeout']),
  __FILE__, __LINE__);
                if (SQL_AFFECTEDROWS($link) == 1) $bonus = true;
        }
@@ -68,7 +68,7 @@ LIMIT 1", array($GLOBALS['userid'], $CONFIG['login_timeout']),
                // Output message with added points
                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>");
        }