]> git.mxchange.org Git - mailer.git/blobdiff - inc/filter/blacklist_filter.php
Disallow subtraction on unsigned columns:
[mailer.git] / inc / filter / blacklist_filter.php
index dd9cc43a6ac9cf24e0f22996909ff85a8ca1f789..26a846a66c29a4a4388859d9e5b812b2f263caa9 100644 (file)
@@ -74,6 +74,29 @@ function FILTER_CHECK_IP_BLACKLISTED ($filterData) {
        return $filterData;
 }
 
+// Filter to check URL against blacklist
+function FILTER_CHECK_URL_BLACKLISTED ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+       // And shall I check that his URL is not in the black list?
+       if ((isUrlBlacklistEnabled()) && (isUrlBlacklisted($filterData['url']))) {
+               // Create redirect-URL
+               $filterData['redirect'] = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $GLOBALS['blacklist_data'][$filterData['url']]['timestamp'];
+               interruptFilterChain();
+
+               // Set data for next filter chain
+               $filterData['init_done']   = FALSE;
+               $filterData['blacklisted'] = 'url';
+               $filterData['message']     = '{--URL_IS_BLACKLISTED--}';
+
+               // Run filter chain for successful detection (don't rely on other fields than 'IP') here
+               runFilterChain('post_url_blacklisted', $filterData);
+       } // END - if
+
+       // Return the data for next filter
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
 // Filter for logging blacklisted email addresses, is being called from above filter
 function FILTER_LOG_EMAIL_BLACKLISTED ($filerData) {
        // Make sure, that required data is there
@@ -96,5 +119,16 @@ function FILTER_LOG_IP_BLACKLISTED ($filerData) {
        return $filterData;
 }
 
+// Filter for logging blacklisted URLs, is being called from above filter
+function FILTER_LOG_URL_BLACKLISTED ($filerData) {
+       // Make sure, that required data is there
+       assert((isset($filterData['init_done'])) && ($filterData['blacklisted'] == 'url'));
+
+       // @TODO Insert log entry
+
+       // Return filtered data
+       return $filterData;
+}
+
 // [EOF]
 ?>