From 96d8f54d3fee1d51c38dd6b79c28215f7f5c83ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 8 Oct 2012 21:32:52 +0000 Subject: [PATCH] Mailer continued, sub-id tracking continued: - Introduced function isUrlBlacklisted() (not everywhere used!) - Templates for sub-id statistics added - Introduced function anonymizeSensitiveData() which tries to "anonymized" some data (admins always see all for now) - Some language ids renamed - Other minor fixes - TODOs.txt updated --- .gitattributes | 2 + DOCS/TODOs.txt | 6 +- inc/extensions/ext-bank.php | 8 +- inc/extensions/ext-coupon.php | 2 +- inc/extensions/ext-debug.php | 8 +- inc/extensions/ext-newsletter.php | 10 +- inc/extensions/ext-signup.php | 4 +- inc/extensions/ext-sponsor.php | 2 +- inc/extensions/ext-user.php | 22 +++- inc/extensions/ext-wernis.php | 2 +- inc/filter/user_filter.php | 54 ++++++++ inc/functions.php | 14 +- inc/language/de.php | 10 +- inc/language/html_mail_de.php | 2 +- inc/language/user_de.php | 9 +- inc/libs/html_mail_functions.php | 2 +- inc/libs/newsletter_functions.php | 2 +- inc/modules/frametester.php | 4 +- inc/modules/member/subid-stats.php | 3 + inc/modules/member/what-order.php | 18 +-- inc/modules/member/what-payout.php | 2 +- inc/mysql-manager.php | 34 +++++ inc/template-functions.php | 36 ++++++ inc/wrapper-functions.php | 2 +- ref.php | 9 +- .../html/admin/admin_delete_email_bonus.tpl | 2 +- .../html/admin/admin_delete_email_normal.tpl | 2 +- .../html/admin/admin_delete_email_notify.tpl | 2 +- .../de/html/admin/admin_edit_theme_row.tpl | 2 +- .../de/html/admin/admin_import_theme_row.tpl | 2 +- .../html/admin/admin_list_sponsor_details.tpl | 2 +- templates/de/html/mailid/mailid_frames.tpl | 2 +- templates/de/html/member/member_add_subid.tpl | 4 +- .../html/member/member_list_subid_stats.tpl | 23 ++++ .../member/member_list_subid_stats_row.tpl | 20 +++ .../html/member/member_list_surfbar_row.tpl | 2 +- templates/de/html/member/member_pool_row.tpl | 2 +- templates/de/html/member/member_stats_row.tpl | 2 +- .../de/html/member/member_themes_row.tpl | 2 +- .../xml/member/member_list_subid_stats.xml | 122 ++++++++++++++++++ 40 files changed, 390 insertions(+), 68 deletions(-) create mode 100644 templates/de/html/member/member_list_subid_stats.tpl create mode 100644 templates/de/html/member/member_list_subid_stats_row.tpl create mode 100644 templates/xml/member/member_list_subid_stats.xml diff --git a/.gitattributes b/.gitattributes index a1cfd2f845..2d9eb52fc5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1967,6 +1967,8 @@ templates/de/html/member/member_list_referral_level.tpl svneol=native#text/plain templates/de/html/member/member_list_referral_row.tpl svneol=native#text/plain templates/de/html/member/member_list_reflinks.tpl svneol=native#text/plain templates/de/html/member/member_list_reflinks_row.tpl svneol=native#text/plain +templates/de/html/member/member_list_subid_stats.tpl svneol=native#text/plain +templates/de/html/member/member_list_subid_stats_row.tpl svneol=native#text/plain templates/de/html/member/member_list_surfbar.tpl svneol=native#text/plain templates/de/html/member/member_list_surfbar_form.tpl svneol=native#text/plain templates/de/html/member/member_list_surfbar_row.tpl svneol=native#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index f2be12a997..1b1007647e 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -60,8 +60,8 @@ ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter ./inc/header.php:66:// @TODO Find a way to not use direct module comparison ./inc/install-functions.php:91: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestElement('omode'), 0); -./inc/language/de.php:1112: // @TODO Rewrite these two constants -./inc/language/de.php:1128: // @TODO Rewrite these three constants +./inc/language/de.php:1120: // @TODO Rewrite these two constants +./inc/language/de.php:1136: // @TODO Rewrite these three constants ./inc/language/de.php:749:// @TODO Are these constants longer used? ./inc/language-functions.php:255: // @TODO These are all valid languages, again hard-coded ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function. @@ -157,7 +157,7 @@ ./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_USERID_TIMEOUT', createFancyTime(getBegUseridTimeout())); ./inc/modules/member/what-logout.php:17: * @TODO Rewrite the code to a filter * ./inc/modules/member/what-logout.php:52: // @TODO Move this in a filter, e.g. member_logout -./inc/modules/member/what-order.php:471: // @TODO Rewrite this to a filter +./inc/modules/member/what-order.php:459: // @TODO Rewrite this to a filter ./inc/modules/member/what-order.php:84: // @TODO Rewrite this to SQL_FETCHARRAY() ./inc/modules/member/what-payout.php:194: // @TODO Rewrite this to a filter ./inc/modules/member/what-points.php:61:// @TODO Should we rewrite this to a filter? diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index ee1d728798..1dd49d1585 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -58,7 +58,7 @@ switch (getExtensionMode()) { `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `account_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `account_locked` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`locked_reason` TINYTEXT, +`locked_reason` TINYTEXT NOT NULL, `status` ENUM('NEW','ACTIVE','LOCKED') NOT NULL DEFAULT 'NEW', `account_balance` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `output_mode` ENUM('LOGIN','EMAIL','DISABLED'), @@ -69,7 +69,7 @@ switch (getExtensionMode()) { `month_transfered` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `last_tan` VARCHAR(5) NOT NULL DEFAULT '00000', `last_tan_stamp` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`last_tan_purpose` TINYTEXT, +`last_tan_purpose` TINYTEXT NOT NULL, `account_type` ENUM('CHECK','SAVING') NOT NULL DEFAULT 'CHECK', `overdraft_credit` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, PRIMARY KEY (`id`), @@ -88,7 +88,7 @@ INDEX (`last_tan_stamp`)", `points_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `day_bookkeeping` CHAR(4) NOT NULL DEFAULT '0000', `day_available` CHAR(4) NOT NULL DEFAULT '0000', -`transfer_purpose` TINYTEXT, +`transfer_purpose` TINYTEXT NOT NULL, PRIMARY KEY (`id`), INDEX (`to_account_id`,`from_account_id`), INDEX (`day_bookkeeping`,`day_available`)", @@ -98,7 +98,7 @@ INDEX (`day_bookkeeping`,`day_available`)", addCreateTableSql('bank_packages', " `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) NOT NULL DEFAULT '', -`description` TINYTEXT, +`description` TINYTEXT NOT NULL, `account_fee` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `free_transfers` INT(7) UNSIGNED NOT NULL DEFAULT 0, `transfer_fee` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, diff --git a/inc/extensions/ext-coupon.php b/inc/extensions/ext-coupon.php index 676a9da2f3..c14e216512 100644 --- a/inc/extensions/ext-coupon.php +++ b/inc/extensions/ext-coupon.php @@ -64,7 +64,7 @@ switch (getExtensionMode()) { `total_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `total_cashed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, -`coupon_description` TEXT, +`coupon_description` TEXT NOT NULL, PRIMARY KEY (`id`)", 'Created coupons'); diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 2775de07b7..dd9d766aee 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -62,8 +62,8 @@ switch (getExtensionMode()) { `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', `file` VARCHAR(255) NOT NULL DEFAULT '', `line` MEDIUMINT NOT NOT NULL DEFAULT 0, -`message` LONGTEXT, -`comment` TINYTEXT, +`message` LONGTEXT NOT NULL, +`comment` TINYTEXT NOT NULL, `status` ENUM('NEW','PENDING','ACCEPTED','FIXED','INVALID','DUBLICATE','SPAM') NOT NULL DEFAULT 'NEW', `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), @@ -76,7 +76,7 @@ INDEX (`sender_id`)", `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', -`raw_data` LONGTEXT, +`raw_data` LONGTEXT NOT NULL, `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), INDEX (`client_id`)", @@ -93,7 +93,7 @@ INDEX (`client_id`)", `status` ENUM('ACTIVE','NEW','PENDING','LOCKED','DELETED','SPAM') NOT NULL DEFAULT 'PENDING', `type` ENUM ('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT', `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -`lock_spam_reason` TINYTEXT, +`lock_spam_reason` TINYTEXT NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX (`key`), UNIQUE INDEX (`url`)", diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index ed44424958..d027e01878 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -143,8 +143,8 @@ switch (getExtensionMode()) { addCreateTableSql('newsletter_data', " `nl_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `nl_subject` VARCHAR(255) NOT NULL DEFAULT '{OPEN_CONFIG}nl_default_subject{CLOSE_CONFIG}', -`nl_header_text` MEDIUMTEXT, -`nl_footer_text` MEDIUMTEXT, +`nl_header_text` MEDIUMTEXT NOT NULL, +`nl_footer_text` MEDIUMTEXT NOT NULL, `nl_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `nl_send` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', `nl_ready` ENUM('Y','N') NOT NULL DEFAULT 'N', @@ -163,7 +163,7 @@ PRIMARY KEY (`nl_id`)", `nl_topic_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `nl_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `nl_topic_title` VARCHAR(255) NOT NULL DEFAULT '', -`nl_topic_text` MEDIUMTEXT, +`nl_topic_text` MEDIUMTEXT NOT NULL, `nl_topic_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`nl_topic_id`), INDEX `newsletter_id` (`nl_id`)", @@ -187,8 +187,8 @@ INDEX `topic` (`nl_topic_id`)", addConfigAddSql('nl_expire', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7)); addConfigAddSql('nl_archive_expire', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 14)); addConfigAddSql('nl_default_subject', "VARCHAR(255) NOT NULL DEFAULT 'Newsletter vom {OPEN_CONFIG}CURRENT_DATE{CLOSE_CONFIG}'"); - addConfigAddSql('nl_default_header', 'MEDIUMTEXT'); - addConfigAddSql('nl_default_footer', 'MEDIUMTEXT'); + addConfigAddSql('nl_default_header', 'MEDIUMTEXT NOT NULL,'); + addConfigAddSql('nl_default_footer', 'MEDIUMTEXT NOT NULL,'); addConfigAddSql('nl_archive', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); // Admin menu diff --git a/inc/extensions/ext-signup.php b/inc/extensions/ext-signup.php index 211697fd60..9595313c58 100644 --- a/inc/extensions/ext-signup.php +++ b/inc/extensions/ext-signup.php @@ -62,8 +62,8 @@ switch (getExtensionMode()) { `signup_id` BIGINT (20) UNSIGNED NOT NULL AUTO_INCREMENT, `signup_sponsor_id` BIGINT (20) UNSIGNED NOT NULL, `signup_title` VARCHAR (255) NOT NULL DEFAULT '', -`signup_text` LONGTEXT, -`signup_welcome_text` TINYTEXT, +`signup_text` LONGTEXT NOT NULL, +`signup_welcome_text` TINYTEXT NOT NULL, `signup_question` VARCHAR (255) NOT NULL DEFAULT '', `signup_url` VARCHAR (255) NOT NULL DEFAULT '', `signup_banner` VARCHAR (255) NOT NULL DEFAULT '', diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 49305ebdfb..c999cec04d 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -216,7 +216,7 @@ INDEX (`sponsor_id`)", `campaign_expired` ENUM('Y','N') NOT NULL DEFAULT 'N', `campaign_locked` ENUM('Y','N') NOT NULL DEFAULT 'Y', `campaign_ended` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', -`locked_reason` TINYTEXT, +`locked_reason` TINYTEXT NOT NULL, `locked_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', `status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING', PRIMARY KEY (`id`), diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 9e1ed4d56f..ed6a26f2d0 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -41,10 +41,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.5.3'); +setThisExtensionVersion('0.5.4'); // 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')); +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')); // Keep this extension always active! setExtensionAlwaysActive('Y'); @@ -196,6 +196,8 @@ INDEX (`stats_type`)", unregisterFilter(__FILE__, __LINE__, 'convert_user_data_columns', 'ADD_USER_DATA_CONVERT_SQL_COLUMNS', true, isExtensionDryRun()); unregisterFilter(__FILE__, __LINE__, 'post_refid_validation', 'HANDLE_USER_SUBID', true, isExtensionDryRun()); unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', true, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', true, isExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension @@ -372,7 +374,7 @@ INDEX (`stats_type`)", `joined` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `last_online` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `del_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -`del_reason` TINYTEXT, +`del_reason` TINYTEXT NOT NULL, PRIMARY KEY (`id`), INDEX (`userid`)", 'List of deleted users'); @@ -605,7 +607,7 @@ INDEX (`subid`)", `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `subid` VARCHAR(255) NOT NULL DEFAULT '', -`referral_url` TINYTEXT, +`referral_url` TINYTEXT NOT NULL, `remote_address` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0', `entry_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), @@ -623,6 +625,18 @@ INDEX (`subid`)", // Update notes (these will be set as task text!) setExtensionUpdateNotes("Filter, Datenbanktabelle und Menüpunkte für SubId-Tracking hinzugefügt."); break; + + case '0.5.4': // SQL queries for v0.5.4 + // Register filter + registerFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', false, true, isExtensionDryRun()); + registerFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', false, true, isExtensionDryRun()); + + // Add user agent + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_subid_log` ADD `user_agent` TINYTEXT NOT NULL AFTER `remote_address`'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Weitere Filter für Referral-Counter und Sub-Id hinzugefügt."); + break; } // END - switch break; diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index bfb0ac521b..aaa7c505b8 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -57,7 +57,7 @@ switch (getExtensionMode()) { `wernis_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `wernis_timestamp` VARCHAR(10) NOT NULL DEFAULT 0, `wernis_type` ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED', -`wernis_api_message` TINYTEXT, +`wernis_api_message` TINYTEXT NOT NULL, `wernis_api_status` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`id`), INDEX (`userid`)", diff --git a/inc/filter/user_filter.php b/inc/filter/user_filter.php index 1040aaee4e..de3ce0efc2 100644 --- a/inc/filter/user_filter.php +++ b/inc/filter/user_filter.php @@ -173,5 +173,59 @@ function FILTER_SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS ($filterData) { return $filterData; } +// Generic filter for updating referral counter of currently detected referral id +function FILTER_GENERIC_UPDATE_USER_REFERRAL ($filterData) { + // Make sure the referral id is detected + assert(isReferralIdValid()); + + // Update ref counter, determineReferralId() must already be called before this filter is executed + SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`={%pipe,getReferralId%} LIMIT 1', __FUNCTION__, __LINE__); + + // Return filter data + return $filterData; +} + +// Filter for updating sub id records +function FILTER_UPDATE_USER_SUBID ($filterData) { + // Make sure the referral id is detected + assert(isReferralIdValid()); + + // Get sub id and secure it + $subId = SQL_ESCAPE(getRequestElement('subid')); + + // Is the sub id available and registered with referral id? + if (countSumTotalData(getReferralId(), 'user_subids', 'id', 'userid', true, sprintf(" AND `subid`='%s'", $subId)) == 1) { + // Sub id is assigned to referral id, so add a record + SQL_QUERY_ESC("INSERT INTO + `{?_MYSQL_PREFIX?}_subid_log` +( + `refid`, + `subid`, + `referral_url`, + `remote_address`, + `user_agent` +) VALUES ( + {%%pipe,getReferralId%%}, + '%s', + '{%%pipe,detectReferer%%}', + '{%%pipe,detectRemoteAddr%%}', + '{%%pipe,detectUserAgent%%}' +)", + array( + // @NOTE: SQL_QUERY_ESC() already escape it, don't use $subId here + getRequestElement('subid') + ), __FUNCTION__, __LINE__); + + // Add insert id for other filters + $filterData['insert_id'] = SQL_INSERTID(); + + // Register sub id in filter + setSession('subid', $subId); + } // END - if + + // Return filter data + return $filterData; +} + // [EOF] ?> diff --git a/inc/functions.php b/inc/functions.php index 806bf7da52..5fb35afd9f 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -330,7 +330,7 @@ function translateMenuVisibleLocked ($content, $prefix = '') { } // Generates an URL for the dereferer -function generateDerefererUrl ($url) { +function generateDereferrerUrl ($url) { // Don't de-refer our own links! if (substr($url, 0, strlen(getUrl())) != getUrl()) { // Encode URL @@ -2396,6 +2396,18 @@ function memberListBuilder ($listType, $tableName, $columns, $filterFunctions, $ doGenericListBuilder('member', $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId); } +// Checks whether given address is IPv4 +function isIp4AddressValid ($address) { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__][$address])) { + // Determine it ... + $GLOBALS[__FUNCTION__][$address] = preg_match('/((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9]))/', $address); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__][$address]; +} + // ---------------------------------------------------------------------------- // "Translatation" functions for points_data table // ---------------------------------------------------------------------------- diff --git a/inc/language/de.php b/inc/language/de.php index 904dff77d4..d8e9c944bc 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -437,7 +437,7 @@ addMessages(array( 'USER_404' => "Mitgliedsdaten nicht gefunden! Sind Sie noch angemeldet?", 'ADMIN_UNCONFIRMED_ACCOUNTS' => "Hier alle Accounts, deren Email-Adresse nicht bestätigt ist", '_USERID' => "Mitglied-Id", - 'REMOTE_IP' => "IP-Nummer", + 'REFERRAL_USERID' => "Werber-Id", 'ACCOUNT_STATUS' => "Status", 'ACCOUNT_STATUS_UNKNOWN' => "Unbekannter Status %s erkannt.", @@ -952,7 +952,13 @@ addMessages(array( 'APPLICATION_DIED_TITLE' => "Bug im Script erkannt.", 'ADMIN_CONTACT_LINK_TITLE' => "Kontakt zum Administrator", 'ADMIN_MAIL_NOTHING_DELETED' => "Die Mail mit der Id %s weisst keine Mitglieder auf.", + 'ENTRY_ADDED' => "Eintrag hinzugefügt", + + 'REMOTE_IP' => "IP-Nummer", + 'REFERRER_URL' => "Aufrufende Seite", + 'USER_AGENT' => "Browserbezeichnung", + // Admin - password reset - titles 'ADMIN_RESET_PASSWORD_SEND_LINK_TITLE' => "1/4: Administratorkennwort zurücksetzen", 'ADMIN_VALIDATE_HASH_TITLE' => "2/4: Validierung Iher Logindaten", 'ADMIN_RESET_PASSWORD_TITLE' => "3/4: Neues Passwort eingeben", @@ -1052,6 +1058,8 @@ addMessages(array( 'ADMIN_CONFIG_ADMIN_MENU_NOTICE' => "Das Menüsystem mit "logischen Bereichen" ist noch nicht fertig und führt zu Fehlern. Bitte dieses nur im Template aktivieren, wenn Sie daran mitprogrammieren wollen.", 'UNKNOWN_ERROR_CODE' => "Unbekannter Fehlercode 0x{%%pipe,getHexErrorCode=%s%%} erkannt.", 'LOADER_SECURITY_HASH_MISMATCH' => "Der Sicherheitshash für den Dereferrer stimmt nicht mit der URL überein.", + 'URL_IS_BLACKLISTED' => "URL ist gesperrt.", + 'DATA_IS_HIDDEN' => "Daten sind verdeckt.", // Time units 'TIME_UNIT' => "Zeiteinheit", diff --git a/inc/language/html_mail_de.php b/inc/language/html_mail_de.php index a3fe913a11..ac42549e7b 100644 --- a/inc/language/html_mail_de.php +++ b/inc/language/html_mail_de.php @@ -42,7 +42,7 @@ if (!defined('__SECURITY')) { // Language definitions addMessages(array( - 'ADMIN_HTML_DOWNLOAD_CLASS' => "Bitte laden Sie sich die Klasse PHPMailer herunter, um diese Funktion nutzen zu können.", + 'ADMIN_HTML_DOWNLOAD_CLASS' => "Bitte laden Sie sich die Klasse PHPMailer herunter, um diese Funktion nutzen zu können.", 'MEMBER_HTML_TITLE' => "HTML-Emfpang - Einstellung", 'MEMBER_HTML_TEXT' => "In unserem {?mt_word?} ist das Empfangen von HTML-Mails nun möglich. Gleichzeitig können Sie auch selber HTML-Mails versenden. Möchten Sie dies beides nutzen?", 'MEMBER_HTML_ORDER_TITLE' => "HTML- oder normale Text-Mails versenden?", diff --git a/inc/language/user_de.php b/inc/language/user_de.php index c027a56d6c..0c5eb6d36c 100644 --- a/inc/language/user_de.php +++ b/inc/language/user_de.php @@ -118,22 +118,24 @@ addMessages(array( // Member - sub ids 'MEMBER_USER_SUBIDS_404' => "Sie haben noch keine Sub-Ids angelegt.", - 'MEMBER_ADD_SUBID_SUBMIT' => "Sub-Id hinzufügen", + 'MEMBER_USER_SUBID_NOT_ASSIGNED_404' => "Die angegebene Sub-Id-Kennung ist Ihrem Mitgliedsaccount nicht zugewiesen oder existiert nicht.", + 'MEMBER_SUBID_STATS_404' => "Für diese Sub-Id ist noch keine Statistik abfragbar, da sie noch nicht aufgerufen wurde.", 'MEMBER_ENTER_SUBID' => "Geben Sie eine Sub-Id ein:", 'MEMBER_ADD_SUBID_LEGEND' => "Daten zur Sub-Id", - 'MEMBER_ADD_SUBID_NOTICE' => "Hinweise:Mit Sub-Ids haben Sie die Möglichkeit, die Aufrufe Ihres Referral-Linkes noch genauer zu verfolgen. Zum Beispiel können Sie jedem Besuchertausch oder fremden Paidmailer eine eigene Sub-Id vergeben, indem Sie diese hier zuerst eingeben und dann am Ende des Referral-Linkes mit &subid=Ihre Sub-Id anhängen. Bewerben Sie nun diesen erweiterten Link. Sobald Aufrufe auf diesen erfolgen, können Sie bei der jeweiligen Sub-Id auf "Aufruf-Statistik" klicken, um eine detailierte Statistik zu erhalten. Leerzeichen oder Bindestrichen werden automatisch in Unterstriche umgewandelt, es wurden nur Zeichen von A-Z (klein- und grossgeschrieben) und alle Zahlenzeichen sowie Unterstriche angenommen.", 'MEMBER_SUBID_NO_SELECTIONS' => "Sie haben keine Auswahl getroffen! Bitte navigieren Sie zurück, wählen Sie mindestens eine Sub-Id aus und versuchen Sie es dann erneut.", 'MEMBER_USER_SUBID_STATS_LINK' => "Aufrufstatistiken", 'MEMBER_USER_SUBID_ADDED' => "Sub-Id hinzugefügt", 'MEMBER_CHANGE_USER_SUBID' => "Geben Sie eine neue ein:", 'MEMBER_INVALID_DO_USER_SUBID' => "Ungültiges Sub-Modul aufgerufen! Sollten Sie der Meinung sein, dies ist ein Fehler, so teilen Sie bitte dem Support mit, wie es zu dieser Meldung gekommen ist.", - 'MEMBER_USER_SUBID_NOT_ASSIGNED_404' => "Die angegebene Sub-Id-Kennung ist Ihrem Mitgliedsaccount nicht zugewiesen oder existiert nicht.", + 'MEMBER_BACK_SUBIDS_OVERVIEW_LINK' => "Zurück zur Sub-Id-Übersicht ...", // Member - sub ids - submit buttons + 'MEMBER_USER_SUBIDS_ADD_SUBMIT' => "Sub-Id hinzufügen", 'MEMBER_USER_SUBIDS_CHANGE_SUBMIT' => "Sub-Ids ändern", 'MEMBER_USER_SUBIDS_REMOVE_SUBMIT' => "Sub-Ids löschen", // Member - sub ids - notices + 'MEMBER_ADD_USER_SUBIDS_NOTICE' => "Hinweise:Mit Sub-Ids haben Sie die Möglichkeit, die Aufrufe Ihres Referral-Linkes noch genauer zu verfolgen. Zum Beispiel können Sie jedem Besuchertausch oder fremden Paidmailer eine eigene Sub-Id vergeben, indem Sie diese hier zuerst eingeben und dann am Ende des Referral-Linkes mit &subid=Ihre Sub-Id anhängen. Bewerben Sie nun diesen erweiterten Link. Sobald Aufrufe auf diesen erfolgen, können Sie bei der jeweiligen Sub-Id auf "Aufruf-Statistik" klicken, um eine detailierte Statistik zu erhalten. Leerzeichen oder Bindestrichen werden automatisch in Unterstriche umgewandelt, es wurden nur Zeichen von A-Z (klein- und grossgeschrieben) und alle Zahlenzeichen sowie Unterstriche angenommen.", 'MEMBER_EDIT_USER_SUBIDS_NOTICE' => "Wenn Sie doch nichts ändern wollen, klicken Sie einfach auf {--MEMBER_USER_SUBIDS_CHANGE_SUBMIT--} oder in der Navigation {--YOU_ARE_HERE--} auf Sub-Id Tracking.", 'MEMBER_DELETE_USER_SUBIDS_NOTICE' => "Wollen Sie die oben aufgeführte(n) Sub-Id(s) wirklich löschen? Dieses ist nicht umkehrbar! Die Statistik dazu bleibt noch eine Weile gespeichert, ist aber nicht mehr aus der Auswahl aufrufbar (Sie können sich ja den Link notieren?).", @@ -142,6 +144,7 @@ addMessages(array( 'MEMBER_ADD_SUBID_TITLE' => "Neue Sub-Id anlegen", 'MEMBER_EDIT_USER_SUBIDS_TITLE' => "Ausgewählte Sub-Ids editieren", 'MEMBER_DELETE_USER_SUBIDS_TITLE' => "Ausgewählte Sub-Ids löschen", + 'MEMBER_SUBID_STATS_TITLE' => "Aufrufstatistik für Ihre Sub-Ids", // Member - sub ids - subject lines 'ADMIN_ADD_USER_SUBIDS_SUBJECT' => "Sub-Id wurde hinzugefügt", diff --git a/inc/libs/html_mail_functions.php b/inc/libs/html_mail_functions.php index 86584ac608..62c13a1a9b 100644 --- a/inc/libs/html_mail_functions.php +++ b/inc/libs/html_mail_functions.php @@ -82,7 +82,7 @@ function insertUrlsIntoHtml ($text) { } // END - foreach // Now replace the URL against anchor container and pray... - $text = substr($text, 0, strpos($text, $check2)) . '' . $check . '' . substr($text, strpos($text, $check2) + strlen($check)); + $text = substr($text, 0, strpos($text, $check2)) . '' . $check . '' . substr($text, strpos($text, $check2) + strlen($check)); // Finally remove the url from testing string (or we have a loop and maybe server overload!) $test = substr($test, strpos($test, $check) + strlen($check)); diff --git a/inc/libs/newsletter_functions.php b/inc/libs/newsletter_functions.php index a2b3c0ae62..525cb28540 100644 --- a/inc/libs/newsletter_functions.php +++ b/inc/libs/newsletter_functions.php @@ -56,7 +56,7 @@ function insertNewsletterUrls ($text) { } // END - foreach // Now replace the URL against anchor container and pray... - $text = substr($text, 0, strpos($text, $check2)) . generateDerefererUrl($check) . substr($text, strpos($text, $check2) + strlen($check)); + $text = substr($text, 0, strpos($text, $check2)) . generateDereferrerUrl($check) . substr($text, strpos($text, $check2) + strlen($check)); // Finally remove the url from testing string (or we have a loop and maybe server overload!) $test = substr($test, strpos($test, $check) + strlen($check)); diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index c889918668..9631fa3033 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -99,12 +99,12 @@ if ((isPostRequestElementSet('url')) || (isGetRequestElementSet('url')) || (!isF case 'member': // Build frameset $content['order'] = bigintval(getRequestElement('order')); - $content['url'] = generateDerefererUrl($url); + $content['url'] = generateDereferrerUrl($url); loadTemplate('member_order_frametester', false, $content); break; case 'guest': - $content['url'] = generateDerefererUrl($url); + $content['url'] = generateDereferrerUrl($url); loadTemplate('guest_frametester', false, $content); break; } // END - switch diff --git a/inc/modules/member/subid-stats.php b/inc/modules/member/subid-stats.php index d9d3649e0e..92a8083ef5 100644 --- a/inc/modules/member/subid-stats.php +++ b/inc/modules/member/subid-stats.php @@ -44,5 +44,8 @@ if (!defined('__SECURITY')) { redirectToUrl('modules.php?module=login&what=subids'); } +// List all entries +showEntriesByXmlCallback('member_list_subid_stats'); + // [EOF] ?> diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 1180b53707..1f9aa867e3 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -120,21 +120,9 @@ LIMIT 1", } // END - if // And shall I check that his URL is not in the black list? - if (isUrlBlacklistEnabled()) { - // Ok, I do that for you know... - $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1", - array(postRequestElement('url')), __FILE__, __LINE__); - - if (SQL_NUMROWS($result) == 1) { - // Jupp, we got one listed - list($blist) = SQL_FETCHROW($result); - - // Create redirect-URL - $url = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $blist; - } // END - if - - // Free result - SQL_FREERESULT($result); + if (isUrlBlacklisted(postRequestElement('url'))) { + // Create redirect-URL + $url = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $GLOBALS['blacklist_data'][postRequestElement('url')]['timestamp']; } // END - if // Enougth receivers entered? diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index f3357acd3a..41d4988293 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -98,7 +98,7 @@ ORDER BY // Textlink $content['target_account'] = $content['link_text']; } - $content['target_bank'] = '{--CLICK_HERE--}'; + $content['target_bank'] = '{--CLICK_HERE--}'; } // END - if // Prepare data for the template diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index bc4a920140..ce649cdd36 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -2314,5 +2314,39 @@ function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filter ); } +// 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; +} + // [EOF] ?> diff --git a/inc/template-functions.php b/inc/template-functions.php index 00642e5d25..e2b65de749 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -2206,5 +2206,41 @@ function doTemplatePointsPaymentMethodSelectionBox ($templateName, $clear = fals return $content; } +// Tries to anonymize some sensitive data (e.g. IP address, user agent, referrer, etc.) +function anonymizeSensitiveData ($data) { + // Trim it + $data = trim($data); + + // Is it empty? + if (empty($data)) { + // Then add three dashes + $data = '---'; + } elseif (isUrlValid($data)) { + // Is a referrer, so is it black-listed? + if (isAdmin()) { + // Is admin, has always priority + $data = '[{--ADMIN_TEST_URL--}]'; + } elseif (isUrlBlacklisted($data)) { + // Yes, so replace it with text + $data = '{--URL_IS_BLACKLISTED--}'; + } else { + // A member is viewing this referral URL + $data = '[{--MEMBER_TEST_URL--}]'; + } + } elseif (isIp4AddressValid($data)) { + // Is an IPv4 address + $ipArray = explode('.', $data); + + // Only display first 2 octets + $data = $ipArray[0] . '.' . $ipArray[1] . '.?.?'; + } else { + // Generic data + $data = '{--DATA_IS_HIDDEN--}'; + } + + // Return it (hopefully) anonymized + return $data; +} + // [EOF] ?> diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 762538a570..fdae0479db 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -746,7 +746,7 @@ function redirectToRequestUri () { // Wrapper function to redirect to de-refered URL function redirectToDereferedUrl ($url) { // Redirect to to - redirectToUrl(generateDerefererUrl($url)); + redirectToUrl(generateDereferrerUrl($url)); } // Wrapper function for checking if extension is installed and newer or same version diff --git a/ref.php b/ref.php index 6b0302c17a..7f0d0c7b2e 100644 --- a/ref.php +++ b/ref.php @@ -56,9 +56,8 @@ $url = 'modules.php?module=index'; // Check for determined referral id if ((isExtensionActive('user')) && (isReferralIdValid()) && (isValidUserId(determineReferralId()))) { - // Update ref counter - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1", - array(determineReferralId()), __FILE__, __LINE__); + // Run filter chain for updating referral data + runFilterChain('update_referral_data'); // Base URL for redirection switch (getConfig('refid_target')) { @@ -69,6 +68,10 @@ if ((isExtensionActive('user')) && (isReferralIdValid()) && (isValidUserId(deter case 'index': $url = 'modules.php?module=index'; break; + + default: // Is not valid + reportBug(__FILE__, __LINE__, 'Invalid refid target ' . getConfig('refid_target') . ' detected.'); + break; } // END - switch } // END - if diff --git a/templates/de/html/admin/admin_delete_email_bonus.tpl b/templates/de/html/admin/admin_delete_email_bonus.tpl index d3b62a449a..0dc3b484bc 100644 --- a/templates/de/html/admin/admin_delete_email_bonus.tpl +++ b/templates/de/html/admin/admin_delete_email_bonus.tpl @@ -16,7 +16,7 @@ $content[id] $content[subject] - {--ADMIN_TEST_URL--} + {--ADMIN_TEST_URL--} $content[timestamp] $content[count] diff --git a/templates/de/html/admin/admin_delete_email_normal.tpl b/templates/de/html/admin/admin_delete_email_normal.tpl index 20f0007617..e9fdf88c26 100644 --- a/templates/de/html/admin/admin_delete_email_normal.tpl +++ b/templates/de/html/admin/admin_delete_email_normal.tpl @@ -17,7 +17,7 @@ {%pipe,generateUserProfileLink=$content[sender]%} $content[subject] - {--ADMIN_TEST_URL--} + {--ADMIN_TEST_URL--} $content[timestamp] diff --git a/templates/de/html/admin/admin_delete_email_notify.tpl b/templates/de/html/admin/admin_delete_email_notify.tpl index 3ee8a12d57..4eb0776cbd 100644 --- a/templates/de/html/admin/admin_delete_email_notify.tpl +++ b/templates/de/html/admin/admin_delete_email_notify.tpl @@ -15,7 +15,7 @@ $content[id] $content[subject] - {--ADMIN_TEST_URL--} + {--ADMIN_TEST_URL--} $content[timestamp] $content[count] diff --git a/templates/de/html/admin/admin_edit_theme_row.tpl b/templates/de/html/admin/admin_edit_theme_row.tpl index 057eafac02..edfe7a84bf 100644 --- a/templates/de/html/admin/admin_edit_theme_row.tpl +++ b/templates/de/html/admin/admin_edit_theme_row.tpl @@ -16,7 +16,7 @@ $content[email] - $content[theme_url] + $content[theme_url] v$content[theme_version] diff --git a/templates/de/html/admin/admin_import_theme_row.tpl b/templates/de/html/admin/admin_import_theme_row.tpl index 74dd228267..c1b606ad9c 100644 --- a/templates/de/html/admin/admin_import_theme_row.tpl +++ b/templates/de/html/admin/admin_import_theme_row.tpl @@ -5,7 +5,7 @@ $content[theme_author] - $content[theme_url] + $content[theme_url] v$content[theme_version] diff --git a/templates/de/html/admin/admin_list_sponsor_details.tpl b/templates/de/html/admin/admin_list_sponsor_details.tpl index 32ed3a827e..f2979bf6f5 100644 --- a/templates/de/html/admin/admin_list_sponsor_details.tpl +++ b/templates/de/html/admin/admin_list_sponsor_details.tpl @@ -65,7 +65,7 @@ {--SPONSOR_ENTER_URL--}: - [{--ADMIN_TEST_URL--}] + [{--ADMIN_TEST_URL--}] diff --git a/templates/de/html/mailid/mailid_frames.tpl b/templates/de/html/mailid/mailid_frames.tpl index d2a119bfbf..0c6ab1b75b 100644 --- a/templates/de/html/mailid/mailid_frames.tpl +++ b/templates/de/html/mailid/mailid_frames.tpl @@ -1,6 +1,6 @@ - + Ihr Browser unterst&uuml;tzt keine frames! diff --git a/templates/de/html/member/member_add_subid.tpl b/templates/de/html/member/member_add_subid.tpl index 4f7ab9b48b..7f5d31d7b9 100644 --- a/templates/de/html/member/member_add_subid.tpl +++ b/templates/de/html/member/member_add_subid.tpl @@ -16,12 +16,12 @@ <div class="table_footer top" style="margin-top:5px" colspan="2" align="center"> <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" /> - <input type="submit" name="add_subid" class="form_submit" value="{--MEMBER_ADD_SUBID_SUBMIT--}" /> + <input type="submit" name="add_subid" class="form_submit" value="{--MEMBER_USER_SUBIDS_ADD_SUBMIT--}" /> </div> </div> </form> </div> <div class="notice"> - {--MEMBER_ADD_SUBID_NOTICE--} + {--MEMBER_ADD_USER_SUBIDS_NOTICE--} </div> diff --git a/templates/de/html/member/member_list_subid_stats.tpl b/templates/de/html/member/member_list_subid_stats.tpl new file mode 100644 index 0000000000..4676da9cff --- /dev/null +++ b/templates/de/html/member/member_list_subid_stats.tpl @@ -0,0 +1,23 @@ +<div align="center"> +<table border="0" cellspacing="0" cellpadding="0" class="table dashed"> + <tr> + <td colspan="6" align="center" class="table_header bottom"> + <strong>{--MEMBER_SUBID_STATS_TITLE--}</strong> + </td> + </tr> + <tr> + <td align="center" class="header_column bottom right" width="20"><strong>{--ID_SELECT--}</strong></td> + <td align="center" class="header_column bottom right"><strong>{--SUBID_VALUE--}</strong></td> + <td align="center" class="header_column bottom right"><strong>{--REFERRER_URL--}</strong></td> + <td align="center" class="header_column bottom right"><strong>{--REMOTE_IP--}</strong></td> + <td align="center" class="header_column bottom right"><strong>{--USER_AGENT--}</strong></td> + <td align="center" class="header_column bottom"><strong>{--ENTRY_ADDED--}</strong></td> + </tr> + $content + <tr> + <td colspan="6" class="table_footer"> + <a href="{%url=modules.php?module=login&amp;what=subids%}">{--MEMBER_BACK_SUBIDS_OVERVIEW_LINK--}</a> + </td> + </tr> +</table> +</div> diff --git a/templates/de/html/member/member_list_subid_stats_row.tpl b/templates/de/html/member/member_list_subid_stats_row.tpl new file mode 100644 index 0000000000..48405503d6 --- /dev/null +++ b/templates/de/html/member/member_list_subid_stats_row.tpl @@ -0,0 +1,20 @@ +<tr> + <td class="{%template,ColorSwitch%} bottom right" align="center"> + <strong>$content[id]</strong> + </td> + <td class="{%template,ColorSwitch%} bottom right" align="center"> + $content[subid] + </td> + <td class="{%template,ColorSwitch%} bottom right"> + {%pipe,anonymizeSensitiveData=$content[referral_url]%} + </td> + <td class="{%template,ColorSwitch%} bottom right"> + {%pipe,anonymizeSensitiveData=$content[remote_address]%} + </td> + <td class="{%template,ColorSwitch%} bottom right"> + {%pipe,anonymizeSensitiveData=$content[user_agent]%} + </td> + <td class="{%template,ColorSwitch%} bottom" align="center"> + $content[entry_added] + </td> +</tr> diff --git a/templates/de/html/member/member_list_surfbar_row.tpl b/templates/de/html/member/member_list_surfbar_row.tpl index 9d3893c298..99ff3f87c9 100644 --- a/templates/de/html/member/member_list_surfbar_row.tpl +++ b/templates/de/html/member/member_list_surfbar_row.tpl @@ -1,6 +1,6 @@ <tr> <td align="center" class="{%template,ColorSwitch%} bottom right"> - <a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank" title="{--MEMBER_TEST_URL--}">{--MEMBER_SURFBAR_TEST_URL--}</a> + <a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank" title="{--MEMBER_TEST_URL--}">{--MEMBER_SURFBAR_TEST_URL--}</a> </td> <td align="center" class="{%template,ColorSwitch%} bottom right"> {%pipe,translateSurfbarUrlStatus=$content[url_status]%} diff --git a/templates/de/html/member/member_pool_row.tpl b/templates/de/html/member/member_pool_row.tpl index cb032fd9d9..ec0bfea6a0 100644 --- a/templates/de/html/member/member_pool_row.tpl +++ b/templates/de/html/member/member_pool_row.tpl @@ -23,7 +23,7 @@ </td> <td align="center" class="{%template,ColorSwitch%} top"> {--EMAIL_URL--}:<br /> - <strong><a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--MEMBER_TEST_URL--}</a></strong> + <strong><a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank">{--MEMBER_TEST_URL--}</a></strong> </td> </tr> <tr> diff --git a/templates/de/html/member/member_stats_row.tpl b/templates/de/html/member/member_stats_row.tpl index a24203a025..8d221ccf55 100644 --- a/templates/de/html/member/member_stats_row.tpl +++ b/templates/de/html/member/member_stats_row.tpl @@ -21,7 +21,7 @@ <tr> <td colspan="2" align="center" class="{%template,ColorSwitch%} top right"> {--EMAIL_URL--}:<br /> - <strong><a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--MEMBER_TEST_URL--}</a></strong> + <strong><a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank">{--MEMBER_TEST_URL--}</a></strong> </td> <td align="center" class="{%template,ColorSwitch%} top"> {--MEMBER_EMAIL_END_SEND--}:<br /> diff --git a/templates/de/html/member/member_themes_row.tpl b/templates/de/html/member/member_themes_row.tpl index 4dbd46079f..7e59f67e73 100644 --- a/templates/de/html/member/member_themes_row.tpl +++ b/templates/de/html/member/member_themes_row.tpl @@ -7,7 +7,7 @@ <a href="mailto:$content[theme_email]?Subject=[Theme:] $content[theme_name] ($content[unix])">$content[theme_author]</a> </td> <td class="{%template,ColorSwitch%} bottom right" align="center"> - <a href="{%pipe,generateDerefererUrl=$content[theme_url]%}" target="_blank">$content[theme_url]</a> + <a href="{%pipe,generateDereferrerUrl=$content[theme_url]%}" target="_blank">$content[theme_url]</a> </td> <td class="{%template,ColorSwitch%} bottom" align="center">v$content[theme_version]</td> </tr> diff --git a/templates/xml/member/member_list_subid_stats.xml b/templates/xml/member/member_list_subid_stats.xml new file mode 100644 index 0000000000..9fb05e44c6 --- /dev/null +++ b/templates/xml/member/member_list_subid_stats.xml @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- +This template provides meta data for listing member's sub id statistics + +@author Roland Haeder <webmaster@mxchange.org> +@version 0.2.1-FINAL +@copyright (c) 2003 - 2009 by Roland Haeder +@copyright (c) 2009 - 2012 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 +//--> +<member-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="member_list_subid_stats" /> + <!-- + 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="member_list_subid_stats_row" /> + <!-- + Message id to display if no entry could be found + //--> + <no-entry-found-message type="string" value="MEMBER_SUBID_STATS_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="subid_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="id" alias="" function="" /> + <select-data-from-list-entry type="string" table="" value="subid" alias="" function="" /> + <select-data-from-list-entry type="string" table="" value="referral_url" alias="" function="" /> + <select-data-from-list-entry type="string" table="" value="remote_address" alias="" function="" /> + <select-data-from-list-entry type="string" table="" value="user_agent" alias="" function="" /> + <select-data-from-list-entry type="string" table="" value="entry_added" alias="entry_added" function="UNIX_TIMESTAMP" /> + </select-data-from-list> + <!-- + And the column list to perform the WHERE statement on. + //--> + <where-select-from-list> + <!-- + Search for current user's sub ids + //--> + <where-select-from-list-entry type="string" table="" value="refid" condition="EQUALS" look-for="{%pipe,getMemberId%}" /> + </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="entry_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="entry_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="entry_added" value="2" /> + </callback-extra-parameter-list> + </column-callback-list-entry> + </column-callback-list> +</member-list-data> -- 2.30.2