2 /************************************************************************
3 * MXChange v0.2.1 Start: 04/29/2004 *
4 * ================ Last change: 10/29/2004 *
6 * -------------------------------------------------------------------- *
7 * File : ext-user.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Swapped out user management *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Ausgelagertes Mitglieder-Management *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
41 $EXT_VERSION = "0.3.5";
43 // Version history array (add more with , "0.1" and so on)
44 $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");
46 switch ($EXT_LOAD_MODE)
48 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
49 // SQL commands to run
56 case "remove": // Do stuff when removing extension
57 // SQL commands to run
58 $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') LIMIT 3";
59 $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_del`";
62 case "activate": // Do stuff when admin activates this extension
63 // SQL commands to run
67 case "deactivate": // Do stuff when admin deactivates this extension
68 // SQL commands to run
72 case "update": // Update an extension
75 case "0.1": // SQL queries for v0.1
76 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_limit` INT(7) UNSIGNED NOT NULL DEFAULT 20";
78 // Update notes (these will be set as task text!)
79 $UPDATE_NOTES = "Seitenweises Anzeigen der User-Liste ist nun möglich.";
82 case "0.1.1": // SQL queries for v0.1.1
83 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='user' AND `ext_has_css`='N' LIMIT 1";
85 // This update depends on sql_patches update!
86 $EXT_UPDATE_DEPENDS = "sql_patches";
88 // Update notes (these will be set as task text!)
89 $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
91 case "0.1.2": // SQL queries for v0.1.2
92 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `mails_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
94 // Update notes (these will be set as task text!)
95 $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.";
98 case "0.1.3": // SQL queries for v0.1.3
99 // Update notes (these will be set as task text!)
100 $UPDATE_NOTES = "Den Pfad <I>Sie sind hier</I> im Menüpunkt <U>Online-Liste</U> erweitert.";
103 case "0.1.4": // SQL queries for v0.1.4
104 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `emails_received` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
106 // Update notes (these will be set as task text!)
107 $UPDATE_NOTES = "Anzahl empfangener Mails wird angezeigt. <BIG>Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {!MT_WORD!} haben sollen!</BIG>";
110 case "0.1.5": // SQL queries for v0.1.5
111 // Update notes (these will be set as task text!)
112 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
115 case "0.1.6": // SQL queries for v0.1.6
116 // Update notes (these will be set as task text!)
117 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
120 case "0.1.7": // SQL queries for v0.1.7
121 // Update notes (these will be set as task text!)
122 $UPDATE_NOTES = "Erweiterung bleibt wegen integrierten Schalters immer aktiv.";
125 case "0.1.8": // SQL queries for v0.1.8
126 // Update notes (these will be set as task text!)
127 $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> überflüssige HTML-Tags entfernt.";
130 case "0.1.9": // SQL queries for v0.1.9
131 // Update notes (these will be set as task text!)
132 $UPDATE_NOTES = "Link zum Mitgliedsprofil in Funktion <U>ADMIN_USER_PROFILE_LINK()</U> ausgelagert.";
135 case "0.2.0": // SQL queries for v0.2.0
136 // Update notes (these will be set as task text!)
137 $UPDATE_NOTES = "User-Liste ausgelagert in Templates und überbreite Zeile in 2er-Zeile umgewandelt.";
140 case "0.2.1": // SQL queries for v0.2.1
141 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_alpha` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10";
142 $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)";
144 // Update notes (these will be set as task text!)
145 $UPDATE_NOTES = "User-Liste ist konfigurierbar: Anzahl Mitglieder pro Seite und Anzahl Buchstaben pro Zeile; Template-Fehler beseitigt.";
148 case "0.2.2": // SQL queries for v0.2.2
149 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` CHANGE `gender` `gender` ENUM('M','F','C') NOT NULL DEFAULT 'M'";
151 // Update notes (these will be set as task text!)
152 $UPDATE_NOTES = "Anrede "Firma" hinzugefügt.";
155 case "0.2.3": // SQL queries for v0.2.3
156 // Update notes (these will be set as task text!)
157 $UPDATE_NOTES = "Datumsformat festgelegt auf ausführlich.";
160 case "0.2.4": // SQL queries for v0.2.4
161 // Update notes (these will be set as task text!)
162 $UPDATE_NOTES = "Wörter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
165 case "0.2.5": // SQL queries for v0.2.5
166 // Update notes (these will be set as task text!)
167 $UPDATE_NOTES = "SQL-Anweisungen abgesichert.";
170 case "0.2.6": // SQL queries for v0.2.6
171 // Update notes (these will be set as task text!)
172 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
175 case "0.2.7": // SQL queries for v0.2.7
176 // Update notes (these will be set as task text!)
177 $UPDATE_NOTES = "Sicherheitsupdate für die Include-Befehle.";
180 case "0.2.8": // SQL queries for v0.2.8
181 // Update notes (these will be set as task text!)
182 $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
185 case "0.2.9": // SQL queries for v0.2.9
186 $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)";
188 // Update notes (these will be set as task text!)
189 $UPDATE_NOTES = "Admin-Kontaktformular hinzugefügt.";
192 case "0.3.0": // SQL queries for v0.3.0
193 // Update notes (these will be set as task text!)
194 $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.<br />Diverse Fixes für <em>0.2.1-Beta1</em> Release.";
197 case "0.3.1": // SQL queries for v0.3.1
198 $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_admin_menu` SET `title` = 'Mitglieder-Management' WHERE `action`='user' AND (`what`='' OR `what` IS NULL) LIMIT 1";
200 // Update notes (these will be set as task text!)
201 $UPDATE_NOTES = "Verwaltung auf Management umgestellt";
204 case "0.3.2": // SQL queries for v0.3.2
205 // Update notes (these will be set as task text!)
206 $UPDATE_NOTES = "PHP-Hinweis in Userauflistung gefixt (trat bei fehlender nickname-Erweiterung auf) und Darstellungsfehler von <strong>0.00000</strong> unbestätigten Mails gefixt.";
209 case "0.3.3": // SQL queries for v0.3.3
210 // Update notes (these will be set as task text!)
211 $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 <em>task</em>!)";
214 case "0.3.4": // SQL queries for v0.3.4
215 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `select_user_zero_refid` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
216 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_min_confirmed` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 10";
217 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `rand_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
219 // Update notes (these will be set as task text!)
220 $UPDATE_NOTES = "Mitglieder werden per Zufall als Referal-ID ausgewählt, die eine Mindestanzahl an bestätigten Mails haben, wenn die Ref-Id 0 ist.";
223 case "0.3.5": // SQL queries for v0.3.5
224 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `lock_reason` TINYTEXT";
225 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'";
226 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day'] * 30)."";
227 $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_user_del','Löschungen auflisten','Listet die Löschungen von Usern auf.', 9)";
228 $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_user_del`";
229 $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_user_del` (
230 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
231 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
232 `email` VARCHAR(255) NOT NULL DEFAULT '',
233 `surname` VARCHAR(255) NOT NULL DEFAULT '',
234 `family` VARCHAR(255) NOT NULL DEFAULT '',
235 `joined` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
236 `last_online` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
237 `del_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
238 `del_reason` TINYTEXT,
241 ) TYPE=MyISAM COMMENT='List of deleted users'";
243 // Update notes (these will be set as task text!)
244 $UPDATE_NOTES = "Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet.";
249 case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
252 default: // Do stuff when extension is loaded
256 // Keep this extension always active!
257 $EXT_ALWAYS_ACTIVE = "Y";