Mailer continued, sub-id tracking continued:
[mailer.git] / inc / extensions / ext-user.php
index 9e1ed4d56f4bb63e8220d3d132097d4d426b00cf..ed6a26f2d0e28ea7d28635fd33182bfd6e0877b8 100644 (file)
@@ -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;