]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-user.php
Lock reason now saved in DB, deleted accounts shall be locked for re-registering...
[mailer.git] / inc / extensions / ext-user.php
index f12042f0db8761cd0615ff31640d3a84dc4f23ad..203bd6e3c2e030ba8b4756454986765cd443e269 100644 (file)
@@ -38,10 +38,10 @@ if (!defined('__SECURITY')) {
 }
 
 // Version number
 }
 
 // Version number
-$EXT_VERSION = "0.3.4";
+$EXT_VERSION = "0.3.5";
 
 // Version history array (add more with , "0.1" and so on)
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.1", "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");
+$EXT_VER_HISTORY = array("0.0", "0.1", "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");
 
 switch ($EXT_LOAD_MODE)
 {
 
 switch ($EXT_LOAD_MODE)
 {
@@ -55,7 +55,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
 
 case "remove": // Do stuff when removing extension
        // SQL commands to run
-       $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_user' OR what='user_contct' LIMIT 2";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') LIMIT 3";
+       $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_del`";
        break;
 
 case "activate": // Do stuff when admin activates this extension
        break;
 
 case "activate": // Do stuff when admin activates this extension
@@ -72,7 +73,7 @@ case "update": // Update an extension
        switch ($EXT_VER)
        {
        case "0.1": // SQL queries for v0.1
        switch ($EXT_VER)
        {
        case "0.1": // SQL queries for v0.1
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD user_limit INT(7) NOT NULL DEFAULT '20'";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_limit` INT(7) NOT NULL DEFAULT 20";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Seitenweises Anzeigen der User-Liste ist nun möglich.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Seitenweises Anzeigen der User-Liste ist nun möglich.";
@@ -88,7 +89,7 @@ case "update": // Update an extension
                $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
 
        case "0.1.2": // SQL queries for v0.1.2
                $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
 
        case "0.1.2": // SQL queries for v0.1.2
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD mails_confirmed BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "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!)
                $UPDATE_NOTES = "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.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "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.";
@@ -100,7 +101,7 @@ case "update": // Update an extension
                break;
 
        case "0.1.4": // SQL queries for v0.1.4
                break;
 
        case "0.1.4": // SQL queries for v0.1.4
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD emails_received BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
+               $SQLs[] = "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!)
                $UPDATE_NOTES = "Anzahl empfangener Mails wird angezeigt. <BIG>Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {!MT_WORD!} haben sollen!</BIG>";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Anzahl empfangener Mails wird angezeigt. <BIG>Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {!MT_WORD!} haben sollen!</BIG>";
@@ -137,15 +138,15 @@ case "update": // Update an extension
                break;
 
        case "0.2.1": // SQL queries for v0.2.1
                break;
 
        case "0.2.1": // SQL queries for v0.2.1
-               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD user_alpha TINYINT(3) UNSIGNED 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)";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_alpha` TINYINT(3) UNSIGNED 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
 
                // 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 gender gender ENUM('M','F','C') NOT NULL DEFAULT 'M'";
+               $SQLs[] = "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!)
                $UPDATE_NOTES = "Anrede &quot;Firma&quot; hinzugef&uuml;gt.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Anrede &quot;Firma&quot; hinzugef&uuml;gt.";
@@ -182,7 +183,7 @@ case "update": // Update an extension
                break;
 
        case "0.2.9": // SQL queries for v0.2.9
                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 &uuml;ber ein Webformular. Sie brauchen somit kein EMail-Programm mehr starten!', 8)";
+               $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 &uuml;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&uuml;gt.";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Admin-Kontaktformular hinzugef&uuml;gt.";
@@ -194,7 +195,7 @@ case "update": // Update an extension
                break;
 
        case "0.3.1": // SQL queries for v0.3.1
                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='' OR what IS NULL) LIMIT 1";
+               $SQLs[] = "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!)
                $UPDATE_NOTES = "Verwaltung auf Management umgestellt";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Verwaltung auf Management umgestellt";
@@ -218,6 +219,30 @@ case "update": // Update an extension
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Mitglieder werden per Zufall als Referal-ID ausgew&auml;hlt, die eine Mindestanzahl an best&auml;tigten Mails haben, wenn die Ref-Id 0 ist.";
                break;
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Mitglieder werden per Zufall als Referal-ID ausgew&auml;hlt, die eine Mindestanzahl an best&auml;tigten Mails haben, wenn die Ref-Id 0 ist.";
                break;
+
+       case "0.3.5": // SQL queries for v0.3.5
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `lock_reason` TINYTEXT";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'";
+               $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day'] * 30)."";
+               $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_user_del','L&ouml;schungen auflisten','Listet die L&ouml;schungen von Usern auf.', 9)";
+               $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_del`";
+               $SQLs[] = "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`)
+) TYPE=MyISAM COMMENT='List of deleted users'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Der Sperrgrund wird nun mit abgespeichert und beim L&ouml;schen des Users mit ausgesendet.";
+               break;
        }
        break;
 
        }
        break;