]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
no more SSL
[mailer.git] / inc / filters.php
index 239d9048c122537fc62ad0e6d9cfe67b10feb4b6..82fb3196790e1727a76eec7073ce4b0a4b2fc6b1 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Allgemeine Filter                                *
  * -------------------------------------------------------------------- *
- * $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 *
@@ -807,22 +802,6 @@ function FILTER_TRIGGER_SENDING_POOL () {
        unset($GLOBALS['pool_cnt']);
 }
 
-// Filter for checking and updating SVN revision
-function FILTER_CHECK_REPOSITORY_REVISION () {
-       // Only execute this filter if installed and all config entries are there
-       if ((!isInstalled()) || (!isConfigEntrySet('patch_level'))) {
-               return;
-       } // END - if
-
-       // Check for patch level differences between database and current hard-coded
-       if ((getCurrentRepositoryRevision() > getConfig('patch_level')) || (getConfig('patch_level') == 'CURRENT_REPOSITORY_REVISION') || (getConfig('patch_ctime') == 'UNIX_TIMES')) {
-               // Update database and CONFIG array
-               updateConfiguration(array('patch_level', 'patch_ctime'), array(getCurrentRepositoryRevision(), 'UNIX_TIMESTAMP()'));
-               setConfigEntry('patch_level', getCurrentRepositoryRevision());
-               setConfigEntry('patch_ctime', time());
-       } // END - if
-}
-
 // Filter for running hourly reset
 function FILTER_RUN_HOURLY_RESET () {
        // Only execute this filter if installed
@@ -901,12 +880,18 @@ function FILTER_RUN_YEARLY_RESET () {
 // Filter for loading more runtime includes (not for installation)
 function FILTER_LOAD_RUNTIME_INCLUDES () {
        // Load more includes
-       foreach (array('databases', 'session', 'versions') as $inc) {
+       foreach (array('databases') as $inc) {
                // Load the include
                loadIncludeOnce('inc/' . $inc . '.php');
        } // END - foreach
 }
 
+// Filter for initializing language by loading the language file
+function FILTER_INIT_LANGUAGE () {
+       // Load language file(s)
+       loadLanguageFile();
+}
+
 // Filter for checking admin ACL
 function FILTER_CHECK_ADMIN_ACL () {
        // Extension not installed so it's always allowed to access everywhere!
@@ -1031,8 +1016,8 @@ function FILTER_HANDLE_FATAL_ERRORS () {
                'corr' => $CORR
        );
 
-       // Load footer
-       loadIncludeOnce('inc/header.php');
+       // Load header
+       loadPageHeader();
 
        // Load main template
        loadTemplate('fatal_errors', FALSE, $content);
@@ -1041,7 +1026,7 @@ function FILTER_HANDLE_FATAL_ERRORS () {
        initFatalMessages();
 
        // Load footer
-       loadIncludeOnce('inc/footer.php');
+       loadPageFooter();
 
        // Abort here
        doShutdown();
@@ -1176,7 +1161,7 @@ function FILTER_LOAD_PAGE_HEADER () {
 // Filter for adding style sheet, closing page header
 function FILTER_FINISH_PAGE_HEADER () {
        // Include stylesheet
-       loadIncludeOnce('inc/stylesheet.php');
+       loadStyleSheets();
 
        // Closing HEAD tag
        $GLOBALS['__page_header'] .= '</head>';
@@ -1238,7 +1223,7 @@ function FILTER_ACTIVATE_EXCHANGE () {
        // Check total amount of users
        if (getTotalConfirmedUser() >= getActivateXchange()) {
                // Activate System
-               addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N',`hidden`='N',`mem_only`='Y' WHERE `module`='order' LIMIT 1");
+               addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N',`mem_only`='Y' WHERE `module`='order' LIMIT 1");
                addSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y',`locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2");
 
                // Run SQLs
@@ -1296,7 +1281,7 @@ function FILTER_GENERATE_FILE_SECRET_HASH ($filterData) {
        setConfigEntry('secret_key', '');
 
        // File hash was generated so we can also file the secret file... hopefully.
-       $hashFile = sprintf('%s%s.%s.cache', getPath(), getCachePath(), getFileHash());
+       $hashFile = getGenericHashFileName();
 
        // Read key from secret file
        if ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == '') || (!isFileReadable($hashFile))) {
@@ -1304,7 +1289,7 @@ function FILTER_GENERATE_FILE_SECRET_HASH ($filterData) {
                loadIncludeOnce('inc/gen_sql_patches.php');
 
                // Generate file name again
-               $hashFile = sprintf('%s%s.%s.cache', getPath(), getCachePath(), getFileHash());
+               $hashFile = getGenericHashFileName();
        } // END - if
 
        // Test again
@@ -1402,24 +1387,6 @@ function FILTER_HANDLE_REFERRER_BANNER_VIEW ($filterData) {
        redirectToUrl('modules.php?module=index');
 }
 
-// Filter for redirecting on wrong server name (e.g. bad.your-server.tld will be redirected to your-server.tld)
-function FILTER_REDIRECT_WRONG_SERVER_NAME ($filterData) {
-       // Get URL
-       $url = getUrl();
-
-       // Is the configured URL same as SERVER_NAME?
-       if (extractHostnameFromUrl($url) != detectServerName()) {
-               // Log all attempts
-               logWrongServerNameRedirect();
-
-               // Then redirect to configured URL
-               redirectToRequestUri();
-       } // END - if
-
-       // Return filter data
-       return $filterData;
-}
-
 // Filter for adding hidden session id
 function FILTER_ADD_INPUT_HIDDEN_SESSION_ID ($filterData) {
        // Is a spider detected?
@@ -1432,28 +1399,6 @@ function FILTER_ADD_INPUT_HIDDEN_SESSION_ID ($filterData) {
        return $filterData;
 }
 
-// Filter for purging old SERVER_NAME entries
-function FILTER_SERVER_NAME_EXTRA_AUTOPURGE ($filterData) {
-       // Is purging configured?
-       if ((isApServerNameEnabled()) && (getApServerNameSince() > 0)) {
-               // Then start purging
-               sqlQuery('DELETE LOW_PRIORITY FROM
-       `{?_MYSQL_PREFIX?}_server_name_log`
-WHERE
-       (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`server_name_added`)) >= {?ap_server_name_since?}',
-                       __FILE__, __LINE__);
-
-               // Are some entries deleted?
-               if (sqlAffectedRows() > 0) {
-                       // Okay, then send an email to the admin
-                       sendAdminNotification('{--ADMIN_PURGE_USER_SERVER_NAME_LOG_SUBJECT--}', 'admin_purge_user_server_name_log', sqlAffectedRows());
-               } // END - if
-       } // END - if
-
-       // Return filter data
-       return $filterData;
-}
-
 // Filter for detecting menu mode
 function FILTER_DETERMINE_MENU_MODE_GENERIC ($filterData) {
        // "Detect" it