]> git.mxchange.org Git - mailer.git/blobdiff - 0.2.1/inc/modules/chk_login.php
win32 to unix line delimiters changed
[mailer.git] / 0.2.1 / inc / modules / chk_login.php
index a30f3575751796eb71ec9692137bfbc8786be987..9b4e6b831363af4c9dc02302b3679e8bb8780028 100644 (file)
@@ -1,95 +1,95 @@
-<?php\r
-/************************************************************************\r
- * MXChange v0.2.1                                    Start: 11/26/2003 *\r
- * ===============                              Last change: 02/27/2004 *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * File              : chk_login.php                                    *\r
- * -------------------------------------------------------------------- *\r
- * Short description : Check if user has logged in (delay)              *\r
- * -------------------------------------------------------------------- *\r
- * Kurzbeschreibung  : Pruefen ob die Login-Cookies gesetzt sind        *\r
- * -------------------------------------------------------------------- *\r
- *                                                                      *\r
- * -------------------------------------------------------------------- *\r
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *\r
- * For more information visit: http://www.mxchange.org                  *\r
- *                                                                      *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or    *\r
- * (at your option) any later version.                                  *\r
- *                                                                      *\r
- * This program is distributed in the hope that it will be useful,      *\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
- * GNU General Public License for more details.                         *\r
- *                                                                      *\r
- * You should have received a copy of the GNU General Public License    *\r
- * along with this program; if not, write to the Free Software          *\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
- * MA  02110-1301  USA                                                  *\r
- ************************************************************************/\r
-\r
-// Some security stuff...\r
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))\r
-{\r
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";\r
-       require($INC);\r
-}\r
-\r
-OPEN_TABLE("500", "guest_login_header dashed", "center");\r
-\r
-OUTPUT_HTML ("<BR><STRONG>".VALIDATING_LOGIN."</STRONG><BR>");\r
-\r
-if (!empty($GLOBALS['userid']) && !empty($_COOKIE['u_hash']) && !empty($_COOKIE['lifetime']))\r
-{\r
-       // Get theme from profile\r
-       $result = SQL_QUERY_ESC("SELECT curr_theme FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",\r
-        array($GLOBALS['userid']), __FILE__, __LINE__);\r
-       list($NewTheme) = SQL_FETCHROW($result);\r
-       SQL_FREERESULT($result);\r
-\r
-       // Change to new theme\r
-       @setcookie("mxchange_theme", $NewTheme, (time() + 60*60*24*365), COOKIE_PATH);\r
-       $_COOKIE['mxchange_theme'] = $NewTheme;\r
-\r
-       $bonus = false;\r
-       if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1"))\r
-       {\r
-               // Update last login\r
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data\r
-SET last_login=UNIX_TIMESTAMP()\r
-WHERE userid=%d AND last_login < (UNIX_TIMESTAMP() - %d)\r
-LIMIT 1", array($GLOBALS['userid'], $CONFIG['login_timeout']),\r
- __FILE__, __LINE__);\r
-               if (SQL_AFFECTEDROWS($link) == 1) $bonus = true;\r
-       }\r
-       if (($bonus) && ($_GET['mode'] == "bonus") && (EXT_IS_ACTIVE("bonus")))         {\r
-               // Output message with added points\r
-               OUTPUT_HTML("<FONT class=\"tiny\">\r
-  ".BONUS_LOGIN_BONUS_ADDED_1."\r
-  <STRONG>".TRANSLATE_COMMA($CONFIG['login_bonus'])." ".POINTS."</STRONG>\r
-  ".BONUS_LOGIN_BONUS_ADDED_2."\r
-</FONT>");\r
-       }\r
-        elseif (EXT_IS_ACTIVE("bonus"))\r
-       {\r
-               // No login bonus added!\r
-               OUTPUT_HTML("<FONT class=\"member_failed\">".BONUS_LOGIN_BONUS_NOT_ADDED."</FONT>");\r
-       }\r
-\r
-       // Redirect to member area\r
-       LOAD_TEMPLATE("member_login_js");\r
-}\r
- else\r
-{\r
-       // Login failed!\r
-       LOAD_TEMPLATE("login_failed_js");\r
-}\r
-\r
-// Close table\r
-CLOSE_TABLE();\r
-\r
-//\r
-?>\r
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 11/26/2003 *
+ * ===============                              Last change: 02/27/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : chk_login.php                                    *
+ * -------------------------------------------------------------------- *
+ * Short description : Check if user has logged in (delay)              *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Pruefen ob die Login-Cookies gesetzt sind        *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
+{
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+OPEN_TABLE("500", "guest_login_header dashed", "center");
+
+OUTPUT_HTML ("<BR><STRONG>".VALIDATING_LOGIN."</STRONG><BR>");
+
+if (!empty($GLOBALS['userid']) && !empty($_COOKIE['u_hash']) && !empty($_COOKIE['lifetime']))
+{
+       // Get theme from profile
+       $result = SQL_QUERY_ESC("SELECT curr_theme FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1",
+        array($GLOBALS['userid']), __FILE__, __LINE__);
+       list($NewTheme) = SQL_FETCHROW($result);
+       SQL_FREERESULT($result);
+
+       // Change to new theme
+       @setcookie("mxchange_theme", $NewTheme, (time() + 60*60*24*365), COOKIE_PATH);
+       $_COOKIE['mxchange_theme'] = $NewTheme;
+
+       $bonus = false;
+       if ((GET_EXT_VERSION("sql_patches") >= "0.2.8") && (GET_EXT_VERSION("bonus") >= "0.2.1"))
+       {
+               // 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']),
+ __FILE__, __LINE__);
+               if (SQL_AFFECTEDROWS($link) == 1) $bonus = true;
+       }
+       if (($bonus) && ($_GET['mode'] == "bonus") && (EXT_IS_ACTIVE("bonus")))         {
+               // Output message with added points
+               OUTPUT_HTML("<FONT class=\"tiny\">
+  ".BONUS_LOGIN_BONUS_ADDED_1."
+  <STRONG>".TRANSLATE_COMMA($CONFIG['login_bonus'])." ".POINTS."</STRONG>
+  ".BONUS_LOGIN_BONUS_ADDED_2."
+</FONT>");
+       }
+        elseif (EXT_IS_ACTIVE("bonus"))
+       {
+               // No login bonus added!
+               OUTPUT_HTML("<FONT class=\"member_failed\">".BONUS_LOGIN_BONUS_NOT_ADDED."</FONT>");
+       }
+
+       // Redirect to member area
+       LOAD_TEMPLATE("member_login_js");
+}
+ else
+{
+       // Login failed!
+       LOAD_TEMPLATE("login_failed_js");
+}
+
+// Close table
+CLOSE_TABLE();
+
+//
+?>