inc/extensions/ext-beg.php svneol=native#text/plain
inc/extensions/ext-birthday.php svneol=native#text/plain
inc/extensions/ext-bitcoins.php svneol=native#text/plain
+inc/extensions/ext-blacklist.php svneol=native#text/plain
inc/extensions/ext-bonus.php svneol=native#text/plain
inc/extensions/ext-booking.php svneol=native#text/plain
inc/extensions/ext-cache.php svneol=native#text/plain
inc/language/bank_de.php svneol=native#text/plain
inc/language/beg_de.php svneol=native#text/plain
inc/language/birthday_de.php svneol=native#text/plain
+inc/language/blacklist_de.php svneol=native#text/plain
inc/language/bonus_de.php svneol=native#text/plain
inc/language/booking_de.php svneol=native#text/plain
inc/language/cache_de.php svneol=native#text/plain
inc/libs/autopurge_functions.php svneol=native#text/plain
inc/libs/beg_functions.php svneol=native#text/plain
inc/libs/birthday_functions.php svneol=native#text/plain
+inc/libs/blacklist_functions.php svneol=native#text/plain
inc/libs/bonus_functions.php svneol=native#text/plain
inc/libs/booking_functions.php svneol=native#text/plain
inc/libs/cache_functions.php svneol=native#text/plain
inc/modules/admin/what-config_autopurge.php svneol=native#text/plain
inc/modules/admin/what-config_beg.php svneol=native#text/plain
inc/modules/admin/what-config_birthday.php svneol=native#text/plain
+inc/modules/admin/what-config_blacklist.php svneol=native#text/plain
inc/modules/admin/what-config_bonus.php svneol=native#text/plain
inc/modules/admin/what-config_cache.php svneol=native#text/plain
inc/modules/admin/what-config_cats.php svneol=native#text/plain
templates/de/html/admin/admin_config_beg.tpl svneol=native#text/plain
templates/de/html/admin/admin_config_beg_pro.tpl svneol=native#text/plain
templates/de/html/admin/admin_config_birthday.tpl svneol=native#text/plain
+templates/de/html/admin/admin_config_blacklist.tpl svneol=native#text/plain
templates/de/html/admin/admin_config_bonus.tpl svneol=native#text/plain
templates/de/html/admin/admin_config_bonus_pro.tpl svneol=native#text/plain
templates/de/html/admin/admin_config_cache.tpl svneol=native#text/plain
templates/de/html/ext/ext_beg.tpl svneol=native#text/plain
templates/de/html/ext/ext_birthday.tpl svneol=native#text/plain
templates/de/html/ext/ext_bitcoins.tpl svneol=native#text/plain
+templates/de/html/ext/ext_blacklist.tpl svneol=native#text/plain
templates/de/html/ext/ext_bonus.tpl svneol=native#text/plain
templates/de/html/ext/ext_booking.tpl svneol=native#text/plain
templates/de/html/ext/ext_cache.tpl svneol=native#text/plain
./inc/language-functions.php:254: // @TODO These are all valid languages, again hard-coded
./inc/language/install_de.php:142: // @TODO Move this to e.g. ext-smtp
./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no *
-./inc/language/order_de.php:70: // @TODO Find better text
+./inc/language/order_de.php:69: // @TODO Find better text
./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings *
./inc/language/refback_de.php:51: // @TODO Rewrite these constants to one
./inc/libs/admins_functions.php:537: // @TODO This can be, somehow, rewritten
./inc/template-functions.php:209: * @TODO On some pages this is buggy
./inc/template-functions.php:298: // @TODO Remove these sanity checks if all is fine
./inc/template-functions.php:747: // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates
-./inc/wrapper-functions.php:3209: // @TODO Find a way to not use direct module comparison
+./inc/wrapper-functions.php:3197: // @TODO Find a way to not use direct module comparison
./inc/wrapper-functions.php:524:// @TODO Do some more sanity check here
./inc/xml-functions.php:240: // @TODO Handle characters
./mailid.php:123: // @TODO Rewrite this to a filter/function
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 01/21/2013 *
+ * =================== Last change: 01/21/2013 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : ext-blacklist.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Blacklisting of email/URL addresses *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// Version number
+setThisExtensionVersion('0.0.0');
+
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.0.0'));
+
+// This extension is in development (non-productive)
+enableExtensionProductive(FALSE);
+
+switch (getExtensionMode()) {
+ case 'setup': // Do stuff when installation is running
+ // SQL commands to run
+ addDropTableSql('blacklist');
+ addCreateTableSql('blacklist', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`data` VARCHAR(255) NOT NULL DEFAULT '',
+`type` VARCHAR(20) NOT NULL DEFAULT 'INVALID',
+`pool_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
+`added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+INDEX (`pool_id`)",
+ 'Generic blacklist');
+
+ // 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);
+
+ // Add configuration
+ addConfigAddSql('url_blacklist', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ addConfigAddSql('email_blacklist', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ break;
+
+ case 'remove': // Do stuff when removing extension
+ // SQL commands to run
+ addDropTableSql('blacklist');
+
+ // Remove menu
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_blacklist', 'list_blacklist') LIMIT 1");
+ break;
+
+ case 'activate': // Do stuff when admin activates this extension
+ // SQL commands to run
+ break;
+
+ case 'deactivate': // Do stuff when admin deactivates this extension
+ // SQL commands to run
+ break;
+
+ case 'update': // Update an extension
+ switch (getCurrentExtensionVersion()) {
+ case '0.0.1': // SQL queries for v0.0.1
+ addExtensionSql('');
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes('');
+ break;
+ } // END - switch
+ break;
+
+ case 'modify': // When the extension got modified
+ break;
+
+ case 'test': // For testing purposes
+ break;
+
+ case 'init': // Do stuff when extension is initialized
+ break;
+
+ default: // Unknown extension mode
+ reportBug(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
+ break;
+} // END - switch
+
+// [EOF]
+?>
} // END - if
// Version number
-setThisExtensionVersion('0.5.6');
+setThisExtensionVersion('0.5.7');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6'));
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7'));
switch (getExtensionMode()) {
case 'setup': // Do stuff when installation is running
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addDropTableSql('url_blacklist');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_order' LIMIT 1");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='order'");
break;
case '0.5.0': // SQL queries for v0.5.0
- addDropTableSql('url_blacklist');
- addCreateTableSql('url_blacklist', "
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`url` VARCHAR(255) NOT NULL DEFAULT '',
-`pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-PRIMARY KEY (`id`),
-INDEX (`pool_id`)",
- 'URL blacklist');
-
// Update notes (these will be set as task text!)
- setExtensionUpdateNotes("Tabelle für URL-Sperrliste angelegt.");
+ setExtensionUpdateNotes("Nicht mehr gültiges Update.");
break;
case '0.5.1': // SQL queries for v0.5.1
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter für Spaltenname des gesperrten Werbeguthabens hinzugefügt.");
break;
+
+ case '0.5.7': // SQL queries for v0.5.7
+ addDropTableSql('url_blacklist');
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Tabelle für URL-Sperrliste gelöscht (nach <strong>ext-blacklist</strong> verschoben).");
+ break;
} // END - switch
break;
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 01/21/2013 *
+ * =================== Last change: 01/21/2013 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : blacklist_de.php *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Deutsche Sprachunterstuetzung *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// Language definitions
+addMessages(array(
+ // Admin messages
+ 'ADMIN_CONFIG_BLACKLIST_TITLE' => "Konfiguration von Sperrlisten",
+ 'ADMIN_CONFIG_BLACKLIST_LEGEND' => "Sperrlisten aktvieren:",
+ 'ADMIN_CONFIG_EMAIL_BLACKLIST_ENABLED' => "Sperrliste für Email-Adressen aktivieren?",
+ 'ADMIN_CONFIG_URL_BLACKLIST_ENABLED' => "Sperrliste für gebuchte URLs aktivieren?",
+ 'ADMIN_CONFIG_BLACKLIST_NOTICE' => "<strong>Hinweise:</strong> Die Sperrliste für Email-Adressen gilt sowohl für die Mitgliedsanmeldung als auch wenn das Mitglied seine Daten ändert. Ist die vom Mitglied eingegebene Email-Adresse gesperrt, wird diese nicht angenommen. Die URL-Sperrliste gilt für alle Erweiterungen (Besuchertausch, Mailbuchung, Forced-Buchungen usw.).",
+));
+
+// [EOF]
+?>
'ADMIN_CONFIG_MAX_UNCONFIRMED_MAILS' => "Maximale erlaubter Anzahl unbest. Mails um eine Mailbuchung durchzuführen",
'ADMIN_CONFIG_CHECK_EMAIL_TEXT' => "Sind URLs im Werbetext erlaubt?",
'ADMIN_CONFIG_CHECK_EMAIL_SUBJECT' => "Sind URLs in der Betreffzeile erlaubt?",
- 'ADMIN_CONFIG_URL_BLACKLIST' => "Black-Liste für gebuchte URLs aktivieren?",
'ADMIN_CONFIG_ORDER_NOTICE' => "Das Auswahlverfahren von Mailempfängern wirkt sich nur auf kleinere Buchungen - mit weniger Empfänger als maximal möglich - aus.",
// Admin config - repay options
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 01/21/2013 *
+ * =================== Last change: 01/21/2013 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : blacklist_functions.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for ext- *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Funktionen fuer ext- *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// Inserts a given email (pattern) in blacklist if not found
+function insertEmailInBlacklist ($email, $id) {
+ // Is this feature turned on and is the URL not there?
+ if (!isEmailBlacklistEnabled()) {
+ // Not enabled, then please don't call this function
+ reportBug(__FUNCTION__, __LINE__, 'URL blacklisting is disabled, email=' . $email . ',id=' . $id);
+ } elseif (!isEmailBlacklisted($email)) {
+ // Did not find a record so we can add it... :)
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_blacklist` (`data`, `pool_id`, `type`) VALUES ('%s', %s, 'EMAIL')",
+ array(
+ $email,
+ $id
+ ), __FUNCTION__, __LINE__);
+ } // END - if
+}
+
+// Checks whether given email is blacklisted
+function isEmailBlacklisted ($email) {
+ // Mark it as not listed by default
+ $listed = FALSE;
+
+ // Is black-listing enbaled?
+ if (!isEmailBlacklistEnabled()) {
+ // No, then all emails are not in this list
+ return FALSE;
+ } elseif (!isset($GLOBALS['blacklist_data']['email'][$email])) {
+ // Check black-list for given email
+ $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`added`) AS `added` FROM `{?_MYSQL_PREFIX?}_blacklist` WHERE '%s' REGEXP `data` AND `type`='EMAIL' LIMIT 1",
+ array($email), __FUNCTION__, __LINE__);
+
+ // Is there an entry?
+ if (SQL_NUMROWS($result) == 1) {
+ // Jupp, we got one listed
+ $GLOBALS['blacklist_data']['email'][$email] = SQL_FETCHARRAY($result);
+
+ // Mark it as listed
+ $listed = TRUE;
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } else {
+ // Is found in cache -> black-listed
+ $listed = TRUE;
+ }
+
+ // Return result
+ return $listed;
+}
+
+// Inserts a given URL in blacklist if not found
+function insertUrlInBlacklist ($url, $id) {
+ // Is this feature turned on and is the URL not there?
+ if (!isUrlBlacklistEnabled()) {
+ // Not enabled, then please don't call this function
+ reportBug(__FUNCTION__, __LINE__, 'URL blacklisting is disabled, url=' . $url . ',id=' . $id);
+ } elseif (!isUrlBlacklisted($url)) {
+ // Did not find a record so we can add it... :)
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_blacklist` (`data`, `pool_id`, `type`) VALUES ('%s', %s, 'URL')",
+ array(
+ $url,
+ $id
+ ), __FUNCTION__, __LINE__);
+ } // END - if
+}
+
+// Checks whether given URL is blacklisted
+function isUrlBlacklisted ($url) {
+ // Mark it as not listed by default
+ $listed = FALSE;
+
+ // Is black-listing enbaled?
+ if (!isUrlBlacklistEnabled()) {
+ // No, then all URLs are not in this list
+ return FALSE;
+ } elseif (!isset($GLOBALS['blacklist_data']['url'][$url])) {
+ // Check black-list for given URL
+ $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`added`) AS `added`, `pool_id` FROM `{?_MYSQL_PREFIX?}_blacklist` WHERE `data`='%s' AND `type`='URL' LIMIT 1",
+ array($url), __FUNCTION__, __LINE__);
+
+ // Is there an entry?
+ if (SQL_NUMROWS($result) == 1) {
+ // Jupp, we got one listed
+ $GLOBALS['blacklist_data']['url'][$url] = SQL_FETCHARRAY($result);
+
+ // Mark it as listed
+ $listed = TRUE;
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } else {
+ // Is found in cache -> black-listed
+ $listed = TRUE;
+ }
+
+ // Return result
+ return $listed;
+}
+
+// ----------------------------------------------------------------------------
+// Configuration wrapper functions
+// ----------------------------------------------------------------------------
+
+// Wrapper to check if url_blacklist is enabled
+function isUrlBlacklistEnabled () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getConfig('url_blacklist') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Wrapper to check if email_blacklist is enabled
+function isEmailBlacklistEnabled () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getConfig('email_blacklist') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// [EOF]
+?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 01/21/2013 *
+ * =================== Last change: 01/21/2013 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-config_blacklist.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Configuration for ext-blacklist *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Konfiguration der Sperrlisten *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
+
+// Add description as navigation point
+addYouAreHereLink('admin', __FILE__);
+
+if (isFormSent('save_config')) {
+ // Save data
+ adminSaveSettingsFromPostData();
+} else {
+ // Load template
+ loadTemplate('admin_config_blacklist');
+}
+
+// [EOF]
+?>
// Nothing selected
displayMessage('{--ADMIN_MAILS_NOTHING_CHECKED--}');
}
- } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (isUrlBlacklistEnabled())) {
+ } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (isExtensionActive('blacklist')) && (isUrlBlacklistEnabled())) {
// Lock URLs
foreach (postRequestElement('sel') as $id => $url) {
// Secure id number
$id = bigintval($id);
// Lookup in blacklist
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
- array($url), __FILE__, __LINE__);
- if (SQL_HASZERONUMS($result)) {
- // Did not find a record so we can add it... :)
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_url_blacklist` (`url`, `pool_id`) VALUES ('%s',%s)",
- array($url, $id), __FILE__, __LINE__);
- } // END - if
-
- // Free memory
- SQL_FREERESULT($result);
+ insertUrlInBlacklist($url);
} // END - foreach
// Output message
// Load main template
loadTemplate('admin_unlock_emails', FALSE, $content);
- } elseif ((isFormSent('lock')) && (!isUrlBlacklistEnabled())) {
+ } elseif ((isFormSent('lock')) && ((!isExtensionActive('blacklist')) || (!isUrlBlacklistEnabled()))) {
// URL blacklist not activated
displayMessage('{--ADMIN_URL_BLACKLIST_DISABLED--}');
} else {
} // END - if
// And shall I check that his URL is not in the black list?
- if (isUrlBlacklisted(postRequestElement('url'))) {
+ if ((isExtensionActive('blacklist')) && (isUrlBlacklisted(postRequestElement('url')))) {
// Create redirect-URL
$data['url'] = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $GLOBALS['blacklist_data'][postRequestElement('url')]['timestamp'];
} // END - if
);
}
-// Checks whether given URL is blacklisted
-function isUrlBlacklisted ($url) {
- // Mark it as not listed by default
- $listed = FALSE;
-
- // Is black-listing enbaled?
- if (!isUrlBlacklistEnabled()) {
- // No, then all URLs are not in this list
- return FALSE;
- } elseif (!isset($GLOBALS['blacklist_data'][$url])) {
- // Check black-list for given URL
- $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS `blist_timestamp` FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
- array($url), __FILE__, __LINE__);
-
- // Is there an entry?
- if (SQL_NUMROWS($result) == 1) {
- // Jupp, we got one listed
- $GLOBALS['blacklist_data'][$url] = SQL_FETCHARRAY($result);
-
- // Mark it as listed
- $listed = TRUE;
- } // END - if
-
- // Free result
- SQL_FREERESULT($result);
- } else {
- // Is found in cache -> black-listed
- $listed = TRUE;
- }
-
- // Return result
- return $listed;
-}
-
// Adds key/value pair to a working SQL string together
function addKeyValueSql ($key, $value) {
// Init SQL
if (isAdmin()) {
// Is admin, has always priority
$data = '[<a href="{%pipe,generateFrametesterUrl=' . $data . '%}" target="_blank">{--ADMIN_TEST_URL--}</a>]';
- } elseif (isUrlBlacklisted($data)) {
+ } elseif ((isExtensionActive('blacklist')) && (isUrlBlacklisted($data))) {
// Yes, so replace it with text
$data = '<em>{--URL_IS_BLACKLISTED--}</em>';
} else {
return $GLOBALS[__FUNCTION__][$userid];
}
-// Wrapper to check if url_blacklist is enabled
-function isUrlBlacklistEnabled () {
- // Is there cache?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // Determine it
- $GLOBALS[__FUNCTION__] = (getConfig('url_blacklist') == 'Y');
- } // END - if
-
- // Return cache
- return $GLOBALS[__FUNCTION__];
-}
-
// Checks whether direct payment is allowed in configuration
function isDirectPaymentEnabled () {
// Is there cache?
`max_tlength` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1000,
`autosend_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
`max_send` TINYINT(3) UNSIGNED NOT NULL DEFAULT 100,
- `url_blacklist` ENUM('Y','N') NOT NULL DEFAULT 'Y',
`auto_purge` TINYINT(3) UNSIGNED NOT NULL DEFAULT 14,
`auto_purge_active` ENUM('Y','N') NOT NULL DEFAULT 'Y',
`last_update` VARCHAR(10) NOT NULL DEFAULT '0',
--- /dev/null
+<div align="center">
+{%form,formMethodPost=modules.php?module=admin&what=config_blacklist%}
+<div class="table dashed">
+ <div class="table_header bottom">
+ <strong>{--ADMIN_CONFIG_BLACKLIST_TITLE--}</strong>
+ </div>
+
+ <fieldset id="config_order_member_fields">
+ <legend>{--ADMIN_CONFIG_BLACKLIST_LEGEND--}</legend>
+
+ <div class="table_row">
+ <label class="admin_label" for="email_blacklist">{--ADMIN_CONFIG_EMAIL_BLACKLIST_ENABLED--}</label>
+ <div align="center">
+ {%template,ConfigurationYesNoSelectionBox=email_blacklist%}
+ </div>
+ </div>
+
+ <div class="table_row">
+ <label class="admin_label" for="url_blacklist">{--ADMIN_CONFIG_URL_BLACKLIST_ENABLED--}</label>
+ <div align="center">
+ {%template,ConfigurationYesNoSelectionBox=url_blacklist%}
+ </div>
+ </div>
+ </fieldset>
+
+ <div class="table_footer top">
+ <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" class="form_submit" name="save_config" value="{--SAVE_SETTINGS--}" />
+ </div>
+</div>
+{%form_close%}
+</div>
+
+<div class="notice">
+ {--ADMIN_CONFIG_BLACKLIST_NOTICE--}
+</div>
</div>
</div>
- <div class="table_row">
- <label class="admin_label" for="url_blacklist">{--ADMIN_CONFIG_URL_BLACKLIST--}</label>
- <div align="center">
- {%template,ConfigurationYesNoSelectionBox=url_blacklist%}
- </div>
- </div>
-
<div class="table_row">
<label class="admin_label" for="repay_deleted_mails">{--ADMIN_REPAY_ON_DELETE_MODE--}</label>
<div align="center">
--- /dev/null
+<div class="para">
+ Sperren Sie Email-Adressen oder URLs mit dieser Erweiterung. Diese
+ Erweiterung sollte in keinem {?mt_word?} fehlen.
+</div>