Major fixes in filters/extensions, other improvements:
authorRoland Häder <roland@mxchange.org>
Thu, 18 Dec 2008 16:45:30 +0000 (16:45 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 18 Dec 2008 16:45:30 +0000 (16:45 +0000)
- Major bug in filter removal fixed (was rewritten to use own filter 'run_sqls')
- Removed guest menu from SQL files and added to ext-online.php
- Filters added to same extension
- UPDATE_LOGIN_DATA() rewritten as filter
- Some documents updated
- Admin footer template now with closing "li" tags and title attribute for guest
  area link

15 files changed:
.gitattributes
DOCS/de/EXTENSIONS.txt
DOCS/de/README.txt
DOCS/en/EXTENSIONS.txt
inc/databases.php
inc/extensions.php
inc/extensions/ext-online.php
inc/filters.php
inc/libs/online_functions.php [new file with mode: 0644]
inc/modules/admin/what-extensions.php
inc/mysql-connect.php
inc/mysql-manager.php
install/menu-de.sql
install/menu-en.sql
templates/de/html/admin/admin_footer.tpl

index c7bc9ac2234d3fae5f5702531e477a08cde10218..7e9f6da89c4843ff644318f3cb67c105c2386fdb 100644 (file)
@@ -225,6 +225,7 @@ inc/libs/html_mail_functions.php -text
 inc/libs/mediadata_functions.php -text
 inc/libs/newsletter_functions.php -text
 inc/libs/nickname_functions.php -text
 inc/libs/mediadata_functions.php -text
 inc/libs/newsletter_functions.php -text
 inc/libs/nickname_functions.php -text
+inc/libs/online_functions.php -text
 inc/libs/optimize_functions.php -text
 inc/libs/order_functions.php -text
 inc/libs/payout_functions.php -text
 inc/libs/optimize_functions.php -text
 inc/libs/order_functions.php -text
 inc/libs/payout_functions.php -text
index a1bb30843eff257b2ef357e976bed335ae780324..ca38d1327ccb8382f32178bd65e9e9269b8f4274 100644 (file)
@@ -96,8 +96,8 @@ dann koennen Sie am wenigsten falsch machen.
 
 Viel Erfolg!!!
 
 
 Viel Erfolg!!!
 
-Und wenn Sie nicht weiterkommen, melden Sie sich bitte im Forum!
+Und wenn Sie nicht weiterkommen, melden Sie sich bitte im Forum oder im Bug-Tracker!
 
 
-http://forum.mxchange.org
+http://forum.mxchange.org - http://bugs.mxchange.org
 
 [EOF]
 
 [EOF]
index da1fef173986a1b1b8b764547246cef77354cc1b..ccef51a39d1cc3b52c041002bd9d9b030add50f7 100644 (file)
@@ -146,6 +146,10 @@ immer mein Forum, welches Sie hier finden koennen:
 
 http://forum.mxchange.org
 
 
 http://forum.mxchange.org
 
+Auch sollten Sie meinen Bug-Tracker aufsuchen und dort Fehlermeldungen posten:
+
+http://bugs.mxchange.org
+
 Alle wichtigen Kontaktdaten finden Sie im Impressum:
 
 http://www.mxchange.org oder
 Alle wichtigen Kontaktdaten finden Sie im Impressum:
 
 http://www.mxchange.org oder
index 6b71863812a471176074e4f4ea376fe7db59a81a..63a933e7909bd5810df4afea733f333a7134cfde 100644 (file)
@@ -1,18 +1,5 @@
-Info-Datei zum Einspielen von Erweiterungen
-===========================================
+Not yet translated! :(
 
 
-Im Grunde genommen koennen Sie beim Updaten von Erweiterungen so vorgehen,
-wie Sie es vom Upgraden des gesamten Script her kennen:
-
-- Eigen geaenderte Templates/CSS-Dateien sichern
-- Alles (bis auf DOCS-Verzeichnis) hochladen
-- Gesicherte Dateien wieder hochladen.
-- In Adminbereich einloggen und nach Update-Aufgaben gucken
-
-Viel Erfolg!!!
-
-Und wenn Sie nicht weiterkommen, melden Sie sich bitte im Forum:
-
-http://forum.mxchange.org
+http://forum.mxchange.org - http://bugs.mxchange.org
 
 [EOF]
 
 [EOF]
index 0f418377e281de0741cbb3b4a044d9ea88cc74f8..3968665986c56116288f1a5719e22b991e114062 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
 define('SERVER_URL', "http://www.mxchange.org");
 
 // Current SVN revision
-define('CURR_SVN_REVISION', "651");
+define('CURR_SVN_REVISION', "652");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index df5e51e9e67c0fbb6985b3e3ae59f0f86ebd32bc..5686e7c0edd0e11a50de5e688da0f7e98d6543d8 100644 (file)
@@ -126,7 +126,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
 // Registeres an extension and possible update depencies
 function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = true) {
        global $UPDATE_NOTES, $_CONFIG, $INC_POOL, $cacheInstance;
 // Registeres an extension and possible update depencies
 function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = true) {
        global $UPDATE_NOTES, $_CONFIG, $INC_POOL, $cacheInstance;
-       global $EXT_VER_HISTORY, $SQLs, $NOTES, $EXT_ALWAYS_ACTIVE, $EXT_VERSION;
+       global $EXT_VER_HISTORY, $NOTES, $EXT_ALWAYS_ACTIVE, $EXT_VERSION;
        global $EXT_UPDATE_DEPENDS;
 
        // This shall never do a non-admin user!
        global $EXT_UPDATE_DEPENDS;
 
        // This shall never do a non-admin user!
@@ -299,31 +299,12 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
 
        // Load extension in detected mode
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ":ext_name[{$ext_id}]={$ext_name}");
 
        // Load extension in detected mode
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ":ext_name[{$ext_id}]={$ext_name}");
-       LOAD_EXTENSION($ext_name, $load_mode, false, $SQLs);
+       LOAD_EXTENSION($ext_name, $load_mode, "", false, $SQLs);
 
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ":SQLs::count=".count($SQLs)."");
        if ((is_array($SQLs) && (sizeof($SQLs) > 0))) {
                // Run SQL commands...
 
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ":SQLs::count=".count($SQLs)."");
        if ((is_array($SQLs) && (sizeof($SQLs) > 0))) {
                // Run SQL commands...
-               foreach ($SQLs as $sql) {
-                       // Trim spaces away which we don't need
-                       $sql = trim($sql);
-
-                       // Is there still an SQL query?
-                       if (!empty($sql)) {
-                               // Do we have an "ALTER TABLE" command?
-                               //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ":SQL={$SQL}");
-                               if (substr(strtolower($sql), 0, 11) == "alter table") {
-                                       // Analyse the alteration command
-                                       SQL_ALTER_TABLE($sql, __FILE__, __LINE__);
-                               } else {
-                                       // Run regular SQL command
-                                       $result = SQL_QUERY($sql, __FILE__, __LINE__, false);
-                               }
-
-                               // An SQL has been executed
-                               $sqlRan = true;
-                       } // END - if
-               } // END - foreach
+               RUN_FILTER('run_sqls');
 
                // Removal mode?
                if ($load_mode == "remove") {
 
                // Removal mode?
                if ($load_mode == "remove") {
@@ -440,7 +421,7 @@ function GET_EXT_VERSION ($ext_name) {
 function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
        // This shall never do a non-admin user!
        global $cacheInstance, $_CONFIG, $UPDATE_NOTES, $NOTES, $EXT_VER_HISTORY;
 function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
        // This shall never do a non-admin user!
        global $cacheInstance, $_CONFIG, $UPDATE_NOTES, $NOTES, $EXT_VER_HISTORY;
-       global $EXT_UPDATE_DEPENDS, $EXT_VERSION, $INC_POOL, $SQLs, $cacheArray;
+       global $EXT_UPDATE_DEPENDS, $EXT_VERSION, $INC_POOL, $cacheArray;
 
        // Init arrays
        $SQLs = array(); $INC_POOL = array();
 
        // Init arrays
        $SQLs = array(); $INC_POOL = array();
index 37eedd0c148e20bfb4bf7d038aa669682e864929..fc8076054021d8786e641777287e922629fc73ad 100644 (file)
@@ -38,13 +38,13 @@ if (!defined('__SECURITY')) {
 }
 
 // Version number
 }
 
 // Version number
-$EXT_VERSION = "0.0.4";
+$EXT_VERSION = "0.0.5";
 
 // Auto-set extension version
 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
 
 // Auto-set extension version
 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4");
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5");
 
 switch ($EXT_LOAD_MODE)
 {
 
 switch ($EXT_LOAD_MODE)
 {
@@ -74,6 +74,10 @@ case "remove": // Do stuff when removing extension
        // SQL commands to run
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_online";
        $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='usr_online' LIMIT 1";
        // SQL commands to run
        $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_online";
        $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='usr_online' LIMIT 1";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_guest_menu` WHERE action='online' LIMIT 1";
+
+       // Unregister filter
+       UNREGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', true, !$dry_run);
        break;
 
 case "activate": // Do stuff when admin activates this extension
        break;
 
 case "activate": // Do stuff when admin activates this extension
@@ -108,6 +112,16 @@ case "update": // Update an extension
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Erstellung der Datenbanktabelle "._MYSQL_PREFIX."_online in diese Erweiterung ausgelagert.";
                break;
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Erstellung der Datenbanktabelle "._MYSQL_PREFIX."_online in diese Erweiterung ausgelagert.";
                break;
+
+       case "0.0.5": // SQL queries for v0.0.5
+               $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('online',NULL,'Jetzt Online','2','Y','N')";
+
+               // Register filter
+               REGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', false, true, !$dry_run);
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Hinzuf&uuml;gen des Men&uuml;punktes &quot;Jetzt Online&quot; wird nun von dieser Erweiterung erledigt. Filter hinzugef&uuml;gt.";
+               break;
        }
        break;
 
        }
        break;
 
index c0b3702d2eb191ac615e61dbe32cfccedb6f7f63..79f0ef4c6e31ae4925f166962a41b993abbce9df 100644 (file)
@@ -102,6 +102,9 @@ ORDER BY `filter_id` ASC", __FILE__, __LINE__);
                SQL_FREERESULT($result);
        } // END - if
 
                SQL_FREERESULT($result);
        } // END - if
 
+       // Init filters
+       REGISTER_FILTER('init', 'UPDATE_LOGIN_DATA');
+
        // Login failtures handler
        REGISTER_FILTER('post_youhere_line', 'CALL_HANDLER_LOGIN_FAILTURES');
 
        // Login failtures handler
        REGISTER_FILTER('post_youhere_line', 'CALL_HANDLER_LOGIN_FAILTURES');
 
@@ -161,10 +164,12 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo
 
 // "Unregisters" a filter from the given chain
 function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $remove = true) {
 
 // "Unregisters" a filter from the given chain
 function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $remove = true) {
-       global $filters, $counter;
+       global $filters, $counter, $loadedFilters;
 
 
-       // Extend the filter function name
-       $filterFunction = sprintf("FILTER_%s", strtoupper($filterFunction));
+       // Extend the filter function name only if not loaded from database
+       if (!isset($loadedFilters[$filterName][$filterFunction])) {
+               $filterFunction = sprintf("FILTER_%s", strtoupper($filterFunction));
+       } // END - if
 
        // Is that filter there?
        if ((!isset($filters[$filterName][$filterFunction])) && (!$force)) {
 
        // Is that filter there?
        if ((!isset($filters[$filterName][$filterFunction])) && (!$force)) {
@@ -291,7 +296,7 @@ function FILTER_FLUSH_FILTERS () {
                $removeSQL = substr($removeSQL, 0, -2) . "LIMIT ".$removed;
 
                // And run it
                $removeSQL = substr($removeSQL, 0, -2) . "LIMIT ".$removed;
 
                // And run it
-               $removeSQL;
+               $SQLs[] = $removeSQL;
        } // END - if
 
        // Shall we update usage counters (ONLY FOR DEBUGGING!)
        } // END - if
 
        // Shall we update usage counters (ONLY FOR DEBUGGING!)
@@ -430,5 +435,52 @@ function FILTER_RUN_SQLS ($dry_run) {
        }
 }
 
        }
 }
 
+// Filter for updating/validating login data
+function FILTER_UPDATE_LOGIN_DATA () {
+       global $LAST;
+       if (!is_array($LAST)) $LAST = array();
+
+       // Recheck if logged in
+       if (!IS_MEMBER()) return false;
+
+       // Secure user ID
+       $GLOBALS['userid'] = bigintval(get_session('userid'));
+
+       // Extract last online time (life) and how long is auto-login valid (time)
+       $newl = time() + bigintval(get_session('lifetime'));
+
+       // Load last module and last online time
+       $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+       if (SQL_NUMROWS($result) == 1) {
+               // Load last module and online time
+               list($mod, $onl) = SQL_FETCHROW($result);
+               SQL_FREERESULT($result);
+
+               // Maybe first login time?
+               if (empty($mod)) $mod = "login";
+
+               if (set_session("userid", $GLOBALS['userid'], $newl, COOKIE_PATH) && set_session("u_hash", get_session('u_hash'), $newl, COOKIE_PATH) && set_session("lifetime", bigintval(get_session('lifetime')), $newl, COOKIE_PATH)) {
+                       // This will be displayed on welcome page! :-)
+                       if (empty($LAST['module'])) {
+                               $LAST['module'] = $mod; $LAST['online'] = $onl;
+                       } // END - if
+
+                       // "what" not set?
+                       if (empty($GLOBALS['what'])) {
+                               // Fix it to default
+                               $GLOBALS['what'] = "welcome";
+                               if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home');
+                       } // END - if
+
+                       // Update last module / online time
+                       $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1",
+                        array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
+               }
+       }  else {
+               // Destroy session, we cannot update!
+               destroy_user_session();
+       }
+}
+
 //
 ?>
 //
 ?>
diff --git a/inc/libs/online_functions.php b/inc/libs/online_functions.php
new file mode 100644 (file)
index 0000000..02c0b41
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 12/18/2008 *
+ * ================                             Last change: 12/18/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : online_functions.php                             *
+ * -------------------------------------------------------------------- *
+ * Short description : Online functions                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Online-Funktionen                                *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * 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 (!defined('__SECURITY')) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// 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)) {
+               // This is invalid here!
+               print "Invalid session. Backtrace:<pre>";
+               debug_print_backtrace();
+               die("</pre>");
+       } // END - if
+
+       // Initialize variables
+       $uid = 0; $rid = 0; $MEM = "N"; $ADMIN = "N";
+
+       // Valid userid?
+       if ((!empty($GLOBALS['userid'])) && ($GLOBALS['userid'] > 0) && (IS_MEMBER())) {
+               // Is valid user
+               $uid = bigintval($GLOBALS['userid']);
+               $MEM = "Y";
+       } // END - if
+
+       if (IS_ADMIN()) {
+               // Is administrator
+               $ADMIN = "Y";
+       } // END - if
+
+       if (!empty($GLOBALS['refid'])) {
+               // Read cookie
+               $rid = bigintval($GLOBALS['refid']);
+       } // 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__);
+
+       // Entry found?
+       if (SQL_NUMROWS($result) == 1) {
+               // Then update it
+               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_online SET
+module='%s',
+action='%s',
+what='%s',
+userid=%s,
+refid=%s,
+is_member='%s',
+is_admin='%s',
+timestamp=UNIX_TIMESTAMP(),
+ip='%s'
+WHERE sid='%s' LIMIT 1",
+                       array(
+                               $GLOBALS['module'],
+                               $GLOBALS['action'],
+                               $GLOBALS['what'],
+                               $uid,
+                               $rid,
+                               $MEM,
+                               $ADMIN,
+                               GET_REMOTE_ADDR(),
+                               $PHPSESSID
+                       ), __FILE__, __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')",
+                       array(
+                               $GLOBALS['module'],
+                               $GLOBALS['action'],
+                               $GLOBALS['what'],
+                               $uid,
+                               $rid,
+                               $MEM,
+                               $ADMIN,
+                               $PHPSESSID,
+                               GET_REMOTE_ADDR()
+                       ), __FILE__, __LINE__
+               );
+       }
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Purge old entries
+       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_online WHERE timestamp <= (UNIX_TIMESTAMP() - %s)",
+               array(getConfig('online_timeout')), __FILE__, __LINE__);
+}
+
+//
+?>
index d1d373d2ba2bd2f74dc6205f08d84890c602f717..2446b3df907cb7b5ea8abc47328b7a5616edb24a 100644 (file)
@@ -165,9 +165,9 @@ if (!empty($_GET['reg_ext'])) {
 
                if (getConfig('verbose_sql') == "Y") {
                        // Load SQL commands in remove mode
 
                if (getConfig('verbose_sql') == "Y") {
                        // Load SQL commands in remove mode
-                       if (LOAD_EXTENSION($ext_name, "remove", "", true)) {
+                       if (LOAD_EXTENSION($ext_name, "remove", "", true, $SQLs)) {
                                // Generate extra table with loaded SQL commands
                                // Generate extra table with loaded SQL commands
-                               $VERBOSE_OUT = EXTENSION_VERBOSE_TABLE();
+                               $VERBOSE_OUT = EXTENSION_VERBOSE_TABLE($SQLs);
                        } // END - if
                } // END - if
 
                        } // END - if
                } // END - if
 
index fc86b7eb4ab39bdc5602d53be77962b0508f9596..3d00c3ca4643ee255b9ae45674e5d8a745c6d136 100644 (file)
@@ -173,6 +173,9 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                // Session management
                                require_once(PATH."inc/session.php");
 
                                // Session management
                                require_once(PATH."inc/session.php");
 
+                               // Init filter system
+                               INIT_FILTER_SYSTEM();
+
                                // Run daily reset
                                require_once(PATH."inc/check-reset.php");
 
                                // Run daily reset
                                require_once(PATH."inc/check-reset.php");
 
@@ -195,11 +198,8 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                        $GLOBALS['what']   = "";
                                }
 
                                        $GLOBALS['what']   = "";
                                }
 
-                               // Secure and validate user ID from cookie
-                               UPDATE_LOGIN_DATA();
-
-                               // Update online list
-                               UPDATE_ONLINE_LIST($PHPSESSID, $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']);
+                               // Run the init filter chain
+                               RUN_FILTER('init');
 
                                // Set default 'what' value
                                //* DEBUG: */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
 
                                // Set default 'what' value
                                //* DEBUG: */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />\n";
@@ -303,9 +303,6 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
        } // END - if
 }
 
        } // END - if
 }
 
-// Init filter system
-INIT_FILTER_SYSTEM();
-
 // Any fatal messages?
 if (!is_array($FATAL)) $FATAL = array();
 if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1")) {
 // Any fatal messages?
 if (!is_array($FATAL)) $FATAL = array();
 if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1")) {
index ec8d7ce688784133eef930093d2069c7b3ff6714..45f3a8ec42fbef38bd554009f49d106693d4bfc7 100644 (file)
@@ -656,52 +656,6 @@ function IS_MEMBER()
        return $ret;
 }
 //
        return $ret;
 }
 //
-function UPDATE_LOGIN_DATA () {
-       global $LAST, $_CONFIG;
-       if (!is_array($LAST)) $LAST = array();
-
-       // Recheck if logged in
-       if (!IS_MEMBER()) return false;
-
-       // Secure user ID
-       $GLOBALS['userid'] = bigintval(get_session('userid'));
-
-       // Extract last online time (life) and how long is auto-login valid (time)
-       $newl = time() + bigintval(get_session('lifetime'));
-
-       // Load last module and last online time
-       $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 1) {
-               // Load last module and online time
-               list($mod, $onl) = SQL_FETCHROW($result);
-               SQL_FREERESULT($result);
-
-               // Maybe first login time?
-               if (empty($mod)) $mod = "login";
-
-               if (set_session("userid", $GLOBALS['userid'], $newl, COOKIE_PATH) && set_session("u_hash", get_session('u_hash'), $newl, COOKIE_PATH) && set_session("lifetime", bigintval(get_session('lifetime')), $newl, COOKIE_PATH)) {
-                       // This will be displayed on welcome page! :-)
-                       if (empty($LAST['module'])) {
-                               $LAST['module'] = $mod; $LAST['online'] = $onl;
-                       } // END - if
-
-                       // "what" not set?
-                       if (empty($GLOBALS['what'])) {
-                               // Fix it to default
-                               $GLOBALS['what'] = "welcome";
-                               if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home');
-                       } // END - if
-
-                       // Update last module / online time
-                       $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET last_module='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1",
-                        array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
-               }
-       }  else {
-               // Destroy session, we cannot update!
-               destroy_user_session();
-       }
-}
-//
 function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false)
 {
        $ret = false;
 function VALIDATE_MENU_ACTION ($MODE, $act, $wht, $UPDATE=false)
 {
        $ret = false;
@@ -1329,75 +1283,7 @@ function UPDATE_REF_COUNTER ($uid) {
                UPDATE_REFBACK_TABLE($uid);
        } // END - if
 }
                UPDATE_REFBACK_TABLE($uid);
        } // END - if
 }
-// Updates/extends the online list
-function UPDATE_ONLINE_LIST($SID, $mod, $act, $wht) {
-       global $_CONFIG;
 
 
-       // Do not update online list when extension is deactivated
-       if (!EXT_IS_ACTIVE("online", true)) return;
-
-       // Empty session?
-       if (empty($SID)) {
-               // This is invalid here!
-               print "Invalid session. Backtrace:<pre>";
-               debug_print_backtrace();
-               die("</pre>");
-       } // END - if
-
-       // Initialize variables
-       $uid = 0; $rid = 0; $MEM = "N"; $ADMIN = "N";
-
-       // Valid userid?
-       if ((!empty($GLOBALS['userid'])) && ($GLOBALS['userid'] > 0) && (IS_MEMBER())) {
-               // Is valid user
-               $uid = bigintval($GLOBALS['userid']);
-               $MEM = "Y";
-       } // END - if
-
-       if (IS_ADMIN()) {
-               // Is administrator
-               $ADMIN = "Y";
-       } // END - if
-
-       if (isSessionVariableSet('refid')) {
-               // Check cookie
-               if (get_session('refid') > 0) $rid = bigintval($GLOBALS['refid']);
-       } // END - if
-
-       // Now search for the user
-       $result = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_online
-WHERE sid='%s' LIMIT 1",
- array($SID), __FILE__, __LINE__);
-
-       // Entry found?
-       if (SQL_NUMROWS($result) == 1) {
-               // Then update it
-               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_online SET
-module='%s',
-action='%s',
-what='%s',
-userid=%s,
-refid=%s,
-is_member='%s',
-is_admin='%s',
-timestamp=UNIX_TIMESTAMP()
-WHERE sid='%s' LIMIT 1",
-                       array($mod, $act, $wht, $uid, $rid, $MEM, $ADMIN, $SID), __FILE__, __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')",
-                       array($mod, $act, $wht, $uid, $rid, $MEM, $ADMIN, $SID, GET_REMOTE_ADDR()), __FILE__, __LINE__
-               );
-       }
-
-       // Free result
-       SQL_FREERESULT($result);
-
-       // Purge old entries
-       $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_online WHERE timestamp <= (UNIX_TIMESTAMP() - %s)",
-        array(getConfig('online_timeout')), __FILE__, __LINE__);
-}
 // OBSOLETE: Sends out mail to all administrators
 function SEND_ADMIN_EMAILS ($subj, $msg) {
        // Load all admin email addresses
 // OBSOLETE: Sends out mail to all administrators
 function SEND_ADMIN_EMAILS ($subj, $msg) {
        // Load all admin email addresses
@@ -1412,6 +1298,7 @@ function SEND_ADMIN_EMAILS ($subj, $msg) {
 
        // Really simple... ;-)
 }
 
        // Really simple... ;-)
 }
+
 // Get ID number from administrator's login name
 function GET_ADMIN_ID ($login) {
        global $cacheArray, $_CONFIG;
 // Get ID number from administrator's login name
 function GET_ADMIN_ID ($login) {
        global $cacheArray, $_CONFIG;
index 840c381fe02d21ec8d3b383aa2ef10a8ee95b40f..d3046bb56c1e7a27577588634cd9e491c511c0a3 100644 (file)
@@ -110,6 +110,5 @@ INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUE
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','extensions','Erweiterungen','Erweiterungen installieren, updaten, sperren, l&ouml;schen usw.','8');\r
 \r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','stats','Statistiken','7','Y','N');\r
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','extensions','Erweiterungen','Erweiterungen installieren, updaten, sperren, l&ouml;schen usw.','8');\r
 \r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','stats','Statistiken','7','Y','N');\r
-INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('online',NULL,'Jetzt Online','2','Y','N');\r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('admin',NULL,'Administrative Links','3','N','N');\r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('admin','admin','Zum Admin-Bereich','4','N','N');\r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('admin',NULL,'Administrative Links','3','N','N');\r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('admin','admin','Zum Admin-Bereich','4','N','N');\r
index 840c381fe02d21ec8d3b383aa2ef10a8ee95b40f..d3046bb56c1e7a27577588634cd9e491c511c0a3 100644 (file)
@@ -110,6 +110,5 @@ INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUE
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','extensions','Erweiterungen','Erweiterungen installieren, updaten, sperren, l&ouml;schen usw.','8');\r
 \r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','stats','Statistiken','7','Y','N');\r
 INSERT INTO `mxchange_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','extensions','Erweiterungen','Erweiterungen installieren, updaten, sperren, l&ouml;schen usw.','8');\r
 \r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','stats','Statistiken','7','Y','N');\r
-INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('online',NULL,'Jetzt Online','2','Y','N');\r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('admin',NULL,'Administrative Links','3','N','N');\r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('admin','admin','Zum Admin-Bereich','4','N','N');\r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('admin',NULL,'Administrative Links','3','N','N');\r
 INSERT INTO `mxchange_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('admin','admin','Zum Admin-Bereich','4','N','N');\r
index 6c67149e455dfcb37254101e2dc5c047aa3f25c8..abe32fa3a1e6612198e19469fadcc1dc667caff7 100644 (file)
@@ -1,9 +1,9 @@
 <div align="center">
        <div class="admin_table dashed" style="width:400px;margin-bottom:5px">
        <ul style="padding:0px;margin:0px">
 <div align="center">
        <div class="admin_table dashed" style="width:400px;margin-bottom:5px">
        <ul style="padding:0px;margin:0px">
-               <li class="menu_blur bottom2"><a href="{!URL!}/modules.php?module=index">{--ADMIN_BACK_TO_GUEST_MENU--}</a>
-               <li class="menu_blur bottom2"><a href="http://forum.mxchange.org" target="_blank" title="{--ADMIN_SUPPORT_FORUM_LINK--}">{--ADMIN_SUPPORT_FORUM_LINK--}</a>
-               <li class="menu_blur"><a href="http://bugs.mxchange.org" target="_blank" title="{--ADMIN_SUPPORT_BUGTRACKER_LINK--}">{--ADMIN_SUPPORT_BUGTRACKER_LINK--}</a>
+               <li class="menu_blur bottom2"><a href="{!URL!}/modules.php?module=index" title="{--ADMIN_BACK_TO_GUEST_MENU--}">{--ADMIN_BACK_TO_GUEST_MENU--}</a></li>
+               <li class="menu_blur bottom2"><a href="http://forum.mxchange.org" target="_blank" title="{--ADMIN_SUPPORT_FORUM_LINK--}">{--ADMIN_SUPPORT_FORUM_LINK--}</a></li>
+               <li class="menu_blur"><a href="http://bugs.mxchange.org" target="_blank" title="{--ADMIN_SUPPORT_BUGTRACKER_LINK--}">{--ADMIN_SUPPORT_BUGTRACKER_LINK--}</a></li>
        </ul>
        </div>
 </div>
        </ul>
        </div>
 </div>