2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 04/29/2004 *
4 * =================== Last change: 11/23/2004 *
6 * -------------------------------------------------------------------- *
7 * File : ext-register.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, 2010 by Mailer Developer Team *
20 * For more information visit: http://www.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')) {
44 setThisExtensionVersion('0.5.4');
46 // Version history array (add more with , '0.1.0' and so on)
47 setExtensionVersionHistory(array('0.0', '0.1.0', '0.1.1', '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', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4'));
49 switch (getExtensionMode()) {
50 case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
51 // SQL commands to run
55 case 'remove': // Do stuff when removing extension
56 // SQL commands to run
57 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_register'");
58 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`');
60 // Unregister a filter
61 unregisterFilter(__FUNCTION__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', true, isExtensionDryRun());
64 case 'activate': // Do stuff when admin activates this extension
65 // SQL commands to run
69 case 'deactivate': // Do stuff when admin deactivates this extension
70 // SQL commands to run
74 case 'update': // Update an extension
75 switch (getCurrentExtensionVersion()) {
76 case '0.1.0': // SQL queries for v0.1
77 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`');
78 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_must_register` (
79 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
80 field_name VARCHAR(255) NOT NULL DEFAULT '',
81 field_required ENUM('Y','N') NOT NULL DEFAULT 'Y',
83 ) TYPE={?_TABLE_TYPE?}");
85 // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
86 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('surname','Y')");
87 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('family','Y')");
88 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('street_nr','Y')");
89 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('cntry','Y')");
90 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('zip','Y')");
91 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('city','Y')");
94 addAdminMenuSql('setup','config_register','Pflichtfelder','Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter <strong>Profildaten ändern</strong> ein.', 12);
96 // Update notes (these will be set as task text!)
97 setExtensionUpdateNotes("Einstellbare Pflichtfelder hinzugefügt.");
100 case '0.1.1': // SQL queries for v0.1.1
101 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET ext_has_css='Y' WHERE `ext_name`='register' AND ext_has_css='N' LIMIT 1");
103 // This update depends on sql_patches update!
104 addExtensionUpdateDependency('sql_patches');
106 // Update notes (these will be set as task text!)
107 setExtensionUpdateNotes("CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.");
110 case '0.1.3': // SQL queries for v0.1.3
111 // This update depends on sql_patches update!
112 addExtensionUpdateDependency('sql_patches');
114 // Update notes (these will be set as task text!)
115 setExtensionUpdateNotes("Standart Referal-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
118 case '0.1.4': // SQL queries for v0.1.4
119 // Update notes (these will be set as task text!)
120 setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.");
123 case '0.1.5': // SQL queries for v0.1.5
124 // Update notes (these will be set as task text!)
125 setExtensionUpdateNotes("Konfiguration der Pflichtangaben ausgelagert in Template");
128 case '0.1.6': // SQL queries for v0.1.6
129 // Update notes (these will be set as task text!)
130 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
133 case '0.1.7': // SQL queries for v0.1.7
134 // Update notes (these will be set as task text!)
135 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
138 case '0.1.8': // SQL queries for v0.1.8
139 // Update notes (these will be set as task text!)
140 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
143 case '0.1.9': // SQL queries for v0.1.9
144 // Update notes (these will be set as task text!)
145 setExtensionUpdateNotes("Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)");
148 case '0.2.0': // SQL queries for v0.2.0
149 // Update notes (these will be set as task text!)
150 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
153 case '0.2.1': // SQL queries for v0.2.1
154 // Update notes (these will be set as task text!)
155 setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
158 case '0.2.2': // SQL queries for v0.2.2
159 // Update notes (these will be set as task text!)
160 setExtensionUpdateNotes("Sämtliche Sperren bei eingeloggten Admin deaktiviert.");
163 case '0.2.3': // SQL queries for v0.2.3
164 // Update notes (these will be set as task text!)
165 setExtensionUpdateNotes("Cookie <u>refid</u> aus Anmeldeformular entfernt.");
168 case '0.2.4': // SQL queries for v0.2.4
169 // Update notes (these will be set as task text!)
170 setExtensionUpdateNotes("Design "Solid-Business" eingebaut.");
173 case '0.2.5': // SQL queries for v0.2.5
174 // Update notes (these will be set as task text!)
175 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
178 case '0.2.6': // SQL queries for v0.2.6
179 // Update notes (these will be set as task text!)
180 setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
183 case '0.2.7': // SQL queries for v0.2.7
184 // Update notes (these will be set as task text!)
185 setExtensionUpdateNotes("Referal-Id wird endlich korrekt gesetzt.");
188 case '0.2.8': // SQL queries for v0.2.8
189 // Update notes (these will be set as task text!)
190 setExtensionUpdateNotes("Parse error in <u>what-register.php</u> beseitigt.");
193 case '0.2.9': // SQL queries for v0.2.9
194 // Update notes (these will be set as task text!)
195 setExtensionUpdateNotes("Anrede "Firma" hinzugefügt.");
198 case '0.3.0': // SQL queries for v0.3.0
199 // Update notes (these will be set as task text!)
200 setExtensionUpdateNotes("Wörter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
203 case '0.3.1': // SQL queries for v0.3.1
204 // Update notes (these will be set as task text!)
205 setExtensionUpdateNotes("Email-Adresse wird vor dem Speichern auf G¨tigkeit hin getestet.");
208 case '0.3.2': // SQL queries for v0.3.2
209 // Update notes (these will be set as task text!)
210 setExtensionUpdateNotes("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <strike>meiner Seite herunterladen</strike> müssen.<br />
212 <strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!</strong>");
214 // Depends on 'country'
215 addExtensionUpdateDependency('country');
218 case '0.3.3': // SQL queries for v0.3.3
219 // Update notes (these will be set as task text!)
220 setExtensionUpdateNotes("Es werden dem Mitglied nur aktivierte Ländercodes zur Auswahl angeboten.");
223 case '0.3.4': // SQL queries for v0.3.4
224 // Update notes (these will be set as task text!)
225 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)!");
228 case '0.3.5': // SQL queries for v0.3.5
229 // Update notes (these will be set as task text!)
230 setExtensionUpdateNotes("Design wird nach Anmeldung auch endlich im Mitgliedsmenü übernommen.");
233 case '0.3.6': // SQL queries for v0.3.6
234 // Update notes (these will be set as task text!)
235 setExtensionUpdateNotes("Fehlermeldung <strong>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</strong> beseitigt.");
238 case '0.3.7': // SQL queries for v0.3.7
239 // Update notes (these will be set as task text!)
240 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.");
243 case '0.3.8': // SQL queries for v0.3.8
244 // Update notes (these will be set as task text!)
245 setExtensionUpdateNotes("Weitere SQL-Befehle abgesichert.");
248 case '0.3.9': // SQL queries for v0.3.9
249 // Update notes (these will be set as task text!)
250 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
253 case '0.4.0': // SQL queries for v0.4.0
254 // Update notes (these will be set as task text!)
255 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
258 case '0.4.1': // SQL queries for v0.4.1
259 // Update notes (these will be set as task text!)
260 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
263 case '0.4.2': // SQL queries for v0.4.2
264 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'");
266 // Update notes (these will be set as task text!)
267 setExtensionUpdateNotes("Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das Ändern des Templates <strong>templates/".getLanguage()."/html/guest/guest_register.tpl</strong> ist nicht mehr nötig.");
270 case '0.4.3': // SQL queries for v0.4.3
271 // Update notes (these will be set as task text!)
272 setExtensionUpdateNotes("Parser-Error in <strong>inc/modules/guest/what-register.php</strong> beseitigt.");
275 case '0.4.4': // SQL queries for v0.4.4
276 // Update notes (these will be set as task text!)
277 setExtensionUpdateNotes("Anmeldefehler (EMail-Adresse war immer ein Ausrufezeichen) beseitigt.");
280 case '0.4.5': // SQL queries for v0.4.5
281 // Update notes (these will be set as task text!)
282 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
285 case '0.4.6': // SQL queries for v0.4.6
286 // Update notes (these will be set as task text!)
287 setExtensionUpdateNotes("Einstellung nach {?POINTS?}-Einstellungen verlagert.");
290 case '0.4.7': // SQL queries for v0.4.7
291 // Update notes (these will be set as task text!)
292 setExtensionUpdateNotes("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
295 case '0.4.8': // SQL queries for v0.4.8
296 // Update notes (these will be set as task text!)
297 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
300 case '0.4.9': // SQL queries for v0.4.9
301 // Update notes (these will be set as task text!)
302 setExtensionUpdateNotes("Problem mit nicht anzeigbaren Kategorien in der Anmeldung beseitigt.");
305 case '0.5.0': // SQL queries for v0.5.0
306 // Update notes (these will be set as task text!)
307 setExtensionUpdateNotes("Fehlermeldung <em><strong>Fatal error:</strong> Call to undefined function registerGenerateCategoryTable() in <strong>{?PATH?}/inc/modules/guest/what-register.php</strong> on line <strong>434</strong></em> beseitigt.");
310 case '0.5.1': // SQL queries for v0.5.1
311 // Update notes (these will be set as task text!)
312 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!");
315 case '0.5.2': // SQL queries for v0.5.2
316 // Update notes (these will be set as task text!)
317 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
320 case '0.5.3': // SQL queries for v0.5.3
322 registerFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', false, true, isExtensionDryRun());
325 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('gender','Y')");
326 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('email','Y')");
327 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('birthday','Y')");
328 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('marker','Y')");
330 // Update notes (these will be set as task text!)
331 setExtensionUpdateNotes("Filter <strong>register_must_fillout</strong> hinzugefügt, weitere Felder in <em>{?_MYSQL_PREFIX?}_must_register</em> eingefügt.");
334 case '0.5.4': // SQL queries for v0.5.4
335 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);
337 // Update notes (these will be set as task text!)
338 setExtensionUpdateNotes("Weiteren Menüpunkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
344 case 'modify': // When the extension got modified
347 case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
350 case 'init': // Do stuff when extension is initialized
353 default: // Unknown extension mode
354 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));