]> git.mxchange.org Git - mailer.git/blobdiff - inc/filters.php
Several code cleanups:
[mailer.git] / inc / filters.php
index 020521858b84c815a9825f604c764518fc69343a..5a52b5e742e56957376780c0611d11f7872b7a0b 100644 (file)
@@ -54,7 +54,7 @@ function FILTER_FLUSH_FILTERS () {
        // Is a database link here and not in installation mode?
        if ((!SQL_IS_LINK_UP()) && (!isInstalling())) {
                // Abort here
-               addFatalMessage(__FUNCTION__, __LINE__, '{--FILTER_FLUSH_FAILED_NO_DATABASE--}');
+               debug_report_bug(__FUNCTION__, __LINE__, 'No database link is up. Cannot flush filters.');
                return false;
        } // END - if
 
@@ -137,7 +137,7 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($data) {
        $content = $data;
 
        // Handle failed logins here if not in guest
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "type=".$data['type'].",action=".getAction().",what=".getWhat().",level=".$data['access_level']."<br />");
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $data['type'] . ',action=' . getAction() . ',what=' . getWhat() . ',level=' . $data['access_level']);
        if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isWhatSet()) || (getWhat() == 'overview') || (getWhat() == getIndexHome()))) && ($data['access_level'] != 'guest') && ((isExtensionInstalledAndNewer('sql_patches', '0.4.7')) || (isExtensionInstalledAndNewer('admins', '0.7.6')))) {
                // Handle failure
                $content['content'] .= handleLoginFailures($data['access_level']);
@@ -335,14 +335,16 @@ function FILTER_UPDATE_LOGIN_DATA () {
 
 // Filter for initializing randomizer
 function FILTER_INIT_RANDOMIZER () {
+       // Take a prime number which is long (if you know a longer one please try it out!)
+       setConfigEntry('_PRIME', 591623);
+
        // Only execute this filter if installed
        if ((!isInstalled()) || (!isExtensionInstalledAndNewer('other', '0.2.5'))) {
+               // Set missing entry
+               setConfigEntry('_ADD', 0);
                return;
        } // END - if
 
-       // Take a prime number which is long (if you know a longer one please try it out!)
-       setConfigEntry('_PRIME', 591623);
-
        // Calculate "entropy" with the prime number (for code generation)
        setConfigEntry('_ADD', (getPrime() * getPrime() / (pi() * getCodeLength() + 1)));
 
@@ -1085,5 +1087,17 @@ function FILTER_EXTENSION_MARK_INSTALLED ($data) {
        $GLOBALS['ext_is_installed'][$data['ext_name']] = true;
 }
 
+// Filter for generating mails links for 'pool' mails
+function FILTER_GENERATE_POOL_MAIL_LINKS ($data) {
+       // Is type 'mid'?
+       if ($data['type'] == 'mid') {
+               // Load template
+               $data['__output'] .= loadTemplate('admin_links_' . strtolower($data['mail_status']) . '_pool_mail', true, $data);
+       } // END - if
+
+       // Return data
+       return $data;
+}
+
 // [EOF]
 ?>