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