//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',count()=' . count($GLOBALS['cache_array']['filter']['chains'][$filterName]));
$returnValue = $filterData;
- // Remove any existing flag(s)
- unset($GLOBALS['filter_chain_aborted']);
+ // Continue filter chain is default
+ continueFilterChain();
// Then run all filters
foreach ($GLOBALS['cache_array']['filter']['chains'][$filterName] as $filterFunction => $active) {
// Checks whether the filter chain has been aborted
function isFilterChainAborted () {
// Determine it
- return ((isset($GLOBALS['filter_chain_aborted'])) && ($GLOBALS['filter_chain_aborted'] === TRUE));
+ return ((isset($GLOBALS['filter_chain_interrupted'])) && ($GLOBALS['filter_chain_interrupted'] === TRUE));
+}
+
+// Interrupts the filter chain by enabling flag 'filter_chain_aborted'
+function interruptFilterChain () {
+ // Set it
+ $GLOBALS['filter_chain_interrupted'] = TRUE;
+}
+
+// Continues the filter chain by disabling flag 'filter_chain_aborted'
+function continueFilterChain () {
+ // Set it
+ $GLOBALS['filter_chain_interrupted'] = FALSE;
}
// [EOF]
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;
+ interruptFilterChain();
// Set data for next filter chain
$filterData['init_done'] = FALSE;
if ((!is_string($filterData['new_status'])) || (empty($filterData['new_status']))) {
// Abort here, not fine
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newStatus[' . gettype($filterData['new_status']) . ']=' . $filterData['new_status'] . ' - EXIT!');
- $GLOBALS['filter_chain_aborted'] = FALSE;
+ interruptFilterChain();
} elseif ($filterData['data']['forced_campaign_status'] != $filterData['prev_status']) {
// Status is not like prevStatus
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterData['data']['forced_campaign_status'] . '!=' . $filterData['prev_status'] . ' - EXIT!');
- $GLOBALS['filter_chain_aborted'] = FALSE;
+ continueFilterChain();
} // END - if
// Return filter data
if ((isInStringIgnoreCase('https://', $filterData['subject'])) || (isInStringIgnoreCase('http://', $filterData['subject'])) || (isInStringIgnoreCase('www', $filterData['subject']))) {
// URL in subject found
$filterData['redirect'] = 'modules.php?module=login&what=order&code=' . getCode('SUBJECT_URL');
- $GLOBALS['filter_chain_aborted'] = TRUE;
+ interruptFilterChain();
} // END - if
} // END - if
if ((isInStringIgnoreCase('https://', $filterData['text'])) || (isInStringIgnoreCase('http://', $filterData['text'])) || (isInStringIgnoreCase('www', $filterData['text']))) {
// URL found
$filterData['redirect'] = 'modules.php?module=login&what=order&code=' . getCode('URL_FOUND');
- $GLOBALS['filter_chain_aborted'] = TRUE;
+ interruptFilterChain();
} // END - if
// Remove new-line and carriage-return characters
if (strlen($TEST) > getMaxTextLength()) {
// Text is too long!
$filterData['redirect'] = 'modules.php?module=login&what=order&code=' . getCode('OVERLENGTH');
- $GLOBALS['filter_chain_aborted'] = TRUE;
+ interruptFilterChain();
} // END - if
} // END - if
if ((!isset($filterData['mail_type'])) || ($filterData['mail_type'] < 1)) {
// Not correctly set
$filterData['redirect'] = 'modules.php?module=login&what=order&code=' . getCode('NO_MAIL_TYPE');
- $GLOBALS['filter_chain_aborted'] = TRUE;
+ interruptFilterChain();
} // END - if
// Return the data for next filter
if (!isUrlValid($filterData['url'])) {
// URL is invalid!
$filterData['redirect'] = 'modules.php?module=login&what=order&code=' . getCode('INVALID_URL');
- $GLOBALS['filter_chain_aborted'] = TRUE;
+ interruptFilterChain();
} // END - if
// Return the data for next filter
if (($filterData['receiver'] < getOrderMin()) && (!isAdmin())) {
// Less than allowed receivers entered!
$filterData['redirect'] = 'modules.php?module=login&what=order&code=' . getCode('MORE_RECEIVERS3');
- $GLOBALS['filter_chain_aborted'] = TRUE;
+ interruptFilterChain();
} // END - if
// Return the data for next filter
if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
// Run it
$filterData['status'] = doGenericUserRegistration();
+
+ // Interrupt filter chain
+ interruptFilterChain();
} // END - if
// Return it
if ((isFormSent()) && (isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
// Check form
$isFormSent = isRegistrationDataComplete();
+
+ // Interrupt filter chain
+ interruptFilterChain();
} // END - if
// Return it
if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
// Run it
displayMessage('{--REGISTRATION_DONE--}');
+
+ // Interrupt filter chain
+ interruptFilterChain();
} // END - if
// Return NULL
if (((isGetRequestElementSet('registration_provider')) && (getRequestElement('registration_provider') == 'register')) || (getDefaultRegistrationProvider() == 'register')) {
// Display generic form
doDisplayGenericUserRegistrationForm();
+
+ // Interrupt filter chain
+ interruptFilterChain();
} // END - if
// Return NULL
if ((!is_string($filterData['new_status'])) || (empty($filterData['new_status']))) {
// Abort here, but fine!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newStatus[' . gettype($filterData['new_status']) . ']=' . $filterData['new_status'] . ' - EXIT!');
- $GLOBALS['filter_chain_aborted'] = TRUE;
+ interruptFilterChain();
} elseif ($filterData['data'][$filterData['url_id']]['url_status'] != $filterData['prev_status']) {
// Status is not like prevStatus
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $filterData['data'][$filterData['url_id']]['url_status'] . '!=' . $filterData['prev_status'] . ' - EXIT!');
- $GLOBALS['filter_chain_aborted'] = FALSE;
+ continueFilterChain();
} // END - if
// Return filter data
if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
// Run it
$filterData['status'] = doWernisUserRegistration();
+
+ // Interrupt filter chain
+ interruptFilterChain();
} // END - if
// Return it
// Is generic user registration selected?
if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
// Run it
+
+ // Interrupt filter chain
+ interruptFilterChain();
} // END - if
// Return it
// Is generic user registration selected?
if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
// Run it
+
+ // Interrupt filter chain
+ interruptFilterChain();
} // END - if
// Return it
// Is generic user registration selected?
if (((isGetRequestElementSet('registration_provider')) && (gettRequestElement('registration_provider') == 'wernis')) || (getDefaultRegistrationProvider() == 'wernis')) {
// Run it
+
+ // Interrupt filter chain
+ interruptFilterChain();
} // END - if
// Return it