// Add admin menu
addAdminMenuSql('setup', 'config_blacklist', 'Sperrlisten', 'Einstellungen zu den Sperrlisten.', 8);
- addAdminMenuSql('misc', 'list_blacklist', 'Sperrlisten...', 'Zeigt gesperrte Email-Adressen und/oder URLs an.', 3);
+ addAdminMenuSql('misc', 'list_blacklist', 'Sperrlisten...', 'Zeigt gesperrte Email-Adressen, IP-Adressen, URLs und vieles mehr an.', 3);
// Add configuration
addConfigAddSql('email_blacklist', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
addConfigAddSql('url_blacklist', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
// Register filters
- registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'CHECK_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'pre_update_user_data', 'CHECK_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
- registerFilter(__FILE__, __LINE__, 'post_email_blacklisted', 'LOG_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration' , 'CHECK_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_update_user_data' , 'CHECK_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'post_email_blacklisted', 'LOG_EMAIL_BLACKLISTED' , FALSE, TRUE, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
addDropTableSql('blacklist');
// Remove menu
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_blacklist', 'list_blacklist') LIMIT 1");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_blacklist', 'list_blacklist')");
// Unregister filters
- unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'CHECK_EMAIL_BLACKLISTED', TRUE, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'pre_update_user_data', 'CHECK_EMAIL_BLACKLISTED', TRUE, isExtensionDryRun());
- unregisterFilter(__FILE__, __LINE__, 'post_email_blacklisted', 'LOG_EMAIL_BLACKLISTED', FALSE, TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration' , 'CHECK_EMAIL_BLACKLISTED', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_update_user_data' , 'CHECK_EMAIL_BLACKLISTED', TRUE, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_email_blacklisted', 'LOG_EMAIL_BLACKLISTED' , TRUE, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
// HTML or regular text mail?
if (postRequestElement('html') == 'Y') {
// Chek for valid HTML tags
- setPostRequestElement('text', checkHtmlTags(postRequestElement('text')));
+ $checked = checkHtmlTags(postRequestElement('text')));
// Maybe invalid tags found?
- if (!isPostRequestElementSet('text')) $data['url'] = 'modules.php?module=login&what=order&code=' . getCode('INVALID_TAGS') . '&id=' . $data['id'];
+ if (empty($checked)) {
+ // Invalid HTML tags found
+ $data['url'] = 'modules.php?module=login&what=order&code=' . getCode('INVALID_TAGS') . '&id=' . $data['id'];
+ } // END - if
} else {
// Remove any HTML code
setPostRequestElement('text', str_replace(array('<', '>'), array('{OPEN_HTML}', '{CLOSE_HTML}'), postRequestElement('text')));