]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
More fixes for new installer and script in general :(
[mailer.git] / inc / filters.php
index 8c885c5006a71d1b1ad2825f8b5270cb8b796f38..aeb102d24d49971166299bafed1632ca4863db09 100644 (file)
@@ -51,11 +51,12 @@ function FILTER_FLUSH_FILTERS () {
                reportBug(__FUNCTION__, __LINE__, 'No database link is up. Cannot flush filters.');
        } elseif ((isInstallationPhase()) && (!SQL_IS_LINK_UP())) {
                // If the link is not up in installation phase, skip flushing filters
+               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters: No link is up.');
                return;
        }
 
        // Is the extension ext-sql_patches updated?
-       if ((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) {
+       if (((!isExtensionInstalled('sql_patches')) || (isExtensionInstalledAndOlder('sql_patches', '0.5.9'))) && (!isInstallationPhase())) {
                // Log only in debug mode
                if (isDebugModeEnabled()) {
                        logDebugMessage(__FUNCTION__, __LINE__, 'Cannot flush filters, ext-sql_patches might be missing. isExtensionInstalled()=' . intval(isExtensionInstalled('sql_patches')) . ',isExtensionInstalledAndOlder()=' . intval(isExtensionInstalledAndOlder('sql_patches', '0.5.9')));
@@ -78,12 +79,12 @@ function FILTER_FLUSH_FILTERS () {
                // Walk through all filters
                foreach ($filterArray as $filterFunction => $active) {
                        // Is this filter loaded?
-                       //* DEBUG: */ debugOutput('FOUND:'.$filterName.'/'.$filterFunction.'='.$active);
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'FOUND:'.$filterName.'/'.$filterFunction.'='.$active);
                        if (((!isset($GLOBALS['cache_array']['filter']['loaded'][$filterName][$filterFunction])) && ($active != 'R')) || ($active == 'A')) {
                                // Is this filter already in database?
                                if (countSumTotalData($filterFunction, 'filters', 'filter_name', 'filter_function', TRUE, sprintf(" AND `filter_name`='%s'", SQL_ESCAPE($filterName))) == 0) {
                                        // Add this filter (all filters are active by default)
-                                       //* DEBUG: */ debugOutput('ADD:'.$filterName.'/'.$filterFunction);
+                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ADD:'.$filterName.'/'.$filterFunction);
                                        $insertSQL .= sprintf("('%s','%s','Y'),", $filterName, $filterFunction);
                                        $inserted++;
                                } elseif (isDebugModeEnabled()) {
@@ -92,13 +93,16 @@ function FILTER_FLUSH_FILTERS () {
                                }
                        } elseif ($active == 'R') {
                                // Remove this filter
-                               //* DEBUG: */ debugOutput('REMOVE:'.$filterName.'/'.$filterFunction);
+                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REMOVE:'.$filterName.'/'.$filterFunction);
                                $removeSQL .= sprintf(" (`filter_name`='%s' AND `filter_function`='%s') OR", $filterName, $filterFunction);
                                $removed++;
                        }
                } // END - foreach
        } // END - foreach
 
+       // Debug message
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'inserted=' . $inserted . ',removed=' . $removed . ' - AFTER COLLECTION');
+
        // Something has been added?
        if ($inserted > 0) {
                // Finish SQL command and add it
@@ -153,21 +157,6 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($filterData) {
        return $content;
 }
 
-// Filter for redirecting to logout if ext-sql_patches has been installed
-function FILTER_REDIRECT_TO_LOGOUT_SQL_PATCHES () {
-       // Remove this filter
-       unregisterFilter(__FUNCTION__, __LINE__, 'shutdown', __FUNCTION__);
-
-       // Is the element set?
-       if (isset($GLOBALS['ext_load_mode'])) {
-               // Redirect here
-               redirectToUrl('modules.php?module=admin&logout=1&' . $GLOBALS['ext_load_mode'] . '=sql_patches');
-       } // END - if
-
-       // This should not happen!
-       logDebugMessage(__FUNCTION__, __LINE__, 'Cannot auto-logout because no extension load-mode has been set.');
-}
-
 // Filter for auto-activation of a extension
 function FILTER_AUTO_ACTIVATE_EXTENSION ($filterData) {
        // Debug message