Several fixes for UTF-8, ext-network continued (still unfinished)
[mailer.git] / inc / extensions / ext-user.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 04/29/2004 *
4  * ================                             Last change: 10/29/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-user.php                                     *
8  * -------------------------------------------------------------------- *
9  * Short description : Swapped out user management                      *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Ausgelagertes Mitglieder-Management              *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
21  * For more information visit: http://www.mxchange.org                  *
22  *                                                                      *
23  * This program is free software; you can redistribute it and/or modify *
24  * it under the terms of the GNU General Public License as published by *
25  * the Free Software Foundation; either version 2 of the License, or    *
26  * (at your option) any later version.                                  *
27  *                                                                      *
28  * This program is distributed in the hope that it will be useful,      *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
31  * GNU General Public License for more details.                         *
32  *                                                                      *
33  * You should have received a copy of the GNU General Public License    *
34  * along with this program; if not, write to the Free Software          *
35  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
36  * MA  02110-1301  USA                                                  *
37  ************************************************************************/
38
39 // Some security stuff...
40 if (!defined('__SECURITY')) {
41         die();
42 } // END - if
43
44 // Version number
45 setThisExtensionVersion('0.3.5');
46
47 // Version history array (add more with , '0.1.0' and so on)
48 setExtensionVersionHistory(array('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'));
49
50 // Keep this extension always active!
51 setExtensionAlwaysActive('Y');
52
53 switch (getExtensionMode()) {
54         case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
55                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`");
56                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_cats` (
57   `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
58   `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
59   `cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
60 PRIMARY KEY  (`id`),
61 INDEX (`userid`),
62 INDEX (`cat_id`)
63 ) TYPE={?_TABLE_TYPE?}");
64
65                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`");
66                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_data` (
67   `userid` BIGINT(22) NOT NULL AUTO_INCREMENT,
68   `surname` VARCHAR(255) NOT NULL DEFAULT '',
69   `family` VARCHAR(255) NOT NULL DEFAULT '',
70   `street_nr` VARCHAR(255) NOT NULL DEFAULT '',
71   `country` VARCHAR(4) NOT NULL DEFAULT '',
72   `zip` VARCHAR(6) NOT NULL DEFAULT '',
73   `city` VARCHAR(255) NOT NULL DEFAULT '',
74   `email` VARCHAR(255) NOT NULL DEFAULT '',
75   `birth_day` CHAR(2) NOT NULL DEFAULT '01',
76   `birth_month` CHAR(2) NOT NULL DEFAULT '01',
77   `birth_year` VARCHAR(4) NOT NULL DEFAULT '1970',
78   `password` VARCHAR(255) NOT NULL DEFAULT '',
79   `max_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
80   `receive_mails` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
81   `refid` BIGINT(22) NOT NULL DEFAULT 0,
82   `status` ENUM('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
83   `user_hash` VARCHAR(255) NULL DEFAULT NULL,
84   `REMOTE_ADDR` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
85   `last_online` VARCHAR(10) NOT NULL DEFAULT 0,
86   `last_module` VARCHAR(255) NOT NULL DEFAULT '',
87   `ref_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
88   `total_logins` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
89   `gender` ENUM('M','F') NOT NULL DEFAULT 'M',
90   `used_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
91   `emails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
92   `joined` VARCHAR(10) NOT NULL DEFAULT 0,
93   `last_update` VARCHAR(10) NOT NULL DEFAULT 0,
94   `last_profile_sent` VARCHAR(10) NOT NULL DEFAULT 0,
95   `notified` ENUM('Y','N') NOT NULL DEFAULT 'N',
96   `ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
97   `last_login` VARCHAR(10) NOT NULL DEFAULT 0,
98   `login_failures` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
99   `last_failure` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
100 PRIMARY KEY  (`userid`),
101 UNIQUE (`user_hash`),
102 INDEX (`refid`),
103 INDEX `status_mails` (`status`,`max_mails`)
104 ) TYPE={?_TABLE_TYPE?}");
105
106                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`");
107                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_points` (
108   `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
109   `userid` BIGINT(22) NOT NULL DEFAULT 0,
110   `ref_depth` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
111   `points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
112   `locked_points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
113 PRIMARY KEY  (`id`),
114 INDEX (`userid`)
115 ) TYPE={?_TABLE_TYPE?}");
116
117                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`");
118                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_links` (
119   `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
120   `stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
121   `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
122   `link_type` ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL',
123 PRIMARY KEY  (`id`),
124 INDEX (`userid`),
125 INDEX (`stats_id`)
126 ) TYPE={?_TABLE_TYPE?}");
127
128                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`");
129                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats` (
130   `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
131   `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
132   `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
133   `payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
134   `subject` VARCHAR(200) NOT NULL DEFAULT '',
135   `url` TINYTEXT NOT NULL,
136   `max_rec` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
137   `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
138   `timestamp_ordered` VARCHAR(10) NOT NULL DEFAULT '',
139   `pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
140   `timestamp_sstart` VARCHAR(10) NOT NULL DEFAULT '',
141   `timestamp_send` VARCHAR(10) NOT NULL DEFAULT '',
142   `is_stats` ENUM('Y','N') NOT NULL DEFAULT 'N',
143 PRIMARY KEY  (`id`),
144 INDEX (`userid`),
145 INDEX (`cat_id`),
146 INDEX (`payment_id`),
147 INDEX (`pool_id`)
148 ) TYPE={?_TABLE_TYPE?}");
149
150                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`");
151                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats_data` (
152 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
153 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
154 `stats_type` VARCHAR(255) NOT NULL DEFAULT 'unknown',
155 `stats_data` VARCHAR(255) NOT NULL DEFAULT '',
156 `inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
157 PRIMARY KEY (`id`),
158 INDEX (`userid`),
159 INDEX (`stats_type`)
160 ) TYPE={?_TABLE_TYPE?} COMMENT='Member statistics data'");
161
162                 // Admin menu
163                 addAdminMenuSql('user',NULL,'Mitglieder-Management','Mitglieder freischalten, sperren, Accounts editieren, Neuanmeldungen verwalten, {OPEN_CONFIG}POINTS{CLOSE_CONFIG} gutschreiben und abziehen und und und...',3);
164                 addAdminMenuSql('user','del_user','Mitglied l&ouml;schen','L&ouml;schen Sie hier Mitglied, die gegen die AGBs mehrmals verstossen haben. Bitte seien Sie nett zu Ihren Mitgliedern und l&ouml;schen Sie nicht gleich.',1);
165                 addAdminMenuSql('user','chk_regs','Anmeldungen pr&uuml;fen','Pr&uuml;fen Sie hier neue Anmeldungen zu Ihrem System. Hier k&ouml;nnen Sie im Falle einer Fehler-Mail den Mitglied gleich wieder l&ouml;schen!',2);
166                 addAdminMenuSql('user','lock_user','Mitglied sperren / entsperren','Sperren Sie Mitglied, die zu viele unbest&auml;tigte Mails haben oder gegen Ihre AGBs verstossen haben &uuml;ber diesen Men&uuml;punkt.',3);
167                 addAdminMenuSql('user','list_user','Mitglied auflisten','Listen Sie alle Mitglied oder eingeschr&auml;nkt nach Suchkritieren Ihre Userdatenbank auf. Sie k&ouml;nen per Klick auf die Usernummer sich Details zum Mitglied ansehen.',4);
168                 addAdminMenuSql('user','add_points','{OPEN_CONFIG}POINTS{CLOSE_CONFIG} gutschreiben','Buchen Sie einem Mitglied direkt {OPEN_CONFIG}POINTS{CLOSE_CONFIG} auf. Sie k&ouml;nnen dazu auch einen Kommentar mitsenden.',5);
169                 addAdminMenuSql('user','edit_user','Account editieren','Daten eines Mitglieder-Accountes &auml;ndern.',6);
170                 addAdminMenuSql('user','list_refs','Referals anzeigen','Mit diesem Men&uuml;punkt k&ouml;nnen Sie die generierten Referals eines Mitgliedes auflisten.',7);
171                 addAdminMenuSql('user','list_links','Unbest&auml;tigte Mails','Mit diesem Men&uuml;punkt k&ouml;nnen Sie die vom Mitglied nicht best&auml;tigten Mails anzeigen.',8);
172                 addAdminMenuSql('user','list_cats','Kategorien anzeigen','Listet die ausgew&auml;hlten Kategorien eines Mitgliedes auf.',9);
173                 break;
174
175         case 'remove': // Do stuff when removing extension
176                 // SQL commands to run
177                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'");
178                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`");
179                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`");
180                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`");
181                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`");
182                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`");
183                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`");
184                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`");
185                 break;
186
187         case 'activate': // Do stuff when admin activates this extension
188                 // SQL commands to run
189                 addExtensionSql('');
190                 break;
191
192         case 'deactivate': // Do stuff when admin deactivates this extension
193                 // SQL commands to run
194                 addExtensionSql('');
195                 break;
196
197         case 'update': // Update an extension
198                 switch (getCurrentExtensionVersion())
199                 {
200                         case '0.1.0': // SQL queries for v0.1
201                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `user_limit` INT(7) UNSIGNED NOT NULL DEFAULT 20");
202
203                                 // Update notes (these will be set as task text!)
204                                 setExtensionUpdateNotes("Seitenweises Anzeigen der User-Liste ist nun m&ouml;glich.");
205                                 break;
206
207                         case '0.1.1': // SQL queries for v0.1.1
208                                 // This update depends on sql_patches update!
209                                 addExtensionUpdateDependency('sql_patches');
210
211                                 // Update notes (these will be set as task text!)
212                                 setExtensionUpdateNotes("Ung&uuml;ltiges Update.");
213                                 break;
214
215                         case '0.1.2': // SQL queries for v0.1.2
216                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `mails_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
217
218                                 // Update notes (these will be set as task text!)
219                                 setExtensionUpdateNotes("Dem Mitglied wird nun angezeigt, wie viele Mails er best&auml;tigt hat. Alle vor dieser Version best. Mails werden leider nicht mehr ber&uuml;cksichtigt! Bitte teilen Sie dies Ihren Mitgliedern mit.");
220                                 break;
221
222                         case '0.1.3': // SQL queries for v0.1.3
223                                 // Update notes (these will be set as task text!)
224                                 setExtensionUpdateNotes("Den Pfad <em>Sie sind hier</em> im Men&uuml;punkt <u>Online-Liste</u> erweitert.");
225                                 break;
226
227                         case '0.1.4': // SQL queries for v0.1.4
228                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `emails_received` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
229
230                                 // Update notes (these will be set as task text!)
231                                 setExtensionUpdateNotes("Anzahl empfangener Mails wird angezeigt. <big>Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {?mt_word?} haben sollen!</big>");
232                                 break;
233
234                         case '0.1.5': // SQL queries for v0.1.5
235                                 // Update notes (these will be set as task text!)
236                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
237                                 break;
238
239                         case '0.1.6': // SQL queries for v0.1.6
240                                 // Update notes (these will be set as task text!)
241                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
242                                 break;
243
244                         case '0.1.7': // SQL queries for v0.1.7
245                                 // Update notes (these will be set as task text!)
246                                 setExtensionUpdateNotes("Erweiterung bleibt wegen integrierten Schalters immer aktiv.");
247                                 break;
248
249                         case '0.1.8': // SQL queries for v0.1.8
250                                 // Update notes (these will be set as task text!)
251                                 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
252                                 break;
253
254                         case '0.1.9': // SQL queries for v0.1.9
255                                 // Update notes (these will be set as task text!)
256                                 setExtensionUpdateNotes("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
257                                 break;
258
259                         case '0.2.0': // SQL queries for v0.2.0
260                                 // Update notes (these will be set as task text!)
261                                 setExtensionUpdateNotes("User-Liste ausgelagert in Templates und &uuml;berbreite Zeile in 2er-Zeile umgewandelt.");
262                                 break;
263
264                         case '0.2.1': // SQL queries for v0.2.1
265                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `user_alpha` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10");
266                                 addAdminMenuSql('setup','config_user','Mitgliederliste','Anzahl Mitglieder pro Seite, Anzahl Buchstaben pro Zeile usw.', 8);
267
268                                 // Update notes (these will be set as task text!)
269                                 setExtensionUpdateNotes("User-Liste ist konfigurierbar: Anzahl Mitglieder pro Seite und Anzahl Buchstaben pro Zeile; Template-Fehler beseitigt.");
270                                 break;
271
272                         case '0.2.2': // SQL queries for v0.2.2
273                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `gender` `gender` ENUM('M','F','C') NOT NULL DEFAULT 'M'");
274
275                                 // Update notes (these will be set as task text!)
276                                 setExtensionUpdateNotes("Anrede &quot;Firma&quot; hinzugef&uuml;gt.");
277                                 break;
278
279                         case '0.2.3': // SQL queries for v0.2.3
280                                 // Update notes (these will be set as task text!)
281                                 setExtensionUpdateNotes("Datumsformat festgelegt auf ausf&uuml;hrlich.");
282                                 break;
283
284                         case '0.2.4': // SQL queries for v0.2.4
285                                 // Update notes (these will be set as task text!)
286                                 setExtensionUpdateNotes("W&ouml;rter <strong>Mailtausch</strong>, <strong>Mailtausches</strong> und <strong>Mailtauscher</strong> sind austauschbar.");
287                                 break;
288
289                         case '0.2.5': // SQL queries for v0.2.5
290                                 // Update notes (these will be set as task text!)
291                                 setExtensionUpdateNotes("SQL-Anweisungen abgesichert.");
292                                 break;
293
294                         case '0.2.6': // SQL queries for v0.2.6
295                                 // Update notes (these will be set as task text!)
296                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
297                                 break;
298
299                         case '0.2.7': // SQL queries for v0.2.7
300                                 // Update notes (these will be set as task text!)
301                                 setExtensionUpdateNotes("Sicherheitsupdate f&uuml;r die Include-Befehle.");
302                                 break;
303
304                         case '0.2.8': // SQL queries for v0.2.8
305                                 // Update notes (these will be set as task text!)
306                                 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
307                                 break;
308
309                         case '0.2.9': // SQL queries for v0.2.9
310                                 addAdminMenuSql('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);
311
312                                 // Update notes (these will be set as task text!)
313                                 setExtensionUpdateNotes("Admin-Kontaktformular hinzugef&uuml;gt.");
314                                 break;
315
316                         case '0.3.0': // SQL queries for v0.3.0
317                                 // Update notes (these will be set as task text!)
318                                 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.<br />Diverse Fixes f&uuml;r <em>0.2.1-Beta1</em> Release.");
319                                 break;
320
321                         case '0.3.1': // SQL queries for v0.3.1
322                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title` = 'Mitglieder-Management' WHERE `action`='user' AND (`what`='' OR `what` IS NULL) LIMIT 1");
323
324                                 // Update notes (these will be set as task text!)
325                                 setExtensionUpdateNotes("Verwaltung auf Management umgestellt");
326                                 break;
327
328                         case '0.3.2': // SQL queries for v0.3.2
329                                 // Update notes (these will be set as task text!)
330                                 setExtensionUpdateNotes("PHP-Hinweis in Userauflistung gefixt (trat bei fehlender nickname-Erweiterung auf) und Darstellungsfehler von <strong>0.00000</strong> unbest&auml;tigten Mails gefixt.");
331                                 break;
332
333                         case '0.3.3': // SQL queries for v0.3.3
334                                 // Update notes (these will be set as task text!)
335                                 setExtensionUpdateNotes("Mitglieder sind nun per Formular kontaktierbar (es wird eine EMail versendet), gesperrte und best&auml;tigte Mitglieder-Accounts sind seperat oder gemeinsam auflistbar (seperat nur mit der Erweiterung <em>task</em>!)");
336                                 break;
337
338                         case '0.3.4': // SQL queries for v0.3.4
339                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `select_user_zero_refid` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
340                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `user_min_confirmed` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 10");
341                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `rand_confirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
342
343                                 // Update notes (these will be set as task text!)
344                                 setExtensionUpdateNotes("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.");
345                                 break;
346
347                         case '0.3.5': // SQL queries for v0.3.5
348                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_reason` TINYTEXT");
349                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'");
350                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 30)."");
351                                 addAdminMenuSql('user','list_user_del','L&ouml;schungen auflisten','Listet die L&ouml;schungen von Usern auf.', 9);
352                                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`");
353                                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_del` (
354 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
355 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
356 `email` VARCHAR(255) NOT NULL DEFAULT '',
357 `surname` VARCHAR(255) NOT NULL DEFAULT '',
358 `family` VARCHAR(255) NOT NULL DEFAULT '',
359 `joined` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
360 `last_online` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
361 `del_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
362 `del_reason` TINYTEXT,
363 INDEX (`userid`),
364 PRIMARY KEY (`id`)
365 ) TYPE={?_TABLE_TYPE?} COMMENT='List of deleted users'");
366
367                                 // Update notes (these will be set as task text!)
368                                 setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim L&ouml;schen des Users mit ausgesendet.");
369                                 break;
370                 }
371                 break;
372
373         case 'modify': // When the extension got modified
374                 break;
375
376         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
377                 break;
378
379         case 'init': // Do stuff when extension is initialized
380                 break;
381
382         default: // Unknown extension mode
383                 DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
384                 break;
385 }
386
387 // [EOF]
388 ?>