Function INIT_FILTER_SYSTEM() is now being executed even when there are no extensions...
[mailer.git] / inc / filters.php
index 0fc19fa5527b4408f9d42d6e94074e5c2b0c11ce..0a30fc752e45697043683f813ceaea382cbfa2a6 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Init "generic filter system"
-function INIT_FILTER_SYSTEM() {
+function INIT_FILTER_SYSTEM () {
        global $filters, $loadedFilters, $counter;
 
        // Is the filter already initialized?
@@ -319,7 +319,7 @@ function FILTER_FLUSH_FILTERS () {
        } // END - if
 
        // Run the run_sqls filter in non-dry mode
-       RUN_FILTER('run_sqls', false);
+       RUN_FILTER('run_sqls', array('dry_run' => false, 'sqls' => $SQLs));
 }
 
 // Filter for calling the handler for login failtures
@@ -419,13 +419,11 @@ function FILTER_LOAD_INCLUDES ($data) {
 }
 
 // Filter for running SQL commands
-function FILTER_RUN_SQLS ($dry_run) {
-       global $SQLs;
-
+function FILTER_RUN_SQLS ($data) {
        // Is the array there?
-       if ((is_array($SQLs)) && (!$dry_run)) {
+       if ((isset($data['sqls'])) && ((!isset($data['dry_run'])) || ($data['dry_run'] == false))) {
                // Run SQL commands
-               foreach ($SQLs as $sql) {
+               foreach ($data['sqls'] as $sql) {
                        $sql = trim($sql);
                        if (!empty($sql)) {
                                // Do we have an "ALTER TABLE" command?
@@ -438,10 +436,7 @@ function FILTER_RUN_SQLS ($dry_run) {
                                }
                        } // END - if
                } // END - foreach
-       } elseif (GET_EXT_VERSION("sql_patches") == "") {
-               // Remove SQLs if extension is not installed
-               $SQLs = array();
-       }
+       } // END - if
 }
 
 // Filter for updating/validating login data
@@ -482,7 +477,7 @@ function FILTER_UPDATE_LOGIN_DATA () {
                        } // 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",
+                       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 {
@@ -497,7 +492,7 @@ function FILTER_CHECK_ADMIN_ACL () {
        $ret = true;
 
        // Ok, Cookie-Update done
-       if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
+       if (GET_EXT_VERSION("admins") >= "0.3") {
                // Check if action GET variable was set
                $action = SQL_ESCAPE($GLOBALS['action']);
                if (!empty($GLOBALS['what'])) {