* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
// Is the email address blacklisted?
if (($filterData['init_done'] === TRUE) && (isEmailBlacklistEnabled()) && (isEmailBlacklisted($filterData['post_data']['email']))) {
// Then abort here
- $filterData['init_done'] = FALSE;
+ $filterData['init_done'] = FALSE;
+ $filterData['blacklisted'] = 'email';
+ $filterData['message'] = '{--EMAIL_IS_BLACKLISTED--}';
// Run filter chain for successful detection (don't rely on other fields than 'email') here
runFilterChain('post_email_blacklisted', $filterData);
return $filterData;
}
+// Filter to check if IP address is blacklisted
+function FILTER_CHECK_IP_BLACKLISTED ($filterData) {
+ // Is the IP address blacklisted?
+ if (($filterData['init_done'] === TRUE) && (isEmailBlacklistEnabled()) && (isIpBlacklisted(determineRealRemoteAddress()))) {
+ // Then abort here
+ $filterData['init_done'] = FALSE;
+ $filterData['blacklisted'] = 'ip';
+ $filterData['message'] = '{--IP_IS_BLACKLISTED--}';
+
+ // Run filter chain for successful detection (don't rely on other fields than 'IP') here
+ runFilterChain('post_ip_blacklisted', $filterData);
+ } // END - if
+
+ // Return filtered data
+ 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'];
+ $GLOBALS['filter_chain_aborted'] = TRUE;
+
+ // 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
- assert((isset($filterData['init_done'])) && (isset($filterData['post_data']['email'])));
+ assert((isset($filterData['init_done'])) && ($filterData['blacklisted'] == 'email'));
+
+ // @TODO Insert log entry
+
+ // Return filtered data
+ return $filterData;
+}
+
+// Filter for logging blacklisted IP addresses, is being called from above filter
+function FILTER_LOG_IP_BLACKLISTED ($filerData) {
+ // Make sure, that required data is there
+ assert((isset($filterData['init_done'])) && ($filterData['blacklisted'] == 'ip'));
+
+ // @TODO Insert log entry
+
+ // Return filtered data
+ 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