]> git.mxchange.org Git - mailer.git/commitdiff
Introduceed new extension ext-server_name which has been extracted from
authorRoland Haeder <roland@mxchange.org>
Sat, 2 Apr 2016 10:52:07 +0000 (12:52 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 2 Apr 2016 11:01:21 +0000 (13:01 +0200)
ext-sql_patches. So now you can decided to have this feature or not.

Signed-off-by: Roland Häder <roland@mxchange.org>
15 files changed:
inc/extensions/ext-server_name.php [new file with mode: 0644]
inc/extensions/ext-sql_patches.php
inc/extensions/server_name/.htaccess [new file with mode: 0644]
inc/extensions/server_name/mode-remove.php [new file with mode: 0644]
inc/extensions/server_name/mode-setup.php [new file with mode: 0644]
inc/extensions/sql_patches/mode-remove.php
inc/extensions/sql_patches/mode-update.php
inc/filter/server_name_filter.php [new file with mode: 0644]
inc/filters.php
inc/http-functions.php
inc/language/de.php
inc/language/server_name_de.php [new file with mode: 0644]
inc/libs/task_functions.php
templates/de/html/admin/admin_config_server_name.tpl [new file with mode: 0644]
templates/de/html/ext/ext_server_name.tpl [new file with mode: 0644]

diff --git a/inc/extensions/ext-server_name.php b/inc/extensions/ext-server_name.php
new file mode 100644 (file)
index 0000000..aec4dd2
--- /dev/null
@@ -0,0 +1,100 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 04/02/2016 *
+ * ===================                          Last change: 04/02/2016 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : ext-server_name.php                              *
+ * -------------------------------------------------------------------- *
+ * Short description : Listing/enforcing of correct host name           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auflisten und zwingen des richtigen Hostnamens   *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2016 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
+
+               // Register module
+               //addModuleSql('foo', '{OPEN_LANGUAGE}MODULE_FOO_TITLE{CLOSE_LANGUAGE}','Y','Y','N','N');
+               break;
+
+       case 'remove': // Do stuff when removing extension
+               // SQL commands to run
+               break;
+
+       case 'activate': // Do stuff when admin activates this extension
+               // SQL commands to run
+               //addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `admin_only`='N', `mem_only`='N' WHERE `module`='foo' LIMIT 1");
+               break;
+
+       case 'deactivate': // Do stuff when admin deactivates this extension
+               // SQL commands to run
+               //addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='Y' WHERE `module`='foo' LIMIT 1");
+               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]
+?>
index 0a8bbe524af9d3944a913a4a3299abedde7408ec..767ec3293281e102ad31805e42b281d59c883448 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('1.0.2');
+setThisExtensionVersion('1.0.3');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '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', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4', '0.9.5', '0.9.6', '0.9.7', '0.9.8', '0.9.9', '1.0.0', '1.0.1', '1.0.2'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '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', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2', '0.9.3', '0.9.4', '0.9.5', '0.9.6', '0.9.7', '0.9.8', '0.9.9', '1.0.0', '1.0.1', '1.0.2', '1.0.3'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
diff --git a/inc/extensions/server_name/.htaccess b/inc/extensions/server_name/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/extensions/server_name/mode-remove.php b/inc/extensions/server_name/mode-remove.php
new file mode 100644 (file)
index 0000000..80883a5
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 01/14/2013 *
+ * ===================                          Last change: 01/14/2013 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mode-remove.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Steps for removal of ext-server_name             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Schritte zum Entfernen von ext-server_name       *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2016 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
+
+// Drop tables
+addDropTableSql('server_name_log');
+
+// Delete admin menu entries
+addExtensionSql("DELETE LOW_PRIORITY FROM
+       `{?_MYSQL_PREFIX?}_admin_menu`
+WHERE
+       `what`
+IN (
+       'list_server_name',
+       'config_server_name'
+)");
+
+// Unregister filter
+unregisterFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', TRUE, isExtensionDryRun());
+
+// [EOF]
+?>
diff --git a/inc/extensions/server_name/mode-setup.php b/inc/extensions/server_name/mode-setup.php
new file mode 100644 (file)
index 0000000..e35e77e
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 01/14/2013 *
+ * ===================                          Last change: 01/14/2013 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mode-update.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Steps for updates of ext-server_name             *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Schritte fuer Updates von ext-server_name        *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2016 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
+
+// Add admin menu
+addAdminMenuSql('misc', 'list_server_name', 'Verkehrte Domains auflisten', 'Listet alle als verkehrt erkannten Domains auf.', 4);
+addAdminMenuSql('config', 'config_server_name', 'Server-Namen', 'Einstellungen f&uuml;r das Erzwingen des Hostnamens.', 10);
+
+// Create table
+addCreateTableSql('server_name_log', "
+`server_name_id` BIGINT (20) NOT NULL AUTO_INCREMENT,
+`server_name` VARCHAR (255) NOT NULL DEFAULT 'invalid',
+`server_name_remote_addr` VARCHAR (15) NOT NULL DEFAULT '0.0.0.0',
+`server_name_ua` TINYTEXT NULL DEFAULT NULL,
+`server_name_referrer` TINYTEXT NULL DEFAULT NULL,
+`server_name_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`server_name_counter` BIGINT (20) NOT NULL DEFAULT 1,
+PRIMARY KEY (`server_name_id`)
+", 'Logging of wrong SERVER_NAME');
+
+
+addExtensionAddTableColumnSql('server_name_log', 'server_name_remote_addr', "VARCHAR (15) NOT NULL DEFAULT '0.0.0.0'");
+addExtensionAddTableColumnSql('server_name_log', 'server_name_counter', 'BIGINT (20) NOT NULL DEFAULT 0');
+addExtensionAddTableColumnSql('server_name_log', 'server_name_ua', 'TINYTEXT NULL DEFAULT NULL');
+addExtensionAddTableColumnSql('server_name_log', 'server_name_referrer', 'TINYTEXT NULL DEFAULT NULL');
+
+addConfigAddSql('ap_server_name', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+addConfigAddSql('ap_server_name_since', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
+
+// Register filter
+registerFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', FALSE, TRUE, isExtensionDryRun());
+
+// [EOF]
+?>
index 6817daa4ba8cec5e6f13f5fc0d655f619ca549a6..6920fe5a8e53c04b1396e601209f68434730c165 100644 (file)
@@ -40,7 +40,6 @@ addDropTableSql('admin_menu_las');
 addDropTableSql('admin_menu_las_data');
 addDropTableSql('admin_las_stats');
 addDropTableSql('dns_cache');
-addDropTableSql('server_name_log');
 
 // Delete admin menu entries
 addExtensionSql("DELETE LOW_PRIORITY FROM
@@ -84,7 +83,6 @@ unregisterExtensionPointsData('admin_add_all');
 unregisterFilter(__FILE__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', TRUE, isExtensionDryRun());
 unregisterFilter(__FILE__, __LINE__, 'add_history_entry', 'ADD_HISTORY_ENTRY', TRUE, isExtensionDryRun());
 unregisterFilter(__FILE__, __LINE__, 'init', 'GENERATE_FILE_SECRET_HASH', TRUE, isExtensionDryRun());
-unregisterFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', TRUE, isExtensionDryRun());
 unregisterFilter(__FILE__, __LINE__, 'determine_menu_mode', 'DETERMINE_MENU_MODE_GENERIC', TRUE, isExtensionDryRun());
 unregisterFilter(__FILE__, __LINE__, 'config_userid_exclusion_sql', 'EXCLUDE_DEFAULT_REFID', TRUE, isExtensionDryRun());
 
index 12f05d7202525fb972f07e60e4c18d3b37da1763..afe6ec9a6d8c4a5b00129f0331c301ebed06976c 100644 (file)
@@ -834,44 +834,10 @@ INDEX (`history_last_used` DESC)",
                                break;
 
                        case '0.9.1': // SQL queries for v0.9.1
-                               // Add admin menu
-                               addAdminMenuSql('misc', 'list_server_name', 'Verkehrte Domains auflisten', 'Listet alle als verkehrt erkannten Domains auf.', 4);
-
-                               // Create table
-                               addCreateTableSql('server_name_log', "
-`server_name_id` BIGINT (20) NOT NULL AUTO_INCREMENT,
-`server_name` VARCHAR (255) NOT NULL DEFAULT 'invalid',
-`server_name_remote_addr` VARCHAR (15) NOT NULL DEFAULT '0.0.0.0',
-`server_name_ua` TINYTEXT NULL DEFAULT NULL,
-`server_name_referrer` TINYTEXT NULL DEFAULT NULL,
-`server_name_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-`server_name_counter` BIGINT (20) NOT NULL DEFAULT 1,
-PRIMARY KEY (`server_name_id`)
-", 'Logging of wrong SERVER_NAME');
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Loggen von falschen <strong>SERVER_NAME</strong> Eintr&auml;gen hinzugef&uuml;gt.");
-                               break;
-
                        case '0.9.2': // SQL queries for v0.9.2
-                               addExtensionAddTableColumnSql('server_name_log', 'server_name_remote_addr', "VARCHAR (15) NOT NULL DEFAULT '0.0.0.0'");
-                               addExtensionAddTableColumnSql('server_name_log', 'server_name_counter', 'BIGINT (20) NOT NULL DEFAULT 0');
-                               addExtensionAddTableColumnSql('server_name_log', 'server_name_ua', 'TINYTEXT NULL DEFAULT NULL');
-                               addExtensionAddTableColumnSql('server_name_log', 'server_name_referrer', 'TINYTEXT NULL DEFAULT NULL');
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Sorry, hatte noch IP-Nummer, User-Agent, aufrufende Seite und Z&auml;hler vergessen.");
-                               break;
-
                        case '0.9.3': // SQL queries for v0.9.3
-                               addConfigAddSql('ap_server_name', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
-                               addConfigAddSql('ap_server_name_since', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
-
-                               // Register filter
-                               registerFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', FALSE, TRUE, isExtensionDryRun());
-
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Bereinigung von verkehrten <strong>SERVER_NAME</strong> Eintr&auml;gen hinzugef&uuml;gt.");
+                               setExtensionUpdateNotes("Dieses Update wurde nach ext-server_name verschoben.");
                                break;
 
                        case '0.9.4': // SQL queries for v0.9.4
@@ -951,6 +917,16 @@ PRIMARY KEY (`server_name_id`)
                                setExtensionUpdateNotes("registerExtensionPointsData() klappt bei der ersten Installation nicht, da die Spalte <em>account_provider</em> fehlt.");
                                break;
 
+                       case '1.0.3': // SQL queries for v1.0.3
+                               // Remove admin menu
+                               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='list_server_name' LIMIT 1");
+
+                               // Unregister filter (moved to ext-server_name)
+                               unregisterFilter(__FILE__, __LINE__, 'extra_autopurge', 'SERVER_NAME_EXTRA_AUTOPURGE', TRUE, isExtensionDryRun());
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Dieses Feature wurde nach ext-server_name verschoben, damit dies klappt, muss zuvor der Filter manuell aus der Datenbank gel&ouml;scht werden, da sonst ein Auto-Unregister erfolgt, was auskommentiert ist. Dies gilt nur f&uuml;r bestehende Installationen, nicht neue.");
+                               break;
                } // END - switch
 
 // [EOF]
diff --git a/inc/filter/server_name_filter.php b/inc/filter/server_name_filter.php
new file mode 100644 (file)
index 0000000..882784c
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 04/02/2016 *
+ * ===================                          Last change: 04/02/2016 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : server_name_filter.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext-server_name                      *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Filter fuer ext-server_name                      *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2016 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
+
+// Filter for redirecting on wrong server name (e.g. bad.your-server.tld will be redirected to your-server.tld)
+function FILTER_REDIRECT_WRONG_SERVER_NAME ($filterData) {
+       // Get URL
+       $url = getUrl();
+
+       // Is the configured URL same as SERVER_NAME?
+       if (extractHostnameFromUrl($url) != detectServerName()) {
+               // Log all attempts
+               logWrongServerNameRedirect();
+
+               // Then redirect to configured URL
+               redirectToRequestUri();
+       } // END - if
+
+       // Return filter data
+       return $filterData;
+}
+
+// Filter for purging old SERVER_NAME entries
+function FILTER_SERVER_NAME_EXTRA_AUTOPURGE ($filterData) {
+       // Is purging configured?
+       if ((isApServerNameEnabled()) && (getApServerNameSince() > 0)) {
+               // Then start purging
+               sqlQuery('DELETE LOW_PRIORITY FROM
+       `{?_MYSQL_PREFIX?}_server_name_log`
+WHERE
+       (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`server_name_added`)) >= {?ap_server_name_since?}',
+                       __FILE__, __LINE__);
+
+               // Are some entries deleted?
+               if (sqlAffectedRows() > 0) {
+                       // Okay, then send an email to the admin
+                       sendAdminNotification('{--ADMIN_PURGE_SERVER_NAME_LOG_SUBJECT--}', 'admin_purge_user_server_name_log', sqlAffectedRows());
+               } // END - if
+       } // END - if
+
+       // Return filter data
+       return $filterData;
+}
+
+// [EOF]
+?>
index cff23e8a9f9247dd37a796596a3b68b417021aaa..82fb3196790e1727a76eec7073ce4b0a4b2fc6b1 100644 (file)
@@ -1387,24 +1387,6 @@ function FILTER_HANDLE_REFERRER_BANNER_VIEW ($filterData) {
        redirectToUrl('modules.php?module=index');
 }
 
-// Filter for redirecting on wrong server name (e.g. bad.your-server.tld will be redirected to your-server.tld)
-function FILTER_REDIRECT_WRONG_SERVER_NAME ($filterData) {
-       // Get URL
-       $url = getUrl();
-
-       // Is the configured URL same as SERVER_NAME?
-       if (extractHostnameFromUrl($url) != detectServerName()) {
-               // Log all attempts
-               logWrongServerNameRedirect();
-
-               // Then redirect to configured URL
-               redirectToRequestUri();
-       } // END - if
-
-       // Return filter data
-       return $filterData;
-}
-
 // Filter for adding hidden session id
 function FILTER_ADD_INPUT_HIDDEN_SESSION_ID ($filterData) {
        // Is a spider detected?
@@ -1417,28 +1399,6 @@ function FILTER_ADD_INPUT_HIDDEN_SESSION_ID ($filterData) {
        return $filterData;
 }
 
-// Filter for purging old SERVER_NAME entries
-function FILTER_SERVER_NAME_EXTRA_AUTOPURGE ($filterData) {
-       // Is purging configured?
-       if ((isApServerNameEnabled()) && (getApServerNameSince() > 0)) {
-               // Then start purging
-               sqlQuery('DELETE LOW_PRIORITY FROM
-       `{?_MYSQL_PREFIX?}_server_name_log`
-WHERE
-       (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`server_name_added`)) >= {?ap_server_name_since?}',
-                       __FILE__, __LINE__);
-
-               // Are some entries deleted?
-               if (sqlAffectedRows() > 0) {
-                       // Okay, then send an email to the admin
-                       sendAdminNotification('{--ADMIN_PURGE_SERVER_NAME_LOG_SUBJECT--}', 'admin_purge_user_server_name_log', sqlAffectedRows());
-               } // END - if
-       } // END - if
-
-       // Return filter data
-       return $filterData;
-}
-
 // Filter for detecting menu mode
 function FILTER_DETERMINE_MENU_MODE_GENERIC ($filterData) {
        // "Detect" it
index e82ca2ce198709458fd5bd41d98eb0cac2c7b1ed..cf921efc6be61c48db7bc0a973f77bb822519e9d 100644 (file)
@@ -906,7 +906,7 @@ function getContentType () {
 // Logs wrong SERVER_NAME attempts
 function logWrongServerNameRedirect () {
        // Is ext-sql_patches at least version 0.9.2?
-       if (isExtensionInstalledAndNewer('sql_patches', '0.9.2')) {
+       if (isExtensionInstalled('server_name')) {
                // Is there an entry?
                if (countSumTotalData(detectServerName(), 'server_name_log', 'server_name_id', 'server_name', TRUE, str_replace('%', '{PER}', sprintf(" AND `server_name_remote_addr`='%s' AND `server_name_ua`='%s' AND `server_name_referrer`='%s'", sqlEscapeString(detectRemoteAddr(TRUE)), sqlEscapeString(detectUserAgent(TRUE)), sqlEscapeString(detectReferer(TRUE))))) == 1) {
                        // Update counter, as all are the same
index 9a390d45d1b85d2d64e3dc6447ad6f203d0e461c..47bc860585a052eea5095e95933cf1f661ea2039 100644 (file)
@@ -1379,23 +1379,6 @@ addMessages(array(
        'ADMIN_ACTION_DELETE_HISTORY_SUBMIT' => "Alle Historie-Eintr&auml;ge l&ouml;schen",
        'ADMIN_LIST_HISTORY_NOTICE' => "<strong>Vorsicht:</strong> Mit Klick auf <strong>{--ADMIN_ACTION_DELETE_HISTORY_SUBMIT--}</strong> werden die Historie-Eintr&auml;ge sofort bereinigt, ohne zus&auml;tzliche Sicherheitsabfrage.",
 
-       // Admin - server_name_log - generic
-       'ADMIN_LIST_SERVER_NAME_LOG_TITLE' => "Auflisten aller geloggten SERVER_NAME-Eintr&auml;ge",
-       'ADMIN_LIST_SERVER_NAME_LOG_404' => "Es wurden keine SERVER_NAME-Eintr&auml;ge gefunden.",
-       'ADMIN_ACTION_DELETE_LOG_SUBMIT' => "Gesamtes Logbuch l&ouml;schen",
-       'ADMIN_LIST_LOG_NOTICE' => "<strong>Vorsicht:</strong> Mit Klick auf <strong>{--ADMIN_ACTION_DELETE_LOG_SUBMIT--}</strong> wird das <u>gesamte</u> Logbuch sofort bereinigt, ohne zus&auml;tzliche Sicherheitsabfrage.",
-       'ADMIN_TASK_LIST_SERVER_NAME_LOG'  => "Logbuch f&uuml;r SERVER_NAME-Eintr&auml;ge",
-       'ADMIN_TASK_LIST_SERVER_NAME_LOG_TITLE' => "Es sind geloggte SERVER_NAME-Logbucheintr&auml;ge vorhanden.",
-       'ADMIN_SERVER_NAME' => "Host-Kopfzeile",
-
-       // Admin - server_name_log - config
-       'ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG_LEGEND' => "Bereinigung von SERVER_NAME-Eintr&auml;gen",
-       'ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG' => "Sollen verkehrte SERVER_NAME-Eintr&auml;ge bereinigt werden?",
-       'ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG_TIME' => "Dauer bis SERVER_NAME-Eintr&auml;ge gel&ouml;scht werden:",
-
-       // Admin - server_name_log - subject lines
-       'ADMIN_PURGE_SERVER_NAME_LOG_SUBJECT' => "Es wurden verkehrte SERVER_NAME-Eintr&auml;ge bereinigt",
-
        // Admin - user's points amount
        'ADMIN_LIST_USER_AMOUNTS_TITLE' => "Verteilung des {?POINTS?}-Gesamtvolumens",
        'ADMIN_TOTAL_POINTS' => "Gesamtguthaben",
diff --git a/inc/language/server_name_de.php b/inc/language/server_name_de.php
new file mode 100644 (file)
index 0000000..8eb2f9b
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 04/02/2016 *
+ * ===================                          Last change: 04/02/2016 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : server_name_de.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterst&uuml;tzung                *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2016 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
+
+// Installation/setup
+addMessages(array(
+
+       // Admin - server_name_log - generic
+       'ADMIN_LIST_SERVER_NAME_LOG_TITLE' => "Auflisten aller geloggten SERVER_NAME-Eintr&auml;ge",
+       'ADMIN_LIST_SERVER_NAME_LOG_404' => "Es wurden keine SERVER_NAME-Eintr&auml;ge gefunden.",
+       'ADMIN_ACTION_DELETE_LOG_SUBMIT' => "Gesamtes Logbuch l&ouml;schen",
+       'ADMIN_LIST_LOG_NOTICE' => "<strong>Vorsicht:</strong> Mit Klick auf <strong>{--ADMIN_ACTION_DELETE_LOG_SUBMIT--}</strong> wird das <u>gesamte</u> Logbuch sofort bereinigt, ohne zus&auml;tzliche Sicherheitsabfrage.",
+       'ADMIN_TASK_LIST_SERVER_NAME_LOG'  => "Logbuch f&uuml;r SERVER_NAME-Eintr&auml;ge",
+       'ADMIN_TASK_LIST_SERVER_NAME_LOG_TITLE' => "Es sind geloggte SERVER_NAME-Logbucheintr&auml;ge vorhanden.",
+       'ADMIN_SERVER_NAME' => "Host-Kopfzeile",
+
+       // Admin - server_name_log - config
+       'ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG_LEGEND' => "Bereinigung von SERVER_NAME-Eintr&auml;gen",
+       'ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG' => "Sollen verkehrte SERVER_NAME-Eintr&auml;ge bereinigt werden?",
+       'ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG_TIME' => "Dauer bis SERVER_NAME-Eintr&auml;ge gel&ouml;scht werden:",
+
+       // Admin - server_name_log - subject lines
+       'ADMIN_PURGE_SERVER_NAME_LOG_SUBJECT' => "Es wurden verkehrte SERVER_NAME-Eintr&auml;ge bereinigt",
+));
+
+// [EOF]
+?>
index 95be2052d6e96477d6cfb35ead42d3f9eb2aea1f..9142672cabd8a285e2d8d65ea5387d8c8f73dc2a 100644 (file)
@@ -516,7 +516,7 @@ ORDER BY
                $TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE--}';
        } // END - if
 
-       if (isExtensionInstalledAndNewer('sql_patches', '0.9.2')) {
+       if (isExtensionInstalled('server_name')) {
                // Check for wrong "SERVER_NAME" entries
                addSql('SELECT `server_name_id` FROM `{?_MYSQL_PREFIX?}_server_name_log`');
                $DESCRs[] = '{--ADMIN_TASK_LIST_SERVER_NAME_LOG--}';
diff --git a/templates/de/html/admin/admin_config_server_name.tpl b/templates/de/html/admin/admin_config_server_name.tpl
new file mode 100644 (file)
index 0000000..4f4b21b
--- /dev/null
@@ -0,0 +1,30 @@
+<div align="center">
+{%form,formMethodPost=modules.php?module=admin&amp;what=config_autopurge%}
+<div class="table dashed">
+       <div align="center" class="table_header bottom">
+               {--ADMIN_CONFIG_SERVER_NAME_TITLE--}
+       </div>
+
+       <fieldset id="autopurge_server_name_log_fields">
+               <legend>{--ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG_LEGEND--}</legend>
+
+               <div class="admin_input">
+                       <label for="autopurge_server_name_log">{--ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG--}</label>
+                       <div align="center">{%template,ConfigurationYesNoSelectionBox=ap_server_name%}</div>
+               </div>
+
+               <div class="clear"></div>
+
+               <div class="admin_input">
+                       <label for="ap_un_time">{--ADMIN_CONFIG_AUTOPURGE_SERVER_NAME_LOG_TIME--}</label>
+                       <div align="center">$content[ap_server_name_since]</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>
diff --git a/templates/de/html/ext/ext_server_name.tpl b/templates/de/html/ext/ext_server_name.tpl
new file mode 100644 (file)
index 0000000..993e4b5
--- /dev/null
@@ -0,0 +1,13 @@
+<div class="para">
+       Ung&uum;ltige Hostnamen k&ouml;nnen entstehen, wenn der Hoster
+       &quot;Wildcat-Domains&quot; aktiv hat. Damit sind beliebige Subdomains
+       m&ouml;glich, die dann auf die Hauptdomain weiterleiten, da sie nicht mit
+       den im Server konfigurierten &quot;virtuellen Hosteintr&auml;gen&quot;
+       &uuml;bereinstimmen.
+</div>
+
+<div class="para">
+       Ist diese Erweiterung installiert, wird immer auf die konfigurierte URL
+       weitergeleitet und ung&uuml;ltige Eintr&auml;ge gesammelt und im
+       Adminbereich angezeigt.
+</div>