2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 01/14/2013 *
4 * =================== Last change: 01/14/2013 *
6 * -------------------------------------------------------------------- *
7 * File : mode-update.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Steps for updates on ext-user *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Schritte fuer Updates fuer ext-user *
12 * -------------------------------------------------------------------- *
13 * Copyright (c) 2003 - 2009 by Roland Haeder *
14 * Copyright (c) 2009 - 2016 by Mailer Developer Team *
15 * For more information visit: http://mxchange.org *
17 * This program is free software; you can redistribute it and/or modify *
18 * it under the terms of the GNU General Public License as published by *
19 * the Free Software Foundation; either version 2 of the License, or *
20 * (at your option) any later version. *
22 * This program is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
25 * GNU General Public License for more details. *
27 * You should have received a copy of the GNU General Public License *
28 * along with this program; if not, write to the Free Software *
29 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
31 ************************************************************************/
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
38 // @TODO Remove double tabs from all lines
39 switch (getCurrentExtensionVersion()) {
40 case '0.1.0': // SQL queries for v0.1
41 addConfigAddSql('user_limit', 'INT(7) UNSIGNED NOT NULL DEFAULT 20');
43 // Update notes (these will be set as task text!)
44 setExtensionUpdateNotes("Seitenweises Anzeigen der User-Liste ist nun möglich.");
47 case '0.1.1': // SQL queries for v0.1.1
48 // Update notes (these will be set as task text!)
49 setExtensionUpdateNotes("Ungültiges Update.");
52 case '0.1.2': // SQL queries for v0.1.2
53 addExtensionAddTableColumnSql('user_data', 'mails_confirmed', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
55 // Update notes (these will be set as task text!)
56 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.");
59 case '0.1.3': // SQL queries for v0.1.3
60 // Update notes (these will be set as task text!)
61 setExtensionUpdateNotes("Den Pfad <span class=\"bad\">Sie sind hier</span> im Menüpunkt <u>Online-Liste</u> erweitert.");
64 case '0.1.4': // SQL queries for v0.1.4
65 addExtensionAddTableColumnSql('user_data', 'emails_received', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
67 // Update notes (these will be set as task text!)
68 setExtensionUpdateNotes("Anzahl empfangener Mails wird angezeigt. <big>Diese Anzeige kann fehlerhaft sein, wenn Sie bereits Mitglieder in Ihrem {?mt_word?} haben sollen!</big>");
71 case '0.1.5': // SQL queries for v0.1.5
72 // Update notes (these will be set as task text!)
73 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
76 case '0.1.6': // SQL queries for v0.1.6
77 // Update notes (these will be set as task text!)
78 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
81 case '0.1.7': // SQL queries for v0.1.7
82 // Update notes (these will be set as task text!)
83 setExtensionUpdateNotes("Erweiterung bleibt wegen integrierten Schalters immer aktiv.");
86 case '0.1.8': // SQL queries for v0.1.8
87 // Update notes (these will be set as task text!)
88 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
91 case '0.1.9': // SQL queries for v0.1.9
92 // Update notes (these will be set as task text!)
93 setExtensionUpdateNotes("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
96 case '0.2.0': // SQL queries for v0.2.0
97 // Update notes (these will be set as task text!)
98 setExtensionUpdateNotes("User-Liste ausgelagert in Templates und überbreite Zeile in 2er-Zeile umgewandelt.");
101 case '0.2.1': // SQL queries for v0.2.1
102 addConfigAddSql('user_alpha', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
103 addAdminMenuSql('setup','config_user','Mitgliederliste','Anzahl Mitglieder pro Seite, Anzahl Buchstaben pro Zeile usw.', 8);
105 // Update notes (these will be set as task text!)
106 setExtensionUpdateNotes("User-Liste ist konfigurierbar: Anzahl Mitglieder pro Seite und Anzahl Buchstaben pro Zeile; Template-Fehler beseitigt.");
109 case '0.2.3': // SQL queries for v0.2.3
110 // Update notes (these will be set as task text!)
111 setExtensionUpdateNotes("Datumsformat festgelegt auf ausführlich.");
114 case '0.2.4': // SQL queries for v0.2.4
115 // Update notes (these will be set as task text!)
116 setExtensionUpdateNotes("Wörter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
119 case '0.2.5': // SQL queries for v0.2.5
120 // Update notes (these will be set as task text!)
121 setExtensionUpdateNotes("SQL-Anweisungen abgesichert.");
124 case '0.2.6': // SQL queries for v0.2.6
125 // Update notes (these will be set as task text!)
126 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
129 case '0.2.7': // SQL queries for v0.2.7
130 // Update notes (these will be set as task text!)
131 setExtensionUpdateNotes("Sicherheitsupdate für die Include-Befehle.");
134 case '0.2.8': // SQL queries for v0.2.8
135 // Update notes (these will be set as task text!)
136 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
139 case '0.2.9': // SQL queries for v0.2.9
140 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);
142 // Update notes (these will be set as task text!)
143 setExtensionUpdateNotes("Admin-Kontaktformular hinzugefügt.");
146 case '0.3.0': // SQL queries for v0.3.0
147 // Update notes (these will be set as task text!)
148 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.<br />Diverse Fixes für <span class=\"bad\">0.2.1-Beta1</span> Release.");
151 case '0.3.1': // SQL queries for v0.3.1
152 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title` = 'Mitglieder-Management' WHERE `action`='user' AND (`what`='' OR `what` IS NULL) LIMIT 1");
154 // Update notes (these will be set as task text!)
155 setExtensionUpdateNotes("Verwaltung auf Management umgestellt");
158 case '0.3.2': // SQL queries for v0.3.2
159 // Update notes (these will be set as task text!)
160 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ätigten Mails gefixt.");
163 case '0.3.3': // SQL queries for v0.3.3
164 // Update notes (these will be set as task text!)
165 setExtensionUpdateNotes("Mitglieder sind nun per Formular kontaktierbar (es wird eine EMail versendet), gesperrte und bestätigte Mitgliedaccounts sind seperat oder gemeinsam auflistbar (seperat nur mit der Erweiterung <span class=\"bad\">task</span>!)");
168 case '0.3.4': // SQL queries for v0.3.4
169 addConfigAddSql('select_user_zero_refid', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
170 addConfigAddSql('user_min_confirmed', 'SMALLINT(5) UNSIGNED NOT NULL DEFAULT 10');
171 addExtensionAddTableColumnSql('user_data', 'rand_confirmed', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
173 // Update notes (these will be set as task text!)
174 setExtensionUpdateNotes("Mitglieder werden per Zufall als Referral-Id ausgewählt, die eine Mindestanzahl an bestätigten Mails haben, wenn die Ref-Id 0 ist.");
177 case '0.3.5': // SQL queries for v0.3.5
178 addExtensionAddTableColumnSql('user_data', 'lock_reason', 'TINYTEXT');
179 addExtensionAddTableColumnSql('user_data', 'lock_timestamp', 'TIMESTAMP NULL DEFAULT NULL');
180 addConfigAddSql('user_delete_purge', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 30));
181 addAdminMenuSql('user', 'list_user_del', 'Löschungen auflisten', 'Listet die Löschungen von Usern auf.', 9);
182 addDropTableSql('user_del');
183 addCreateTableSql('user_del', "
184 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
185 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
186 `email` VARCHAR(255) NOT NULL DEFAULT '',
187 `surname` VARCHAR(255) NOT NULL DEFAULT '',
188 `family` VARCHAR(255) NOT NULL DEFAULT '',
189 `joined` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
190 `last_online` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
191 `del_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
192 `del_reason` TINYTEXT NOT NULL,
195 'List of deleted users');
197 // Update notes (these will be set as task text!)
198 setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet.");
201 case '0.3.6': // SQL queries for v0.3.6
202 addExtensionDropTableIndexSql('user_cats', 'userid');
203 addExtensionAddTableUniqueSql('user_cats', 'userid_catid', '(`userid`, `cat_id`)');
205 // Update notes (these will be set as task text!)
206 setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet.");
209 case '0.3.7': // SQL queries for v0.3.7
210 addExtensionChangeTableColumnSql('user_points', 'id', 'id', 'BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT');
211 addExtensionChangeTableColumnSql('user_points', 'userid', 'userid', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
212 addExtensionChangeTableColumnSql('user_data', 'userid', 'userid', 'BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT');
213 addExtensionChangeTableColumnSql('user_del', 'userid', 'userid', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
214 addExtensionChangeTableColumnSql('user_links', 'stats_id', 'stats_id', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
215 addExtensionChangeTableColumnSql('user_links', 'userid', 'userid', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
216 addExtensionChangeTableColumnSql('user_points', 'userid', 'userid', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
217 addExtensionChangeTableColumnSql('user_points', 'ref_depth', 'ref_depth', 'TINYINT(3) UNSIGNED NULL DEFAULT NULL');
218 addExtensionChangeTableColumnSql('user_stats', 'userid', 'userid', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
219 addExtensionChangeTableColumnSql('user_stats', 'cat_id', 'cat_id', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
220 addExtensionChangeTableColumnSql('user_stats', 'payment_id', 'payment_id', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
221 addExtensionChangeTableColumnSql('user_stats', 'pool_id', 'pool_id', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
222 addExtensionChangeTableColumnSql('user_stats_data', 'userid', 'userid', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
225 addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `userid` IS NULL OR `cat_id` IS NULL');
226 addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_del` WHERE `userid` IS NULL');
227 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_links` SET `stats_id`=NULL WHERE `stats_id`=0');
228 addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid` IS NULL');
229 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `ref_depth`=NULL WHERE `ref_depth`=0');
230 addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_points` WHERE `userid` IS NULL');
231 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `cat_id`=NULL WHERE `cat_id`=0');
232 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `payment_id`=NULL WHERE `payment_id`=0');
233 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `pool_id`=NULL WHERE `pool_id`=0');
234 addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `userid` IS NULL');
236 // Update notes (these will be set as task text!)
237 setExtensionUpdateNotes("NULL ist wichtiger als 0 und UNSIGNED auch.");
240 case '0.3.8': // SQL queries for v0.3.8
241 addExtensionChangeTableColumnSql('user_data', 'last_failure', 'last_failure', 'TIMESTAMP NULL DEFAULT NULL');
243 // Update notes (these will be set as task text!)
244 setExtensionUpdateNotes("Ausgangswert ist nicht mehr 0000-00-00 00:00:00, sondern einfach NULL.");
247 case '0.3.9': // SQL queries for v0.3.9
248 // Update notes (these will be set as task text!)
249 setExtensionUpdateNotes("Update verschoben nach ext-order (da es Werbeguthaben ist und nichts mit dem Mitglied selbst zu tun hat).");
252 case '0.4.0': // SQL queries for v0.4.0
253 // Register new filters for gathering points
254 registerFilter(__FILE__, __LINE__, 'get_total_points', 'USER_POINTS', FALSE, TRUE, isExtensionDryRun());
255 registerFilter(__FILE__, __LINE__, 'get_own_points', 'USER_POINTS', FALSE, TRUE, isExtensionDryRun());
257 // Update notes (these will be set as task text!)
258 setExtensionUpdateNotes("Filter registriert, die das eigene {?POINTS?}-Guthaben des Mitgliedes zurückliefern.");
261 case '0.4.1': // SQL queries for v0.4.1
262 // Add special fix include to fix filters
263 addIncludeToPool('extension', 'inc/fixes/fix_user_points.php');
265 // Update notes (these will be set as task text!)
266 setExtensionUpdateNotes("Das Mitgliederguthaben musste repariert werden, da für Referral-Ebene 0, noch NULL geschrieben wurde.");
269 case '0.4.2': // SQL queries for v0.4.2
270 // Add special fix include to fix filters
271 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='chk_regs' LIMIT 1");
273 // Update notes (these will be set as task text!)
274 setExtensionUpdateNotes("Überflüssiges Menü <strong>chk_regs</strong> entfernt, dies kann mit <strong>list_user</strong> übernommen werden.");
277 case '0.4.3': // SQL queries for v0.4.3
278 // Add special fix include to fix filters
279 addExtensionChangeTableColumnSql('user_data', 'refid', 'refid', 'BIGINT(20) NULL DEFAULT NULL');
281 // Update notes (these will be set as task text!)
282 setExtensionUpdateNotes("Überflüssiges Menü <strong>chk_regs</strong> entfernt, dies kann mit <strong>list_user</strong> übernommen werden.");
285 case '0.4.4': // SQL queries for v0.4.4
286 addDropTableSql('user_refs');
287 addCreateTableSql('user_refs', "
288 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
289 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
290 `level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0,
291 `refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
293 UNIQUE `user_refid` (`userid`, `level`, `refid`),
298 // Load ext-refback's special include to regenerate the referral table
299 addIncludeToPool('extension', 'inc/fixes/fix_refsystem.php');
301 // Update notes (these will be set as task text!)
302 setExtensionUpdateNotes("Neues Tabellenlayout und verschoben von ext-refback.");
305 case '0.4.5': // SQL queries for v0.4.5
306 addExtensionChangeTableColumnSql('user_links', 'link_type', 'link_type', "VARCHAR(255) NOT NULL DEFAULT 'NORMAL'");
308 // Update notes (these will be set as task text!)
309 setExtensionUpdateNotes("Die Spalte <strong>link_type</strong> ist nun kein ENUM mehr, um weitere Mailtypen zu erlauben.");
312 case '0.4.6': // SQL queries for v0.4.6
313 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_CONFIG}POINTS{CLOSE_CONFIG} gutschreiben' WHERE `what` = 'add_points' LIMIT 1");
314 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen' WHERE `what` = 'sub_points' LIMIT 1");
315 addAdminMenuSql('user','sub_points','{OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen','Allen oder einem Mitglied {OPEN_CONFIG}POINTS{CLOSE_CONFIG} abziehen.', 8);
317 // This update depends on ext-menu update
318 addExtensionDependency('menu');
320 // Update notes (these will be set as task text!)
321 setExtensionUpdateNotes("Abzug von {?POINTS?} sollte nun dabei sein und Hinzufügen gefixt (war zu kurze Spalte).");
324 case '0.4.7': // SQL queries for v0.4.7
325 addExtensionChangeTableColumnSql('user_data', 'lock_timestamp', 'lock_timestamp', 'TIMESTAMP NULL DEFAULT NULL');
326 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `lock_timestamp`=NULL WHERE `lock_timestamp`='0000-00-00 00:00:00'");
328 // Update notes (these will be set as task text!)
329 setExtensionUpdateNotes("0000-00-00 00:00:00 ist kein Standardwert mehr, NULL ist dies.");
332 case '0.4.8': // SQL queries for v0.4.8
333 // Update notes (these will be set as task text!)
334 setExtensionUpdateNotes("Dieses Update ist nicht mehr gültig.");
337 case '0.4.9': // SQL queries for v0.4.9
338 addExtensionChangeTableColumnSql('user_data', 'last_module', 'last_what', 'VARCHAR(255) NULL DEFAULT NULL');
340 // Register filter locked points
341 registerFilter(__FILE__, __LINE__, 'get_locked_points', 'LOCKED_USER_POINTS', FALSE, TRUE, isExtensionDryRun());
343 // Register filter for all column names
344 registerFilter(__FILE__, __LINE__, 'get_all_point_columns', 'GET_ALL_USER_POINTS_COLUMN_NAMES', FALSE, TRUE, isExtensionDryRun());
346 // Update notes (these will be set as task text!)
347 setExtensionUpdateNotes("Die Spalte <strong>last_module</strong> ist nach <strong>last_what</strong> umbenannt und hat nun NULL als Ausgangswert und Filter für gesperrtes Guthaben hinzugefügt.");
350 case '0.5.0': // SQL queries for v0.5.0
351 // Prefix for all test accounts
352 addConfigAddSql('tester_user_maximum', 'INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT 00999');
353 addConfigAddSql('tester_user_sex', "ENUM('M','F') NOT NULL DEFAULT 'M'");
354 addConfigAddSql('tester_user_surname_prefix', "VARCHAR(255) NOT NULL DEFAULT 'tester_'");
355 addConfigAddSql('tester_user_family', "VARCHAR(255) NOT NULL DEFAULT 'Testbenutzer'");
356 addConfigAddSql('tester_user_street_nr', "VARCHAR(255) NOT NULL DEFAULT 'Teststraße 123'");
357 addConfigAddSql('tester_user_zip', 'INT(6) UNSIGNED NOT NULL DEFAULT 12345');
358 addConfigAddSql('tester_user_city', "VARCHAR(255) NOT NULL DEFAULT 'Teststadt'");
359 addConfigAddSql('tester_user_email', "VARCHAR(255) NOT NULL DEFAULT '{OPEN_CONFIG}WEBMASTER{CLOSE_CONFIG}'");
360 addConfigAddSql('tester_user_default_refid', 'BIGINT(20) NULL DEFAULT NULL');
361 addConfigAddSql('tester_user_password', "VARCHAR(255) NOT NULL DEFAULT ''");
362 addConfigAddSql('tester_user_check_cat', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
365 addAdminMenuSql('user', 'add_tester_user', 'Testbenutzer anlegen', 'Es können hier bis zu 100 Testbenutzer angelegt werden. Diese haben als Vornamen immer den Präfix <span class="data">{?tester_user_surname_prefix?}</span> und werden bei Null anfangend bis 99 hochgezält.', 1);
366 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Mitglieder auflisten' WHERE `what`='list_user' LIMIT 1");
368 // Change 'zip' to INT(6)
369 addExtensionChangeTableColumnSql('user_data', 'zip', 'zip', 'INT(6) NOT NULL DEFAULT 0');
371 // Register filter for WHERE/AND exclusion/inclusion statements
372 registerFilter(__FILE__, __LINE__, 'user_exclusion_sql', 'TESTER_USER_EXCLUSION_SQL', FALSE, TRUE, isExtensionDryRun());
373 registerFilter(__FILE__, __LINE__, 'user_inclusion_sql', 'TESTER_USER_INCLUSION_SQL', FALSE, TRUE, isExtensionDryRun());
375 // Update notes (these will be set as task text!)
376 setExtensionUpdateNotes("Es können nun Test-Benutzer angelegt werden. Noch müssen diese überall ausgeschlossen werden, damit die Mediadaten nicht unnötig verfälscht werden.");
379 case '0.5.1': // SQL queries for v0.5.1
381 registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'TESTER_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
383 // Update notes (these will be set as task text!)
384 setExtensionUpdateNotes("Filter zum Hinzufügen von SQL-Spalten für die Mitgliederanmeldung hinzugefügt.");
387 case '0.5.2': // SQL queries for v0.5.2
389 registerFilter(__FILE__, __LINE__, 'convert_user_data_columns', 'ADD_USER_DATA_CONVERT_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
391 // Update notes (these will be set as task text!)
392 setExtensionUpdateNotes("Filter zum Hinzufügen von SQL-Spalten für die Mitgliederanmeldung hinzugefügt.");
395 case '0.5.3': // SQL queries for v0.5.3
397 registerFilter(__FILE__, __LINE__, 'post_refid_validation', 'HANDLE_USER_SUBID', FALSE, TRUE, isExtensionDryRun());
398 registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
401 addAdminMenuSql('user', 'list_user_subid', 'Sub-Ids', 'Listet alle pro vom Mitglied eingegebenen Sub-Ids und ermittelten Referral-URLs auf.', 7);
404 addMemberMenuSql('extras', 'subids', 'Sub-Id Tracking', 4);
406 // Add table for subids
407 addDropTableSql('user_subids');
408 addCreateTableSql('user_subids', "
409 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
410 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
411 `subid` VARCHAR(255) NOT NULL DEFAULT '',
412 `subid_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
414 UNIQUE `user_subid` (`userid`, `subid`),
418 // Add table for subid logging
419 addDropTableSql('subid_log');
420 addCreateTableSql('subid_log', "
421 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
422 `refid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
423 `subid` VARCHAR(255) NOT NULL DEFAULT '',
424 `referral_url` TINYTEXT NOT NULL,
425 `remote_address` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
426 `entry_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
432 // For saving used subid in user_data table
433 addExtensionAddTableColumnSql('user_data', 'subid', 'VARCHAR(255) NULL DEFAULT NULL');
434 addExtensionAddTableIndexSql('user_data', 'subid', '(`subid`)');
436 // Configuration entry for purging old subid logs (7 days default)
437 addConfigAddSql('user_subid_purge', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
439 // Update notes (these will be set as task text!)
440 setExtensionUpdateNotes("Filter, Datenbanktabelle und Menüpunkte für SubId-Tracking hinzugefügt.");
443 case '0.5.4': // SQL queries for v0.5.4
445 registerFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', FALSE, TRUE, isExtensionDryRun());
446 registerFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', FALSE, TRUE, isExtensionDryRun());
449 addExtensionAddTableColumnSql('subid_log', 'user_agent', 'TINYTEXT NOT NULL AFTER `remote_address`');
451 // Update notes (these will be set as task text!)
452 setExtensionUpdateNotes("Weitere Filter für Referral-Counter und Sub-Id hinzugefügt.");
455 case '0.5.5': // SQL queries for v0.5.5
457 registerFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', FALSE, TRUE, isExtensionDryRun());
459 // Update notes (these will be set as task text!)
460 setExtensionUpdateNotes("Weiteren Filter für Mitglieder-Aktionen im Adminbereich hinzugefügt.");
463 case '0.5.6': // SQL queries for v0.5.6
465 registerFilter(__FILE__, __LINE__, 'member_reflink_extra_content', 'MEMBER_REFLINK_USER_SUBIDS_CONTENT', FALSE, TRUE, isExtensionDryRun());
467 // Update notes (these will be set as task text!)
468 setExtensionUpdateNotes("Weiteren Filter für Mitglieder-Aktionen im Adminbereich hinzugefügt.");
471 case '0.5.7': // SQL queries for v0.5.7
473 addAdminMenuSql('user', 'list_user_amounts', 'Guthaben anzeigen', 'Listet alle Mitglieder und deren Guthaben inklusive Abzug auf.', 8);
475 // Update notes (these will be set as task text!)
476 setExtensionUpdateNotes("Menü zum Auflisten des Guthabens hinzugefügt. Diese Daten sollen noch später weiter verarbeitet werden. Zum Beispiel soll dann schnell feststellbar sein, welche Verdienstgruppe das meiste und wenigste {?POINTS?}-Volumen besitzt.");
479 case '0.5.8': // SQL queries for v0.5.8
480 addConfigAddSql('ap_subids', "ENUM('Y', 'N') NOT NULL DEFAULT 'Y'");
481 addConfigAddSql('ap_subids_since', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
484 addAdminMenuSql('setup', 'config_user_subid', 'Sub-Id Tracking', 'Ändern Sie hier alle Einstellungen zu den Sub-Ids.', 10);
486 // Update notes (these will be set as task text!)
487 setExtensionUpdateNotes("Bereinigung von Sub-Ids und deren Einstellungen hinzugefügt.");
490 case '0.5.9': // SQL queries for v0.5.9
491 addExtensionChangeTableColumnSql('subid_log', 'refid', 'refid', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
492 addExtensionChangeTableColumnSql('user_stats', 'cat_id', 'cat_id', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
493 addExtensionChangeTableColumnSql('user_stats', 'payment_id', 'payment_id', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
494 addExtensionChangeTableColumnSql('user_stats', 'pool_id', 'pool_id', 'BIGINT(20) UNSIGNED NULL DEFAULT NULL');
495 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_subid_log` SET `refid`=NULL WHERE `refid`=0');
496 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `cat_id`=NULL WHERE `cat_id`=0');
497 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `payment_id`=NULL WHERE `payment_id`=0');
498 addExtensionSql('UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `pool_id`=NULL WHERE `pool_id`=0');
500 // Update notes (these will be set as task text!)
501 setExtensionUpdateNotes("Besser NULL anstelle 0.");
504 case '0.6.0': // SQL queries for v0.6.0
505 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `what`='list_user_cats' WHERE `action`='user' AND `what`='list_cats' LIMIT 1");
507 // Update notes (these will be set as task text!)
508 setExtensionUpdateNotes("Menüpunkt umbenannt um Platz für Konflikt mit <strong>what-config_cats.php</strong> zu schaffen.");
511 case '0.6.1': // SQL queries for v0.6.1
512 // Add table for user login provider
513 addDropTableSql('user_login_provider');
514 addCreateTableSql('user_login_provider', "
515 `provider_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
516 `provider_name` VARCHAR(255) NOT NULL DEFAULT 'local_generic_user_login',
517 `provider_extension` VARCHAR(255) NOT NULL DEFAULT 'user',
518 `provider_is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
519 PRIMARY KEY (`provider_id`)",
520 'User login providers');
522 // Add (activated) default entry
523 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_login_provider` (`provider_is_active`) VALUES ('Y')");
526 addAdminMenuSql('setup', 'list_user_login_provider', 'MLPs verwalten', 'Alle Mitgliederlogin-Provider (MLP) auflisten und verwalten.', 10);
528 // Update notes (these will be set as task text!)
529 setExtensionUpdateNotes("Tabelle für Mitgliedslogin-Provider hinzugefügt.");
532 case '0.6.2': // SQL queries for v0.6.2
534 registerFilter(__FILE__, __LINE__, 'user_login', 'GENERIC_USER_LOGIN', FALSE, TRUE, isExtensionDryRun());
535 registerFilter(__FILE__, __LINE__, 'check_user_login', 'GENERIC_USER_LOGIN_CHECK', FALSE, TRUE, isExtensionDryRun());
537 // Add column for login provider
538 addExtensionAddTableColumnSql('user_data', 'login_provider', "VARCHAR (255) NOT NULL DEFAULT 'user'");
541 // @TODO Make configurable through web interface
542 addConfigAddSql('default_login_provider', "VARCHAR(255) NOT NULL DEFAULT 'login'");
544 // Update notes (these will be set as task text!)
545 setExtensionUpdateNotes("Filter für das Handling der Loginanfragen hinzugeügt.");
548 case '0.6.3': // SQL queries for v0.6.3
549 addExtensionAddTableColumnSql('user_data', 'confirmed_timestamp', 'TIMESTAMP NULL DEFAULT NULL');
550 addExtensionAddTableColumnSql('user_data', 'confirmed_ip_address', 'VARCHAR(255) NULL DEFAULT NULL');
552 // Update notes (these will be set as task text!)
553 setExtensionUpdateNotes("Spalten für Bestätigungszeitpunkt und IP-Adresse hinzugefügt.");
556 case '0.6.4': // SQL queries for v0.6.4
557 addExtensionChangeTableColumnSql('user_data', 'gender', 'sex', "ENUM('M','F','C') NOT NULL DEFAULT 'M'");
559 // Update notes (these will be set as task text!)
560 setExtensionUpdateNotes("Spalte <code>gender</code> nach <code>sex</code> umbenannt.");