Fixed logfile writing in installation phase, .revision is now ignored
[mailer.git] / inc / libs / online_functions.php
index 9b8fcbe9d1fc9a943564d8892faf963d35dbbf69..ae13a3a68d237477eeeeb3ff837904976c106dcf 100644 (file)
  * -------------------------------------------------------------------- *
  * 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:<pre>";
-               debug_print_backtrace();
-               die("</pre>");
+               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__);
 }
 
 //