]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
Possible work-around added to prevent fatal error if no admins-functions.php is loaded
[mailer.git] / inc / filters.php
index 74cda8e85b8eea7d71b122241ff1306f477ae650..4c22772bb1de156356b98a1c1b317dfa589ea26d 100644 (file)
@@ -53,11 +53,11 @@ function INIT_FILTER_SYSTEM () {
 
        // Init the filter system (just some ideas)
        $GLOBALS['filters']['chains'] = array(
-               // Filters for pre-init phase
+       // Filters for pre-init phase
                'preinit'   => array(),
-               // Filters for post-init phase
+       // Filters for post-init phase
                'postinit'  => array(),
-               // Filters for shutdown phase
+       // Filters for shutdown phase
                'shutdown'  => array()
        );
 
@@ -100,7 +100,7 @@ ORDER BY `filter_id` ASC", __FUNCTION__, __LINE__);
                                } // END - if
                        } // END - while
                } // END - if
-       
+
                // Free result
                SQL_FREERESULT($result);
        } // END - if
@@ -313,9 +313,9 @@ function FILTER_FLUSH_FILTERS () {
                        foreach ($filterArray as $filterFunction => $cnt) {
                                // Construct and add the query
                                ADD_SQL(sprintf("UPDATE `{!_MYSQL_PREFIX!}_filters` SET `filter_counter`=%s WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT 1",
-                                       bigintval($cnt),
-                                       $filterName,
-                                       $filterFunction
+                               bigintval($cnt),
+                               $filterName,
+                               $filterFunction
                                ));
                        } // END - foreach
                } // END - foreach
@@ -462,7 +462,7 @@ function FILTER_UPDATE_LOGIN_DATA () {
 
        // 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(getUserId()), __FUNCTION__, __LINE__);
+       array(getUserId()), __FUNCTION__, __LINE__);
 
        // Entry found?
        if (SQL_NUMROWS($result) == 1) {
@@ -480,13 +480,13 @@ function FILTER_UPDATE_LOGIN_DATA () {
                // "what" not set?
                if (empty($GLOBALS['what'])) {
                        // Fix it to default
-                       $GLOBALS['what'] = "welcome";
-                       if (getConfig('index_home') != '') $GLOBALS['what'] = getConfig('index_home');
+                       $GLOBALS['what'] = "welcome";
+                       if (getConfig('index_home') != '') $GLOBALS['what'] = getConfig('index_home');
                } // END - if
 
                // Update last module / online time
                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'], detectRemoteAddr(), getUserId()), __FUNCTION__, __LINE__);
+               array($GLOBALS['what'], detectRemoteAddr(), getUserId()), __FUNCTION__, __LINE__);
        }  else {
                // Destroy session, we cannot update!
                destroyUserSession();
@@ -502,7 +502,7 @@ function FILTER_CHECK_ADMIN_ACL () {
        $ret = true;
 
        // Ok, Cookie-Update done
-       if (GET_EXT_VERSION('admins') >= '0.3.0') {
+       if ((GET_EXT_VERSION('admins') >= '0.3.0') && (EXT_IS_ACTIVE('admins'))) {
                // Check if action GET variable was set
                $action = SQL_ESCAPE($GLOBALS['action']);
                if (!empty($GLOBALS['what'])) {
@@ -521,7 +521,7 @@ function FILTER_CHECK_ADMIN_ACL () {
 // Filter for initializing randomizer
 function FILTER_INIT_RANDOMIZER () {
        // Simply init the randomizer with seed and _ADD value
-       mt_srand(generateSeed() + constant('_ADD'));
+       mt_srand(generateSeed() + getConfig('_ADD'));
 }
 
 // Filter for removing updates