From 2e263e74cd6edb4041a2bd082de4b3cf3606b8e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 3 Nov 2012 22:48:58 +0000 Subject: [PATCH] Added listing of wrong 'SERVER_NAME' entries --- .gitattributes | 3 + inc/extensions/ext-sql_patches.php | 5 +- inc/functions.php | 2 +- inc/language/de.php | 9 +- inc/libs/task_functions.php | 8 ++ inc/modules/admin/what-list_server_name.php | 56 +++++++++ .../admin/admin_list_nickname_history.tpl | 2 +- .../html/admin/admin_list_server_name_log.tpl | 30 +++++ .../admin/admin_list_server_name_log_row.tpl | 20 +++ .../xml/admin/admin_list_server_name_log.xml | 118 ++++++++++++++++++ 10 files changed, 249 insertions(+), 4 deletions(-) create mode 100644 inc/modules/admin/what-list_server_name.php create mode 100644 templates/de/html/admin/admin_list_server_name_log.tpl create mode 100644 templates/de/html/admin/admin_list_server_name_log_row.tpl create mode 100644 templates/xml/admin/admin_list_server_name_log.xml diff --git a/.gitattributes b/.gitattributes index 8920359912..18496930f1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 30bb078be9..f0d1c40cba 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -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'); diff --git a/inc/functions.php b/inc/functions.php index a860162bd5..f65fa16f4b 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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)); diff --git a/inc/language/de.php b/inc/language/de.php index 6e8b5e7a9e..d0ce61df67 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1362,11 +1362,18 @@ addMessages(array( // Admin - history entries - generic 'ADMIN_HISTORY_VALUE' => "Historie-Eintrag", - 'ADMIN_HISTORY_ENTRY_ADDED' => "Eintrag hinzugefügt", 'ADMIN_HISTORY_ENTRY_LAST_USED' => "Zuletzt verwendet", 'ADMIN_ACTION_DELETE_HISTORY_SUBMIT' => "Alle Historie-Einträge löschen", 'ADMIN_LIST_HISTORY_NOTICE' => "Vorsicht: Mit Klick auf {--ADMIN_ACTION_DELETE_HISTORY_SUBMIT--} werden die Historie-Einträge sofort bereinigt, ohne zusätzliche Sicherheitsabfrage.", + // Admin - server_name_log - generic + 'ADMIN_LIST_SERVER_NAME_LOG_TITLE' => "Auflisten aller geloggten SERVER_NAME-Einträge", + 'ADMIN_ACTION_DELETE_LOG_SUBMIT' => "Gesamtes Logbuch löschen", + 'ADMIN_LIST_LOG_NOTICE' => "Vorsicht: Mit Klick auf {--ADMIN_ACTION_DELETE_LOG_SUBMIT--} wird das gesamte Logbuch sofort bereinigt, ohne zusätzliche Sicherheitsabfrage.", + 'ADMIN_TASK_LIST_SERVER_NAME_LOG' => "Logbuch für SERVER_NAME-Einträge", + 'ADMIN_TASK_LIST_SERVER_NAME_LOG_TITLE' => "Es sind geloggte SERVER_NAME-Logbucheinträ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", diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index a46d8323a9..f0f8082655 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -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 index 0000000000..eee0fa40c3 --- /dev/null +++ b/inc/modules/admin/what-list_server_name.php @@ -0,0 +1,56 @@ + diff --git a/templates/de/html/admin/admin_list_nickname_history.tpl b/templates/de/html/admin/admin_list_nickname_history.tpl index ad0eff86d5..552bed5c47 100644 --- a/templates/de/html/admin/admin_list_nickname_history.tpl +++ b/templates/de/html/admin/admin_list_nickname_history.tpl @@ -10,7 +10,7 @@ {--ID_SELECT--} {--_USERID--} {--ADMIN_HISTORY_VALUE--} - {--ADMIN_HISTORY_ENTRY_ADDED--} + {--ENTRY_ADDED--} {--ADMIN_HISTORY_ENTRY_LAST_USED--} $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 index 0000000000..23c784a039 --- /dev/null +++ b/templates/de/html/admin/admin_list_server_name_log.tpl @@ -0,0 +1,30 @@ +
+
+ + + + + + + + + + + + +$content + + + +
+ {--ADMIN_LIST_SERVER_NAME_LOG_TITLE--} +
{--ID_SELECT--}{--ADMIN_SERVER_NAME--}{--REMOTE_IP--}{--USER_AGENT--}{--REFERRER_URL--}{--ENTRY_ADDED--}
+
+
+ +
+ {--ADMIN_LIST_LOG_NOTICE--} +
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 index 0000000000..31f41718cb --- /dev/null +++ b/templates/de/html/admin/admin_list_server_name_log_row.tpl @@ -0,0 +1,20 @@ + + + $content[server_name_id] + + + $content[server_name] + + + $content[server_name_remote_addr] + + + {%pipe,fixEmptyContentToDashes=$content[server_name_ua]%} + + + {%pipe,generateDereferrerUrl,fixEmptyContentToDashes=$content[server_name_referrer]%} + + + $content[server_name_added] + + 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 index 0000000000..e8f907752e --- /dev/null +++ b/templates/xml/admin/admin_list_server_name_log.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.5