X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Fonline_functions.php;h=ae13a3a68d237477eeeeb3ff837904976c106dcf;hp=9b8fcbe9d1fc9a943564d8892faf963d35dbbf69;hb=f3e4c2c048761589836fdbe6bd2e46599a1833a7;hpb=cca98f57dff720b174d21d071cee8303462485d7 diff --git a/inc/libs/online_functions.php b/inc/libs/online_functions.php index 9b8fcbe9d1..ae13a3a68d 100644 --- a/inc/libs/online_functions.php +++ b/inc/libs/online_functions.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Online-Funktionen * * -------------------------------------------------------------------- * - * * + * $Revision:: 856 $ * + * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009) $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: stelzi $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -39,17 +44,13 @@ if (!defined('__SECURITY')) { // Filter for updates/extends on the online list function FILTER_UPDATE_ONLINE_LIST () { - global $PHPSESSID; - // Do not update online list when extension is deactivated if (!EXT_IS_ACTIVE("online", true)) return; // Empty session? - if (empty($PHPSESSID)) { + if (session_id() == "") { // This is invalid here! - print "Invalid session. Backtrace:
";
-		debug_print_backtrace();
-		die("
"); + debug_report_bug("Invalid session."); } // END - if // Initialize variables @@ -73,13 +74,13 @@ function FILTER_UPDATE_ONLINE_LIST () { } // END - if // Now search for the user - $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!MYSQL_PREFIX!}_online` WHERE sid='%s' LIMIT 1", - array($PHPSESSID), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_online` WHERE sid='%s' LIMIT 1", + array(session_id()), __FUNCTION__, __LINE__); // Entry found? if (SQL_NUMROWS($result) == 1) { // Then update it - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_online` SET + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_online` SET module='%s', action='%s', what='%s', @@ -99,12 +100,12 @@ WHERE sid='%s' LIMIT 1", $MEM, $ADMIN, GET_REMOTE_ADDR(), - $PHPSESSID - ), __FILE__, __LINE__ + session_id() + ), __FUNCTION__, __LINE__ ); } else { // No entry does exists so we simply add it! - SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_online` (module, action, what, userid, refid, is_member, is_admin, timestamp, sid, ip) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')", + SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_online` (module, action, what, userid, refid, is_member, is_admin, timestamp, sid, ip) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')", array( $GLOBALS['module'], $GLOBALS['action'], @@ -113,9 +114,9 @@ WHERE sid='%s' LIMIT 1", $rid, $MEM, $ADMIN, - $PHPSESSID, + session_id(), GET_REMOTE_ADDR() - ), __FILE__, __LINE__ + ), __FUNCTION__, __LINE__ ); } @@ -123,8 +124,8 @@ WHERE sid='%s' LIMIT 1", SQL_FREERESULT($result); // Purge old entries - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!MYSQL_PREFIX!}_online` WHERE timestamp <= (UNIX_TIMESTAMP() - %s)", - array(getConfig('online_timeout')), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_online` WHERE timestamp <= (UNIX_TIMESTAMP() - %s)", + array(getConfig('online_timeout')), __FUNCTION__, __LINE__); } //