2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 01/23/2013 *
4 * =================== Last change: 01/23/2013 *
6 * -------------------------------------------------------------------- *
7 * File : mode-update.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Swapped out registration system for new members *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Ausgelagertes Anmeldesystem fuer Mitglieder *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2013 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // @TODO Remove double tabs from all lines
44 switch (getCurrentExtensionVersion()) {
45 case '0.1.0': // SQL queries for v0.1.0
46 addDropTableSql('must_register');
47 addCreateTableSql('must_register', "
48 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
49 `field_name` VARCHAR(255) NOT NULL DEFAULT '',
50 `field_required` ENUM('Y','N') NOT NULL DEFAULT 'Y',
52 'Data which fields the user must fill out');
54 // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
55 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('surname', 'Y')");
56 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('family', 'Y')");
57 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('street_nr', 'Y')");
58 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('cntry', 'Y')");
59 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('zip', 'Y')");
60 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('city', 'Y')");
63 addAdminMenuSql('setup','config_register','Pflichtfelder','Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter <strong>Profildaten ändern</strong> ein.', 12);
65 // Update notes (these will be set as task text!)
66 setExtensionUpdateNotes("Einstellbare Pflichtfelder hinzugefügt.");
69 case '0.1.1': // SQL queries for v0.1.1
70 // Update notes (these will be set as task text!)
71 setExtensionUpdateNotes("Veraltetes Update entfernt.");
74 case '0.1.3': // SQL queries for v0.1.3
75 // Update notes (these will be set as task text!)
76 setExtensionUpdateNotes("Standard Referral-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
79 case '0.1.4': // SQL queries for v0.1.4
80 // Update notes (these will be set as task text!)
81 setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.");
84 case '0.1.5': // SQL queries for v0.1.5
85 // Update notes (these will be set as task text!)
86 setExtensionUpdateNotes("Konfiguration der Pflichtangaben ausgelagert in Template");
89 case '0.1.6': // SQL queries for v0.1.6
90 // Update notes (these will be set as task text!)
91 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
94 case '0.1.7': // SQL queries for v0.1.7
95 // Update notes (these will be set as task text!)
96 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
99 case '0.1.8': // SQL queries for v0.1.8
100 // Update notes (these will be set as task text!)
101 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
104 case '0.1.9': // SQL queries for v0.1.9
105 // Update notes (these will be set as task text!)
106 setExtensionUpdateNotes("Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)");
109 case '0.2.0': // SQL queries for v0.2.0
110 // Update notes (these will be set as task text!)
111 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
114 case '0.2.1': // SQL queries for v0.2.1
115 // Update notes (these will be set as task text!)
116 setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
119 case '0.2.2': // SQL queries for v0.2.2
120 // Update notes (these will be set as task text!)
121 setExtensionUpdateNotes("Sämtliche Sperren bei eingeloggten Admin deaktiviert.");
124 case '0.2.3': // SQL queries for v0.2.3
125 // Update notes (these will be set as task text!)
126 setExtensionUpdateNotes("Cookie <u>refid</u> aus Anmeldeformular entfernt.");
129 case '0.2.4': // SQL queries for v0.2.4
130 // Update notes (these will be set as task text!)
131 setExtensionUpdateNotes("Design "Solid-Business" eingebaut.");
134 case '0.2.5': // SQL queries for v0.2.5
135 // Update notes (these will be set as task text!)
136 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
139 case '0.2.6': // SQL queries for v0.2.6
140 // Update notes (these will be set as task text!)
141 setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
144 case '0.2.7': // SQL queries for v0.2.7
145 // Update notes (these will be set as task text!)
146 setExtensionUpdateNotes("Referral-Id wird endlich korrekt gesetzt.");
149 case '0.2.8': // SQL queries for v0.2.8
150 // Update notes (these will be set as task text!)
151 setExtensionUpdateNotes("Parse error in <u>what-register.php</u> beseitigt.");
154 case '0.2.9': // SQL queries for v0.2.9
155 // Update notes (these will be set as task text!)
156 setExtensionUpdateNotes("Anrede "Firma" hinzugefügt.");
159 case '0.3.0': // SQL queries for v0.3.0
160 // Update notes (these will be set as task text!)
161 setExtensionUpdateNotes("Wörter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
164 case '0.3.1': // SQL queries for v0.3.1
165 // Update notes (these will be set as task text!)
166 setExtensionUpdateNotes("Email-Adresse wird vor dem Speichern auf Gültigkeit hin getestet.");
169 case '0.3.2': // SQL queries for v0.3.2
170 // Update notes (these will be set as task text!)
171 setExtensionUpdateNotes("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <strike>meiner Seite herunterladen</strike> müssen.<br />
173 <strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!</strong>");
176 case '0.3.3': // SQL queries for v0.3.3
177 // Update notes (these will be set as task text!)
178 setExtensionUpdateNotes("Es werden dem Mitglied nur aktivierte Ländercodes zur Auswahl angeboten.");
181 case '0.3.4': // SQL queries for v0.3.4
182 // Update notes (these will be set as task text!)
183 setExtensionUpdateNotes("Auf Grund der Integration der neue Erweiterung <strong>country</strong> in die Anmeldephase klappte die Anmeldung nicht. Die dazu nütige Verknüpfung ist nun eingebaut und die Anmeldung klappt wieder. Vielen Dank nochmals an den Bug-Reporter (Fehlermelder)!");
186 case '0.3.5': // SQL queries for v0.3.5
187 // Update notes (these will be set as task text!)
188 setExtensionUpdateNotes("Design wird nach Anmeldung auch endlich im Mitgliedsmenü übernommen.");
191 case '0.3.6': // SQL queries for v0.3.6
192 // Update notes (these will be set as task text!)
193 setExtensionUpdateNotes("Fehlermeldung <strong>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</strong> beseitigt.");
196 case '0.3.7': // SQL queries for v0.3.7
197 // Update notes (these will be set as task text!)
198 setExtensionUpdateNotes("Fehlermeldung <strong>Fatal error: Call to undefined function: get_curr_theme<u>e</u>() in /../../guest/what-register.php on line 190</strong> beseitigt.");
201 case '0.3.8': // SQL queries for v0.3.8
202 // Update notes (these will be set as task text!)
203 setExtensionUpdateNotes("Weitere SQL-Befehle abgesichert.");
206 case '0.3.9': // SQL queries for v0.3.9
207 // Update notes (these will be set as task text!)
208 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
211 case '0.4.0': // SQL queries for v0.4.0
212 // Update notes (these will be set as task text!)
213 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
216 case '0.4.1': // SQL queries for v0.4.1
217 // Update notes (these will be set as task text!)
218 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
221 case '0.4.2': // SQL queries for v0.4.2
222 addConfigAddSql('register_default', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
224 // Update notes (these will be set as task text!)
225 setExtensionUpdateNotes("Bei der Anmeldung kann die Standard-Auswahl zwischen Ja/Nein umgeschaltet werden. Das Ändern des Templates <strong>templates/".getLanguage()."/html/guest/guest_register.tpl</strong> ist nicht mehr nötig.");
228 case '0.4.3': // SQL queries for v0.4.3
229 // Update notes (these will be set as task text!)
230 setExtensionUpdateNotes("Parser-Error in <strong>inc/modules/guest/what-register.php</strong> beseitigt.");
233 case '0.4.4': // SQL queries for v0.4.4
234 // Update notes (these will be set as task text!)
235 setExtensionUpdateNotes("Anmeldefehler (EMail-Adresse war immer ein Ausrufezeichen) beseitigt.");
238 case '0.4.5': // SQL queries for v0.4.5
239 // Update notes (these will be set as task text!)
240 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
243 case '0.4.6': // SQL queries for v0.4.6
244 // Update notes (these will be set as task text!)
245 setExtensionUpdateNotes("Einstellung nach {?POINTS?}-Einstellungen verlagert.");
248 case '0.4.7': // SQL queries for v0.4.7
249 // Update notes (these will be set as task text!)
250 setExtensionUpdateNotes("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
253 case '0.4.8': // SQL queries for v0.4.8
254 // Update notes (these will be set as task text!)
255 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
258 case '0.4.9': // SQL queries for v0.4.9
259 // Update notes (these will be set as task text!)
260 setExtensionUpdateNotes("Problem mit nicht anzeigbaren Kategorien in der Anmeldung beseitigt.");
263 case '0.5.0': // SQL queries for v0.5.0
264 // Update notes (these will be set as task text!)
265 setExtensionUpdateNotes("Fehlermeldung <span class=\"bad\"><strong>Fatal error:</strong> Call to undefined function registerGenerateCategoryTable() in <strong>{?PATH?}/inc/modules/guest/what-register.php</strong> on line <strong>434</strong></span> beseitigt.");
268 case '0.5.1': // SQL queries for v0.5.1
269 // Update notes (these will be set as task text!)
270 setExtensionUpdateNotes("Mail-Template <strong>register-member.tpl</strong> gefixt. Danke an <a href=\"http://forum.mxchange.org/profile-59.html\" target=\"_blank\" title=\"Mitgliedsprofil aufrufen\">wliepe</a> für die Fehlerfindung!");
273 case '0.5.2': // SQL queries for v0.5.2
274 // Update notes (these will be set as task text!)
275 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
278 case '0.5.3': // SQL queries for v0.5.3
280 registerFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', FALSE, TRUE, isExtensionDryRun());
283 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('gender','Y')");
284 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('email','Y')");
285 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('birthday','Y')");
286 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('marker','Y')");
288 // Update notes (these will be set as task text!)
289 setExtensionUpdateNotes("Filter <strong>register_must_fillout</strong> hinzugefügt, weitere Felder in <span class=\"bad\">{?_MYSQL_PREFIX?}_must_register</span> eingefügt.");
292 case '0.5.4': // SQL queries for v0.5.4
293 addAdminMenuSql('setup', 'config_register2', 'Anmeldeformular', 'Stellen Sie ein, wie viel Kategorien der Gast bei der Anmeldung mindestens einstellen muss. Diese Einstellung gilt nachher auch im Mitgliedsbereich!', 8);
295 // Update notes (these will be set as task text!)
296 setExtensionUpdateNotes("Weiteren Menüpunkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
299 case '0.5.5': // SQL queries for v0.5.5
300 addConfigAddSql('register_generate_password_empty', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
302 // Update notes (these will be set as task text!)
303 setExtensionUpdateNotes("Weiteren Menüpunkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
306 case '0.5.6': // SQL queries for v0.5.6
307 // Register points data
308 registerExtensionPointsData('register_welcome', 'points', 'LOCKED', 'DIRECT');
311 setExtensionUpdateNotes("Anmeldewillkommensgutschrift wird nun über die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
314 case '0.5.7': // SQL queries for v0.5.7
316 registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', FALSE, TRUE, isExtensionDryRun());
318 // Register points data
319 registerExtensionPointsData('referral_bonus', 'points', 'LOCKED', 'DIRECT');
322 setExtensionUpdateNotes("Anmeldeformular komplett auf drei Filter umgestrickt (mehr dazu siehe Wiki) und weitere Verwendungszwecke registriert.");
325 case '0.5.8': // SQL queries for v0.5.8
326 addConfigAddSql('least_cats', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 5');
327 addConfigAddSql('display_refid', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
328 addConfigAddSql('ip_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 86400');
331 setExtensionUpdateNotes("Anmeldewillkommensgutschrift wird nun über die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
334 case '0.5.9': // SQL queries for v0.5.9
335 // Add table for user register provider
336 addDropTableSql('user_register_provider');
337 addCreateTableSql('user_register_provider', "
338 `provider_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
339 `provider_name` VARCHAR(255) NOT NULL DEFAULT 'local_generic_user_register',
340 `provider_extension` VARCHAR(255) NOT NULL DEFAULT 'register',
341 `provider_is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
342 PRIMARY KEY (`provider_id`)",
343 'User register providers');
345 // Add (activated) default entry
346 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_register_provider` (`provider_is_active`) VALUES ('Y')");
349 addAdminMenuSql('setup', 'list_usr_register_provider', 'MAP verwalten', 'Alle Mitgliedsanmelde-Provider (MAP) auflisten und verwalten.', 11);
351 // Update notes (these will be set as task text!)
352 setExtensionUpdateNotes("Tabelle für Mitgliedsanmelde-Provider hinzugefügt.");
355 case '0.6.0': // SQL queries for v0.6.0
357 registerFilter(__FILE__, __LINE__, 'user_registration', 'GENERIC_USER_REGISTRATION', FALSE, TRUE, isExtensionDryRun());
358 registerFilter(__FILE__, __LINE__, 'user_registration_done', 'GENERIC_USER_REGISTRATION_DONE', FALSE, TRUE, isExtensionDryRun());
359 registerFilter(__FILE__, __LINE__, 'user_registration_failed', 'GENERIC_USER_REGISTRATION_FAILED', FALSE, TRUE, isExtensionDryRun());
360 registerFilter(__FILE__, __LINE__, 'user_registration_form', 'GENERIC_USER_REGISTRATION_FORM', FALSE, TRUE, isExtensionDryRun());
361 registerFilter(__FILE__, __LINE__, 'check_user_registration', 'GENERIC_USER_REGISTRATION_CHECK', FALSE, TRUE, isExtensionDryRun());
363 // Update default entry
364 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_register_provider` SET `provider_extension`='register' WHERE `provider_extension`='user'");
367 // @TODO Make configurable through web interface
368 addConfigAddSql('default_registration_provider', "VARCHAR(255) NOT NULL DEFAULT 'register'");
370 // Add column for registration provider
371 addExtensionAddTableColumnSql('user_data', 'registration_provider', "VARCHAR(255) NOT NULL DEFAULT 'register'");
373 // Update notes (these will be set as task text!)
374 setExtensionUpdateNotes("Filter für das Handling der Anmeldeanfragen hinzugeügt.");