]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
Fixes for filter 'load_includes'
[mailer.git] / inc / filters.php
index fe843fb8f0a74f9ad1c1835985e69490ba1bea1d..82f9dcb27ac6fd26cf9ab596e6a2160eb4e1417c 100644 (file)
@@ -125,6 +125,9 @@ ORDER BY `filter_id` ASC", __FILE__, __LINE__);
        // Run SQLs
        REGISTER_FILTER('run_sqls', 'RUN_SQLS');
 
+       // Admin ACL check
+       REGISTER_FILTER('check_admin_acl', 'CHECK_ADMIN_ACL');
+
        // Register shutdown filters
        REGISTER_FILTER('shutdown', 'FLUSH_FILTERS');
 }
@@ -384,14 +387,14 @@ function FILTER_SOLVE_TASK ($data) {
 }
 
 // Filter to load include files
-function FILTER_LOAD_INCLUDES ($data) {
-       global $INC_POOL;
+function FILTER_LOAD_INCLUDES ($INC_POOL) {
+       global $CSS;
 
        // Is it an array?
        if ((!isset($INC_POOL)) || (!is_array($INC_POOL))) {
                // Then abort here
                DEBUG_LOG(__FILE__, __LINE__, "INC_POOL is no array!");
-               return $data;
+               return;
        } // END - if
 
        // Check for added include files
@@ -401,12 +404,9 @@ function FILTER_LOAD_INCLUDES ($data) {
                        require_once($fqfn);
                } // END - foreach
 
-               // Remove array
-               unset($INC_POOL);
+               // Reset array
+               $INC_POOL = array();
        } // END - if
-
-       // Return $data
-       return $data;
 }
 
 // Filter for running SQL commands
@@ -474,7 +474,7 @@ function FILTER_UPDATE_LOGIN_DATA () {
 
                        // 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__);
+                               array($GLOBALS['what'], GET_REMOTE_ADDR(), $GLOBALS['userid']), __FILE__, __LINE__);
                }
        }  else {
                // Destroy session, we cannot update!
@@ -482,5 +482,27 @@ function FILTER_UPDATE_LOGIN_DATA () {
        }
 }
 
+// Filter for checking admin ACL
+function FILTER_CHECK_ADMIN_ACL () {
+       // Extension not installed so it's always allowed to access everywhere!
+       $ret = true;
+
+       // Ok, Cookie-Update done
+       if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
+               // Check if action GET variable was set
+               $action = SQL_ESCAPE($GLOBALS['action']);
+               if (!empty($GLOBALS['what'])) {
+                       // Get action value by what-value
+                       $action = GET_ACTION("admin", $GLOBALS['what']);
+               } // END - if
+
+               // Check for access control line of current menu entry
+               $ret = ADMINS_CHECK_ACL($action, $GLOBALS['what']);
+       } // END - if
+
+       // Return result
+       return $ret;
+}
+
 //
 ?>