File renamed to naming convention, ext-repair continued:
[mailer.git] / inc / extensions / ext-user.php
index 76cebee280107558983a0aae3644a9de559f4113..4a65c5d0c9719926e9de3797f0902b193a104537 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.4.2');
+setThisExtensionVersion('0.4.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'));
+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'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -53,7 +53,7 @@ switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running
                addDropTableSql('user_cats');
                addCreateTableSql('user_cats', "
-`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
 PRIMARY KEY (`id`),
@@ -63,7 +63,7 @@ INDEX (`cat_id`)",
 
                addDropTableSql('user_data');
                addCreateTableSql('user_data', "
-`userid` BIGINT(22) NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) NOT NULL AUTO_INCREMENT,
 `surname` VARCHAR(255) NOT NULL DEFAULT '',
 `family` VARCHAR(255) NOT NULL DEFAULT '',
 `street_nr` VARCHAR(255) NOT NULL DEFAULT '',
@@ -77,7 +77,7 @@ INDEX (`cat_id`)",
 `password` VARCHAR(255) NOT NULL DEFAULT '',
 `max_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `receive_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`refid` BIGINT(22) NOT NULL DEFAULT 0,
+`refid` BIGINT(20) NOT NULL DEFAULT 0,
 `status` ENUM('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
 `user_hash` VARCHAR(255) NULL DEFAULT NULL,
 `REMOTE_ADDR` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
@@ -104,8 +104,8 @@ INDEX `status_mails` (`status`, `max_mails`)",
 
                addDropTableSql('user_points');
                addCreateTableSql('user_points', "
-`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(22) NOT NULL DEFAULT 0,
+`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) NOT NULL DEFAULT 0,
 `ref_depth` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
 `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
 `locked_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
@@ -445,6 +445,35 @@ INDEX (`userid`)",
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("&Uuml;berfl&uuml;ssiges Men&uuml; <strong>chk_regs</strong> entfernt, dies kann mit <strong>list_user</strong> &uuml;bernommen werden.");
                                break;
+
+                       case '0.4.3': // SQL queries for v0.4.3
+                               // Add special fix include to fix filters
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `refid` `refid` BIGINT(20) NULL DEFAULT NULL");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("&Uuml;berfl&uuml;ssiges Men&uuml; <strong>chk_regs</strong> entfernt, dies kann mit <strong>list_user</strong> &uuml;bernommen werden.");
+                               break;
+
+                       case '0.4.4': // SQL queries for v0.4.4
+                               // SQL commands to run
+                               addDropTableSql('user_refs');
+                               addCreateTableSql('user_refs', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0,
+`refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
+UNIQUE `user_refid` (`userid`, `level`, `refid`),
+INDEX (`level`),
+INDEX (`refid`)",
+                                       'User referals');
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Neues Tabellenlayout und verschoben von ext-refback.");
+
+                               // Load ext-refback's special include to regenerate the referal table
+                               addIncludeToPool('extension', 'inc/fix_refsystem.php');
+                               break;
                } // END - switch
                break;