X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-user.php;h=e6e06e413d9fccb9ec940eb263c330c392f8d7b3;hp=47ddfe369795c006701c43649113ed0ebbc7bfd1;hb=0f3a135204757cc8750262871c8e62c42300acb4;hpb=3f7f0051c91c54cb691303b9d49fb9cd1a7a4e8c diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 47ddfe3697..e6e06e413d 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.4.1'); +setThisExtensionVersion('0.4.6'); // 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.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')); +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')); // 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, @@ -118,7 +118,7 @@ INDEX (`userid`)", `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`link_type` ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL', +`link_type` VARCHAR(255) NOT NULL DEFAULT 'NORMAL', PRIMARY KEY (`id`), INDEX (`userid`), INDEX (`stats_id`)", @@ -130,7 +130,7 @@ INDEX (`stats_id`)", `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`subject` VARCHAR(200) NOT NULL DEFAULT '', +`subject` VARCHAR(255) NOT NULL DEFAULT '', `url` TINYTEXT NOT NULL, `max_rec` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -177,6 +177,7 @@ INDEX (`stats_type`)", addDropTableSql('user_data'); addDropTableSql('user_points'); addDropTableSql('user_links'); + addDropTableSql('user_refs'); addDropTableSql('user_stats'); addDropTableSql('user_stats_data'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'"); @@ -206,7 +207,7 @@ INDEX (`stats_type`)", break; case '0.1.1': // SQL queries for v0.1.1 - // This update depends on sql_patches update! + // This update depends on ext-sql_patches update! addExtensionDependency('sql_patches'); // Update notes (these will be set as task text!) @@ -371,7 +372,7 @@ INDEX (`userid`)", case '0.3.6': // SQL queries for v0.3.6 addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` DROP INDEX `userid`'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE `userid_catid` ( `userid` , `cat_id` )'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE `userid_catid` (`userid` , `cat_id`)'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet."); @@ -387,9 +388,6 @@ INDEX (`userid`)", addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `userid` `userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `userid` `userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` CHANGE `ref_depth` `ref_depth` TINYINT(3) UNSIGNED NULL DEFAULT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `userid` `userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `level` `level` SMALLINT(6) UNSIGNED NULL DEFAULT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `refid` `refid` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `userid` `userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `cat_id` `cat_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `payment_id` `payment_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); @@ -403,7 +401,6 @@ INDEX (`userid`)", addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid` IS NULL'); addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `ref_depth`=NULL WHERE `ref_depth`=0'); addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid` IS NULL'); - addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid` IS NULL OR `refid` IS NULL OR `level` IS NULL'); addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `cat_id`=NULL WHERE `cat_id`=0'); addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `payment_id`=NULL WHERE `payment_id`=0'); addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `pool_id`=NULL WHERE `pool_id`=0'); @@ -413,28 +410,28 @@ INDEX (`userid`)", setExtensionUpdateNotes("NULL ist wichtiger als 0 und UNSIGNED auch."); break; - case '0.3.7': // SQL queries for v0.3.7 + case '0.3.8': // SQL queries for v0.3.8 addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `last_failure` `last_failure` TIMESTAMP NULL DEFAULT NULL'); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Ausgangswert ist nicht mehr 0000-00-00 00:00:00, sondern einfach NULL."); break; - case '0.3.8': // SQL queries for v0.3.8 + case '0.3.9': // SQL queries for v0.3.9 // Update notes (these will be set as task text!) setExtensionUpdateNotes("Update verschoben nach ext-order (da es Werbeguthaben ist und nichts mit dem Mitglied selbst zu tun hat)."); break; - case '0.3.9': // SQL queries for v0.3.9 + case '0.4.0': // SQL queries for v0.4.0 // Register new filters for gathering points - registerFilter(__FUNCTION__, __LINE__, 'get_total_points', 'USER_POINTS', true, isExtensionDryRun()); - registerFilter(__FUNCTION__, __LINE__, 'get_own_points', 'USER_POINTS', true, isExtensionDryRun()); + registerFilter('get_total_points', 'USER_POINTS', false, true, isExtensionDryRun()); + registerFilter('get_own_points', 'USER_POINTS', false, true, isExtensionDryRun()); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Filter registriert, die das eigene {?POINTS?}-Guthaben des Mitgliedes zurückliefern."); break; - case '0.4.0': // SQL queries for v0.4.0 + case '0.4.1': // SQL queries for v0.4.1 // Add special fix include to fix filters addIncludeToPool('extension', 'inc/fix_user_points.php'); @@ -442,13 +439,63 @@ INDEX (`userid`)", setExtensionUpdateNotes("Das Mitgliederguthaben musste repariert werden, da für Referal-Ebene 0, noch NULL geschrieben wurde."); break; - case '0.4.1': // SQL queries for v0.4.1 + case '0.4.2': // SQL queries for v0.4.2 // Add special fix include to fix filters addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='chk_regs' LIMIT 1"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Überflüssiges Menü chk_regs entfernt, dies kann mit list_user ü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("Überflüssiges Menü chk_regs entfernt, dies kann mit list_user ü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'); + + // Load ext-refback's special include to regenerate the referal table + addIncludeToPool('extension', 'inc/fix_refsystem.php'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Neues Tabellenlayout und verschoben von ext-refback."); + break; + + case '0.4.5': // SQL queries for v0.4.5 + // SQL commands to run + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `link_type` `link_type` VARCHAR(255) NOT NULL DEFAULT 'NORMAL'"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Die Spalte link_type ist nun kein ENUM mehr, um weitere Mailtypen zu erlauben."); + break; + + case '0.4.6': // SQL queries for v0.4.6 + // SQL commands to run + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_CONFIG}POINTS{CLOSE_CONFIG} gutschreiben' WHERE `what` = 'add_points' LIMIT 1"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen' WHERE `what` = 'sub_points' LIMIT 1"); + addAdminMenuSql('user','sub_points','{OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen','Allen oder einem Mitglied {OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen.', 8); + + // This update depends on ext-menu update + addExtensionDependency('menu'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Abzug von {?POINTS?} sollte nun dabei sein und Hinzufügen gefixt (war zu kurze Spalte)."); + break; } // END - switch break;