X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilter-functions.php;h=de21a6fd9c69a8fe4e1d0e050fe5ccc158ced7b0;hb=refs%2Fheads%2Fserver-0.2.1-FINAL%2Fshipsimu-org;hp=e217428394c3dbff7dbf7b47bc02d19f1bd35640;hpb=e5dffd4249c97200cbad02f3f4eaf5c373fdb89a;p=mailer.git diff --git a/inc/filter-functions.php b/inc/filter-functions.php index e217428394..de21a6fd9c 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -10,13 +10,8 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Funktionen fuer Filter-System * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2013 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -74,7 +69,7 @@ ORDER BY `filter_id` ASC', __FUNCTION__, __LINE__); // Are there entries? - if (!ifSqlHasZeroNums($result)) { + if (!ifSqlHasZeroNumRows($result)) { // Load all filters while ($filterArray = sqlFetchArray($result)) { // Get filter name and function @@ -106,11 +101,11 @@ ORDER BY registerFilter(__FUNCTION__, __LINE__, 'init', 'LOAD_CONFIGURATION'); registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_RANDOMIZER'); registerFilter(__FUNCTION__, __LINE__, 'init', 'LOAD_RUNTIME_INCLUDES'); + registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_LANGUAGE'); registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_EXTENSIONS'); registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_SESSION'); registerFilter(__FUNCTION__, __LINE__, 'init', 'SET_CURRENT_DATE'); registerFilter(__FUNCTION__, __LINE__, 'init', 'INIT_RANDOM_NUMBER'); - registerFilter(__FUNCTION__, __LINE__, 'init', 'CHECK_REPOSITORY_REVISION'); registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_HOURLY_RESET'); registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_DAILY_RESET'); registerFilter(__FUNCTION__, __LINE__, 'init', 'RUN_WEEKLY_RESET'); @@ -123,7 +118,6 @@ ORDER BY registerFilter(__FUNCTION__, __LINE__, 'init', 'COUNT_MODULE'); registerFilter(__FUNCTION__, __LINE__, 'init', 'UPDATE_LOGIN_DATA'); registerFilter(__FUNCTION__, __LINE__, 'init', 'ACTIVATE_EXCHANGE'); - registerFilter(__FUNCTION__, __LINE__, 'init', 'REDIRECT_WRONG_SERVER_NAME'); // Post-initialization registerFilter(__FUNCTION__, __LINE__, 'post_init', 'DETERMINE_USERNAME'); @@ -193,9 +187,6 @@ ORDER BY // Remove extension registerFilter(__FUNCTION__, __LINE__, 'extension_remove', 'REMOVE_EXTENSION'); - // Exclude some users - registerFilter(__FUNCTION__, __LINE__, 'exclude_users', 'HTML_INCLUDE_USERS'); - // Handling of fatal errors registerFilter(__FUNCTION__, __LINE__, 'handle_fatal_errors', 'HANDLE_FATAL_ERRORS'); @@ -237,7 +228,7 @@ function registerFilter ($file, $line, $filterName, $filterFunction, $silentAbor // In installation phase we always want to abort if (($silentAbort === FALSE) || (isInstaller())) { // Add fatal message - reportBug(__FUNCTION__, __LINE__, sprintf("Filter chain %s has already filter function %s registered! file=%s,L=%s,force=%d", $filterName, $filterFunction, basename($file), $line, intval($force))); + reportBug(__FUNCTION__, __LINE__, sprintf('Filter chain %s has already filter function %s registered! file=%s,L=%s,force=%d', $filterName, $filterFunction, basename($file), $line, intval($force))); } // END - if // Abort here @@ -249,7 +240,7 @@ function registerFilter ($file, $line, $filterName, $filterFunction, $silentAbor // Is the function there? if (!function_exists($filterFunction)) { // Then abort here - logDebugMessage(__FUNCTION__, __LINE__, sprintf("Filter function %s could not be added to filter chain %s. file=%s,L=%s,force=%d", $filterFunction, $filterName, basename($file), $line, intval($force))); + logDebugMessage(__FUNCTION__, __LINE__, sprintf('Filter function %s could not be added to filter chain %s. file=%s,L=%s,force=%d', $filterFunction, $filterName, basename($file), $line, intval($force))); return FALSE; } // END - if @@ -300,7 +291,7 @@ function runFilterChain ($filterName, $filterData = NULL) { // Is that filter chain there? if (!isset($GLOBALS['cache_array']['filter']['chains'][$filterName])) { - // Log not found filters in debug-mode + // Filter chain not found filters in debug-mode if (isDebugModeEnabled()) { // Log it away... logDebugMessage(__FUNCTION__, __LINE__, 'Filter chain ' . $filterName . ' does not exist.'); @@ -314,8 +305,8 @@ function runFilterChain ($filterName, $filterData = NULL) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',count()=' . count($GLOBALS['cache_array']['filter']['chains'][$filterName])); $returnValue = $filterData; - // Remove any existing flag(s) - unset($GLOBALS['filter_chain_aborted']); + // Continue filter chain is default + continueFilterChain(); // Then run all filters foreach ($GLOBALS['cache_array']['filter']['chains'][$filterName] as $filterFunction => $active) { @@ -434,7 +425,19 @@ function loadExtensionFilters ($ext_name) { // Checks whether the filter chain has been aborted function isFilterChainAborted () { // Determine it - return ((isset($GLOBALS['filter_chain_aborted'])) && ($GLOBALS['filter_chain_aborted'] === TRUE)); + return ((isset($GLOBALS['filter_chain_interrupted'])) && ($GLOBALS['filter_chain_interrupted'] === TRUE)); +} + +// Interrupts the filter chain by enabling flag 'filter_chain_aborted' +function interruptFilterChain () { + // Set it + $GLOBALS['filter_chain_interrupted'] = TRUE; +} + +// Continues the filter chain by disabling flag 'filter_chain_aborted' +function continueFilterChain () { + // Set it + $GLOBALS['filter_chain_interrupted'] = FALSE; } // [EOF]