X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-user.php;h=344cb3258906753f11307c0d574465fc987a0211;hp=54cfda5d11f09d9e7ec86986a0abaf175ee18ef6;hb=c25e794a61b597f90bff599307ae4d766a2d3479;hpb=60494e212a67fe360bfbb481eb4928480a6f379b diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 54cfda5d11..344cb32589 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -1,7 +1,7 @@ Sie sind hier im Menüpunkt Online-Liste erweitert."; + case 'remove': // Do stuff when removing extension + // SQL commands to run + addDropTableSql('user_del'); + addDropTableSql('user_cats'); + addDropTableSql('user_data'); + addDropTableSql('user_points'); + addDropTableSql('user_links'); + 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'"); break; - case "0.1.4": // SQL queries for v0.1.4 - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD emails_received bigint(20) not null default '0'"; - - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Anzahl empfangener Mails wird angezeigt. Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {!MT_WORD!} haben sollen!"; + case 'activate': // Do stuff when admin activates this extension + // SQL commands to run + addExtensionSql(''); break; - case "0.1.5": // SQL queries for v0.1.5 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist."; + case 'deactivate': // Do stuff when admin deactivates this extension + // SQL commands to run + addExtensionSql(''); break; - case "0.1.6": // SQL queries for v0.1.6 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist."; + case 'update': // Update an extension + switch (getCurrentExtensionVersion()) { + case '0.1.0': // SQL queries for v0.1 + addConfigAddSql('user_limit', "INT(7) UNSIGNED NOT NULL DEFAULT 20"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Seitenweises Anzeigen der User-Liste ist nun möglich."); + break; + + case '0.1.1': // SQL queries for v0.1.1 + // This update depends on sql_patches update! + addExtensionDependency('sql_patches'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Ungültiges Update."); + break; + + case '0.1.2': // SQL queries for v0.1.2 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `mails_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Dem Mitglied wird nun angezeigt, wie viele Mails er bestätigt hat. Alle vor dieser Version best. Mails werden leider nicht mehr berücksichtigt! Bitte teilen Sie dies Ihren Mitgliedern mit."); + break; + + case '0.1.3': // SQL queries for v0.1.3 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Den Pfad Sie sind hier im Menüpunkt Online-Liste erweitert."); + break; + + case '0.1.4': // SQL queries for v0.1.4 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `emails_received` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Anzahl empfangener Mails wird angezeigt. Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {?mt_word?} haben sollen!"); + break; + + case '0.1.5': // SQL queries for v0.1.5 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist."); + break; + + case '0.1.6': // SQL queries for v0.1.6 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist."); + break; + + case '0.1.7': // SQL queries for v0.1.7 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Erweiterung bleibt wegen integrierten Schalters immer aktiv."); + break; + + case '0.1.8': // SQL queries for v0.1.8 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Seit Patch 340 überflüssige HTML-Tags entfernt."); + break; + + case '0.1.9': // SQL queries for v0.1.9 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Link zum Mitgliedsprofil in Funktion generateUserProfileLink() ausgelagert."); + break; + + case '0.2.0': // SQL queries for v0.2.0 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("User-Liste ausgelagert in Templates und überbreite Zeile in 2er-Zeile umgewandelt."); + break; + + case '0.2.1': // SQL queries for v0.2.1 + addConfigAddSql('user_alpha', "TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"); + addAdminMenuSql('setup','config_user','Mitgliederliste','Anzahl Mitglieder pro Seite, Anzahl Buchstaben pro Zeile usw.', 8); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("User-Liste ist konfigurierbar: Anzahl Mitglieder pro Seite und Anzahl Buchstaben pro Zeile; Template-Fehler beseitigt."); + break; + + case '0.2.2': // SQL queries for v0.2.2 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `gender` `gender` ENUM('M','F','C') NOT NULL DEFAULT 'M'"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Anrede "Firma" hinzugefügt."); + break; + + case '0.2.3': // SQL queries for v0.2.3 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Datumsformat festgelegt auf ausführlich."); + break; + + case '0.2.4': // SQL queries for v0.2.4 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Wörter {?mt_word?}, {?mt_word2?} und {?mt_word3?} sind austauschbar."); + break; + + case '0.2.5': // SQL queries for v0.2.5 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("SQL-Anweisungen abgesichert."); + break; + + case '0.2.6': // SQL queries for v0.2.6 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Abspeichern von Einstellungen repariert."); + break; + + case '0.2.7': // SQL queries for v0.2.7 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Sicherheitsupdate für die Include-Befehle."); + break; + + case '0.2.8': // SQL queries for v0.2.8 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("if-Anweisungen auf Funktion empty() umgestellt."); + break; + + case '0.2.9': // SQL queries for v0.2.9 + addAdminMenuSql('user','user_contct','Mitglied kontaktieren','Kontaktieren Sie hier Ihre Mitglieder ganz direkt über ein Webformular. Sie brauchen somit kein EMail-Programm mehr starten!', 8); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Admin-Kontaktformular hinzugefügt."); + break; + + case '0.3.0': // SQL queries for v0.3.0 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Hash-Erstellung von md5() auf bessere Funktion generateHash() umgestellt.
Diverse Fixes für 0.2.1-Beta1 Release."); + break; + + case '0.3.1': // SQL queries for v0.3.1 + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title` = 'Mitglieder-Management' WHERE `action`='user' AND (`what`='' OR `what` IS NULL) LIMIT 1"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Verwaltung auf Management umgestellt"); + break; + + case '0.3.2': // SQL queries for v0.3.2 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("PHP-Hinweis in Userauflistung gefixt (trat bei fehlender Erweiterung ext-nickname auf) und Darstellungsfehler von 0.00000 unbestätigten Mails gefixt."); + break; + + case '0.3.3': // SQL queries for v0.3.3 + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Mitglieder sind nun per Formular kontaktierbar (es wird eine EMail versendet), gesperrte und bestätigte Mitglieder-Accounts sind seperat oder gemeinsam auflistbar (seperat nur mit der Erweiterung task!)"); + break; + + case '0.3.4': // SQL queries for v0.3.4 + addConfigAddSql('select_user_zero_refid', "ENUM('Y','N') NOT NULL DEFAULT 'Y'"); + addConfigAddSql('user_min_confirmed', "SMALLINT(5) UNSIGNED NOT NULL DEFAULT 10"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `rand_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Mitglieder werden per Zufall als Referal-Id ausgewählt, die eine Mindestanzahl an bestätigten Mails haben, wenn die Ref-Id 0 ist."); + break; + + case '0.3.5': // SQL queries for v0.3.5 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_reason` TINYTEXT"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'"); + addConfigAddSql('user_delete_purge', "BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 30).""); + addAdminMenuSql('user', 'list_user_del', 'Löschungen auflisten', 'Listet die Löschungen von Usern auf.', 9); + addDropTableSql('user_del'); + addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_del` ( +`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`email` VARCHAR(255) NOT NULL DEFAULT '', +`surname` VARCHAR(255) NOT NULL DEFAULT '', +`family` VARCHAR(255) NOT NULL DEFAULT '', +`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, +INDEX (`userid`), +PRIMARY KEY (`id`) +) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'List of deleted users'"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet."); + break; + + 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` )"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet."); + break; + + case '0.3.7': // SQL queries for v0.3.7 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `id` `id` BIGINT( 22 ) UNSIGNED NOT NULL AUTO_INCREMENT"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` CHANGE `cat_id` `cat_id` TINYINT( 3 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NOT NULL AUTO_INCREMENT"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_del` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` CHANGE `stats_id` `stats_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + 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( 22 ) 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"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` CHANGE `pool_id` `pool_id` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats_data` CHANGE `userid` `userid` BIGINT( 20 ) UNSIGNED NULL DEFAULT NULL"); + + // Cleanup SQLs + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid` IS NULL OR `cat_id` IS NULL"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_del` WHERE `userid` IS NULL"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `stats_id`=NULL WHERE `stats_id`=0"); + 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"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid` IS NULL"); + + // This update depends on ext-bonus + addExtensionDependency('bonus'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("NULL ist wichtiger als 0 und UNSIGNED auch."); + break; + + case '0.3.7': // SQL queries for v0.3.7 + 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("Standardwert 0000-00-00 00:00:00 ist nun einfach NULL."); + break; + } // END - switch break; - case "0.1.7": // SQL queries for v0.1.7 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv."; + case 'modify': // When the extension got modified break; - case "0.1.8": // SQL queries for v0.1.8 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Seit Patch 340 überflüssige HTML-Tags entfernt."; + case 'test': // For testing purposes break; - case "0.1.9": // SQL queries for v0.1.9 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion ADMIN_USER_PROFILE_LINK() ausgelagert."; + case 'init': // Do stuff when extension is initialized break; - case "0.2.0": // SQL queries for v0.2.0 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "User-Liste ausgelagert in Templates und überbreite Zeile in 2er-Zeile umgewandelt."; + default: // Unknown extension mode + logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; +} // END - switch - case "0.2.1": // SQL queries for v0.2.1 - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD user_alpha tinyint(4) not null default '10'"; - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES('setup', 'config_user', 'Mitgliederliste', 'Anzahl Mitglieder pro Seite, Anzahl Buchstaben pro Zeile usw.', 8)"; - - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "User-Liste ist konfigurierbar: Anzahl Mitglieder pro Seite und Anzahl Buchstaben pro Zeile; Template-Fehler beseitigt."; - break; - - case "0.2.2": // SQL queries for v0.2.2 - $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data CHANGE sex sex enum('M', 'F', 'C') not null default 'M'"; - - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Anrede "Firma" hinzugefügt."; - break; - - case "0.2.3": // SQL queries for v0.2.3 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Datumsformat festgelegt auf ausführlich."; - break; - - case "0.2.4": // SQL queries for v0.2.4 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Wörter Mailtausch, Mailtausches und Mailtauscher sind austauschbar."; - break; - - case "0.2.5": // SQL queries for v0.2.5 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "SQL-Anweisungen abgesichert."; - break; - - case "0.2.6": // SQL queries for v0.2.6 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Abspeichern von Einstellungen repariert."; - break; - - case "0.2.7": // SQL queries for v0.2.7 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Sicherheitsupdate für die Include-Befehle."; - break; - - case "0.2.8": // SQL queries for v0.2.8 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "if-Anweisungen auf Funktion empty() umgestellt."; - break; - - case "0.2.9": // SQL queries for v0.2.9 - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES('user', 'user_contct', 'Mitglied kontaktieren', 'Kontaktieren Sie hier Ihre Mitglieder ganz direkt über ein Webformular. Sie brauchen somit kein EMail-Programm mehr starten!', 8)"; - - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Admin-Kontaktformular hinzugefügt."; - break; - - case "0.3.0": // SQL queries for v0.3.0 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Hash-Erstellung von md5() auf bessere Funktion generateHash() umgestellt.
Diverse Fixes für 0.2.1-Beta1 Release."; - break; - - case "0.3.1": // SQL queries for v0.3.1 - $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET title = 'Mitglieder-Management' WHERE action = 'user' AND what='' LIMIT 1"; - - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Verwaltung auf Management umgestellt"; - break; - - case "0.3.2": // SQL queries for v0.3.2 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "PHP-Hinweis in Userauflistung gefixt (trat bei fehlender nickname-Erweiterung auf) und Darstellungsfehler von 0.00000 unbestätigten Mails gefixt."; - break; - - case "0.3.3": // SQL queries for v0.3.3 - // Update notes (these will be set as task text!) - $UPDATE_NOTES = "Mitglieder sind nun per Formular kontaktierbar (es wird eine EMail versendet), gesperrte und bestätigte Mitglieder-Accounts sind seperat oder gemeinsam auflistbar (seperat nur mit der Erweiterung task!)"; - break; - } - break; - -default: // Do stuff when extension is loaded - $DUMMY = LOAD_CONFIG("0"); - $_CONFIG['user_limit'] = $DUMMY['user_limit']; - $_CONFIG['user_alpha'] = $DUMMY['user_alpha']; - unset($DUMMY); - break; -} -// Language file prefix -$EXT_LANG_PREFIX = "user"; - -// Extension is always active? -$EXT_ALWAYS_ACTIVE = 'Y'; - -// +// [EOF] ?>