]> git.mxchange.org Git - mailer.git/commitdiff
Added listing of wrong 'SERVER_NAME' entries
authorquix0r <quix0r@mxchange.org>
Sat, 3 Nov 2012 22:48:58 +0000 (22:48 +0000)
committerquix0r <quix0r@mxchange.org>
Sat, 3 Nov 2012 22:48:58 +0000 (22:48 +0000)
.gitattributes
inc/extensions/ext-sql_patches.php
inc/functions.php
inc/language/de.php
inc/libs/task_functions.php
inc/modules/admin/what-list_server_name.php [new file with mode: 0644]
templates/de/html/admin/admin_list_nickname_history.tpl
templates/de/html/admin/admin_list_server_name_log.tpl [new file with mode: 0644]
templates/de/html/admin/admin_list_server_name_log_row.tpl [new file with mode: 0644]
templates/xml/admin/admin_list_server_name_log.xml [new file with mode: 0644]

index 89203599126efdab57bd8fd1fed7c89ce9b47da4..18496930f196057a4dfae215f8125495537017de 100644 (file)
@@ -599,6 +599,7 @@ inc/modules/admin/what-list_point_accounts.php svneol=native#text/plain
 inc/modules/admin/what-list_primera.php svneol=native#text/plain
 inc/modules/admin/what-list_rallyes.php svneol=native#text/plain
 inc/modules/admin/what-list_refs.php svneol=native#text/plain
+inc/modules/admin/what-list_server_name.php svneol=native#text/plain
 inc/modules/admin/what-list_sponsor.php svneol=native#text/plain
 inc/modules/admin/what-list_sponsor_pay.php svneol=native#text/plain
 inc/modules/admin/what-list_sponsor_pays.php svneol=native#text/plain
@@ -1573,6 +1574,8 @@ templates/de/html/admin/admin_list_refs_level.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_refs_nodata.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_refs_norefs.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_refs_row.tpl svneol=native#text/plain
+templates/de/html/admin/admin_list_server_name_log.tpl svneol=native#text/plain
+templates/de/html/admin/admin_list_server_name_log_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_sponsor.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_sponsor_details.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_sponsor_pay.tpl svneol=native#text/plain
index 30bb078be9fd88f5282fcd51957880fbd128937c..f0d1c40cba95516c204e82a599853850988c8226 100644 (file)
@@ -935,14 +935,17 @@ 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_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
 `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');
index a860162bd5389cab6aba31487b5e66ce6b4455e7..f65fa16f4bb81e5c399c412460b3b0ce0eb28939 100644 (file)
@@ -331,7 +331,7 @@ function translateMenuVisibleLocked ($content, $prefix = '') {
 // Generates an URL for the dereferer
 function generateDereferrerUrl ($url) {
        // Don't de-refer our own links!
-       if (substr($url, 0, strlen(getUrl())) != getUrl()) {
+       if ((!empty($url)) && (substr($url, 0, strlen(getUrl())) != getUrl())) {
                // Encode URL
                $encodedUrl = encodeString(compileUriCode($url));
 
index 6e8b5e7a9e23ef4734c25f8ce49e3b18164ac99c..d0ce61df67234e7adbbcc34aa3b3fb9e35f160f2 100644 (file)
@@ -1362,11 +1362,18 @@ addMessages(array(
 
        // Admin - history entries - generic
        'ADMIN_HISTORY_VALUE' => "Historie-Eintrag",
-       'ADMIN_HISTORY_ENTRY_ADDED' => "Eintrag hinzugef&uuml;gt",
        'ADMIN_HISTORY_ENTRY_LAST_USED' => "Zuletzt verwendet",
        '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_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 - user's points amount
        'ADMIN_LIST_USER_AMOUNTS_TITLE' => "Verteilung des {?POINTS?}-Gesamtvolumens",
        'ADMIN_TOTAL_POINTS' => "Gesamtguthaben",
index a46d8323a9e2df5bc44605bf7a77559165f1c889..f0f80826552182feb1a862e7081d590f7ba60bab 100644 (file)
@@ -520,6 +520,14 @@ ORDER BY
                $TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE--}';
        } // END - if
 
+       if (isExtensionInstalledAndNewer('sql_patches', '0.9.2')) {
+               // Check for accounts without referral
+               addSql('SELECT `server_name_id` FROM `{?_MYSQL_PREFIX?}_server_name_log`');
+               $DESCRs[] = '{--ADMIN_TASK_LIST_SERVER_NAME_LOG--}';
+               $TITLEs[] = '{--ADMIN_TASK_LIST_SERVER_NAME_LOG_TITLE--}';
+               $WHATs[]  = 'list_server_name';
+       } // END - if
+
        // Generate extra overview rows
        $EXTRAS .= createExtraTaskRows($WHATs, $DESCRs, $TITLEs);
 
diff --git a/inc/modules/admin/what-list_server_name.php b/inc/modules/admin/what-list_server_name.php
new file mode 100644 (file)
index 0000000..eee0fa4
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 11/04/2012 *
+ * ===================                          Last change: 11/04/2012 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_server_name.php                        *
+ * -------------------------------------------------------------------- *
+ * Short description : List wrong SERVER_NAME entries                   *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auflisten verkehrter SERVER_NAME-Eintraege       *
+ * -------------------------------------------------------------------- *
+ * $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
+
+// Display only title when no form was submitted
+addYouAreHereLink('admin', __FILE__);
+
+// Delete entries?
+if (isFormSent('do_delete')) {
+       // Remove entries from database
+       doGenericXmlTemplateCallback('admin_delete_do_server_name_log');
+} // END - if
+
+// List all entries per user
+doGenericXmlTemplateCallback('admin_list_server_name_log');
+
+// [EOF]
+?>
index ad0eff86d5946d9b276b27e994e87cbe99fa92ba..552bed5c471ff645c23312e0066fb3a4b0701f18 100644 (file)
@@ -10,7 +10,7 @@
        <td class="header_column bottom right" align="center"><strong>{--ID_SELECT--}</strong></td>
        <td class="header_column bottom right" align="center"><strong>{--_USERID--}</strong></td>
        <td class="header_column bottom right" align="center"><strong>{--ADMIN_HISTORY_VALUE--}</strong></td>
-       <td class="header_column bottom right" align="center"><strong>{--ADMIN_HISTORY_ENTRY_ADDED--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--ENTRY_ADDED--}</strong></td>
        <td class="header_column bottom" align="center"><strong>{--ADMIN_HISTORY_ENTRY_LAST_USED--}</strong></td>
 </tr>
 $content
diff --git a/templates/de/html/admin/admin_list_server_name_log.tpl b/templates/de/html/admin/admin_list_server_name_log.tpl
new file mode 100644 (file)
index 0000000..23c784a
--- /dev/null
@@ -0,0 +1,30 @@
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_server_name%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+<tr>
+       <td align="center" colspan="6" class="table_header">
+               <strong>{--ADMIN_LIST_SERVER_NAME_LOG_TITLE--}</strong>
+       </td>
+</tr>
+<tr>
+       <td class="header_column bottom right" align="center"><strong>{--ID_SELECT--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--ADMIN_SERVER_NAME--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--REMOTE_IP--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--USER_AGENT--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--REFERRER_URL--}</strong></td>
+       <td class="header_column bottom" align="center"><strong>{--ENTRY_ADDED--}</strong></td>
+</tr>
+$content
+<tr>
+       <td class="table_footer" colspan="6">
+               <input type="hidden" name="server_name_id[0]" value="1" />
+               <input type="submit" class="form_delete" name="do_delete" value="{--ADMIN_ACTION_DELETE_LOG_SUBMIT--}" />
+       </td>
+</tr>
+</table>
+</form>
+</div>
+
+<div class="notice">
+       {--ADMIN_LIST_LOG_NOTICE--}
+</div>
diff --git a/templates/de/html/admin/admin_list_server_name_log_row.tpl b/templates/de/html/admin/admin_list_server_name_log_row.tpl
new file mode 100644 (file)
index 0000000..31f4171
--- /dev/null
@@ -0,0 +1,20 @@
+<tr>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               <strong>$content[server_name_id]</strong>
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               $content[server_name]
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               $content[server_name_remote_addr]
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               {%pipe,fixEmptyContentToDashes=$content[server_name_ua]%}
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               {%pipe,generateDereferrerUrl,fixEmptyContentToDashes=$content[server_name_referrer]%}
+       </td>
+       <td align="center" class="bottom {%template,ColorSwitch%}">
+               $content[server_name_added]
+       </td>
+</tr>
diff --git a/templates/xml/admin/admin_list_server_name_log.xml b/templates/xml/admin/admin_list_server_name_log.xml
new file mode 100644 (file)
index 0000000..e8f9077
--- /dev/null
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for listing nickname-change history entries.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2011 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          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
+//-->
+<admin-list-data>
+       <!--
+       Call-back function, the extracted data from this XML will then be re-read
+       from that function. The most common function this XML uses is
+       doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
+       //-->
+       <callback-function type="string" value="doGenericListEntries" />
+       <!--
+       Now we need information which template should be loaded and which functions
+       shall be called back. So lets start with the main list template. This mostly
+       requires no call-back function.
+       //-->
+       <list-template type="string" value="admin_list_server_name_log" />
+       <!--
+       The template for all rows, mostly this name has a '_row' suffix and again,
+       no call-back function is usually required.
+       //-->
+       <list-row-template type="string" value="admin_list_server_name_log_row" />
+       <!--
+       Message id to display if no entry could be found
+       //-->
+       <no-entry-found-message type="string" value="ADMIN_LIST_SERVER_NAME_LOG_404" />
+       <!--
+       The table(s) we shall grab the data from, all as list.
+       //-->
+       <data-tables>
+               <!--
+               A single table entry, with alias and without the configurable
+               _MYSQL_PREFIX. You can specify the table's name or alias later on.
+               //-->
+               <data-table type="string" alias="" value="server_name_log" />
+               <!--
+               Columns to perform the SELECT statement on, with alias and name plus which table.
+               //-->
+               <select-data-from-list>
+                       <!--
+                       A single entry with table name (can be left empty), value (must
+                       always be set), alias (again can be left empty) and SQL function
+                       (can also be left empty) which shall be applied on the column.
+                       //-->
+                       <select-data-from-list-entry type="string" table="" value="server_name_id" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="server_name" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="server_name_remote_addr" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="server_name_ua" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="server_name_referrer" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="server_name_added" alias="server_name_added" function="UNIX_TIMESTAMP" />
+               </select-data-from-list>
+               <!--
+               And the column list to perform the WHERE statement on.
+               //-->
+               <where-select-from-list>
+               </where-select-from-list>
+               <!--
+               Columns to perform the ORDER BY statement (GROUP BY is not yet supported)
+               //-->
+               <order-by-list>
+                       <!--
+                       A single entry to perform the ORDER BY statement on, see above WHERE entry for details.
+                       //-->
+                       <order-by-list-entry type="string" table="" order="server_name_added" value="DESC" />
+               </order-by-list>
+       </data-tables>
+       <!--
+       List all column names from the 'select-data-from-list' node here, but now
+       with call-back informations. The list must only contain those entries where
+       a call-back function shall be called for.
+       //-->
+       <column-callback-list>
+               <!--
+               Another column, now we need a second parameter here because
+               generateDateTime() expects two parameters (first is always the data
+               from column).
+               //-->
+               <column-callback-list-entry>
+                       <!--
+                       The actual data, again.
+                       //-->
+                       <column-callback-data type="string" value="server_name_added" callback="generateDateTime" />
+                       <!--
+                       More parameters, remember that the first parameter is always given
+                       and that it is the data from column.
+                       //-->
+                       <callback-extra-parameter-list>
+                               <!--
+                               A single parameter, 'type' can be one of 'float', 'int',
+                               'bool', 'string'. 'array' is not yet supported.
+                               //-->
+                               <callback-extra-parameter-list-entry type="int" column="server_name_added" value="2" />
+                       </callback-extra-parameter-list>
+               </column-callback-list-entry>
+       </column-callback-list>
+</admin-list-data>