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 * 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 *
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. *
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. *
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, *
38 ************************************************************************/
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
46 setThisExtensionVersion('0.5.4');
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.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'));
51 switch (getExtensionMode()) {
52 case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
53 // SQL commands to run
57 case 'remove': // Do stuff when removing extension
58 // SQL commands to run
59 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_register'");
60 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`");
62 // Unregister a filter
63 unregisterFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', true, getExtensionDryRun());
66 case 'activate': // Do stuff when admin activates this extension
67 // SQL commands to run
71 case 'deactivate': // Do stuff when admin deactivates this extension
72 // SQL commands to run
76 case 'update': // Update an extension
77 switch (getCurrentExtensionVersion())
79 case '0.1.0': // SQL queries for v0.1
80 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`");
81 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_must_register` (
82 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
83 field_name VARCHAR(255) NOT NULL DEFAULT '',
84 field_required ENUM('Y','N') NOT NULL DEFAULT 'Y',
86 ) TYPE={?_TABLE_TYPE?}");
88 // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
89 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('surname','Y')");
90 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('family','Y')");
91 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('street_nr','Y')");
92 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('cntry','Y')");
93 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('zip','Y')");
94 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('city','Y')");
97 addAdminMenuSql('setup','config_register','Pflichtfelder','Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter <strong>Profildaten ändern</strong> ein.', 12);
99 // Update notes (these will be set as task text!)
100 setExtensionUpdateNotes("Einstellbare Pflichtfelder hinzugefügt.");
103 case '0.1.1': // SQL queries for v0.1.1
104 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET ext_has_css='Y' WHERE `ext_name`='register' AND ext_has_css='N' LIMIT 1");
106 // This update depends on sql_patches update!
107 addExtensionUpdateDependency('sql_patches');
109 // Update notes (these will be set as task text!)
110 setExtensionUpdateNotes("CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.");
113 case '0.1.3': // SQL queries for v0.1.3
114 // This update depends on sql_patches update!
115 addExtensionUpdateDependency('sql_patches');
117 // Update notes (these will be set as task text!)
118 setExtensionUpdateNotes("Standart Referal-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
121 case '0.1.4': // SQL queries for v0.1.4
122 // Update notes (these will be set as task text!)
123 setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.");
126 case '0.1.5': // SQL queries for v0.1.5
127 // Update notes (these will be set as task text!)
128 setExtensionUpdateNotes("Konfiguration der Pflichtangaben ausgelagert in Template");
131 case '0.1.6': // SQL queries for v0.1.6
132 // Update notes (these will be set as task text!)
133 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
136 case '0.1.7': // SQL queries for v0.1.7
137 // Update notes (these will be set as task text!)
138 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
141 case '0.1.8': // SQL queries for v0.1.8
142 // Update notes (these will be set as task text!)
143 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
146 case '0.1.9': // SQL queries for v0.1.9
147 // Update notes (these will be set as task text!)
148 setExtensionUpdateNotes("Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)");
151 case '0.2.0': // SQL queries for v0.2.0
152 // Update notes (these will be set as task text!)
153 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
156 case '0.2.1': // SQL queries for v0.2.1
157 // Update notes (these will be set as task text!)
158 setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
161 case '0.2.2': // SQL queries for v0.2.2
162 // Update notes (these will be set as task text!)
163 setExtensionUpdateNotes("Sämtliche Sperren bei eingeloggten Admin deaktiviert.");
166 case '0.2.3': // SQL queries for v0.2.3
167 // Update notes (these will be set as task text!)
168 setExtensionUpdateNotes("Cookie <u>refid</u> aus Anmeldeformular entfernt.");
171 case '0.2.4': // SQL queries for v0.2.4
172 // Update notes (these will be set as task text!)
173 setExtensionUpdateNotes("Design "Solid-Business" eingebaut.");
176 case '0.2.5': // SQL queries for v0.2.5
177 // Update notes (these will be set as task text!)
178 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
181 case '0.2.6': // SQL queries for v0.2.6
182 // Update notes (these will be set as task text!)
183 setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
186 case '0.2.7': // SQL queries for v0.2.7
187 // Update notes (these will be set as task text!)
188 setExtensionUpdateNotes("Referal-Id wird endlich korrekt gesetzt.");
191 case '0.2.8': // SQL queries for v0.2.8
192 // Update notes (these will be set as task text!)
193 setExtensionUpdateNotes("Parse error in <u>what-register.php</u> beseitigt.");
196 case '0.2.9': // SQL queries for v0.2.9
197 // Update notes (these will be set as task text!)
198 setExtensionUpdateNotes("Anrede "Firma" hinzugefügt.");
201 case '0.3.0': // SQL queries for v0.3.0
202 // Update notes (these will be set as task text!)
203 setExtensionUpdateNotes("Wörter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
206 case '0.3.1': // SQL queries for v0.3.1
207 // Update notes (these will be set as task text!)
208 setExtensionUpdateNotes("Email-Adresse wird vor dem Speichern auf G¨tigkeit hin getestet.");
211 case '0.3.2': // SQL queries for v0.3.2
212 // Update notes (these will be set as task text!)
213 setExtensionUpdateNotes("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <strike>meiner Seite herunterladen</strike> müssen.<br />
215 <strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!</strong>");
217 // Depends on 'country'
218 addExtensionUpdateDependency('country');
221 case '0.3.3': // SQL queries for v0.3.3
222 // Update notes (these will be set as task text!)
223 setExtensionUpdateNotes("Es werden dem Mitglied nur aktivierte Ländercodes zur Auswahl angeboten.");
226 case '0.3.4': // SQL queries for v0.3.4
227 // Update notes (these will be set as task text!)
228 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)!");
231 case '0.3.5': // SQL queries for v0.3.5
232 // Update notes (these will be set as task text!)
233 setExtensionUpdateNotes("Design wird nach Anmeldung auch endlich im Mitgliedsmenü übernommen.");
236 case '0.3.6': // SQL queries for v0.3.6
237 // Update notes (these will be set as task text!)
238 setExtensionUpdateNotes("Fehlermeldung <strong>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</strong> beseitigt.");
241 case '0.3.7': // SQL queries for v0.3.7
242 // Update notes (these will be set as task text!)
243 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.");
246 case '0.3.8': // SQL queries for v0.3.8
247 // Update notes (these will be set as task text!)
248 setExtensionUpdateNotes("Weitere SQL-Befehle abgesichert.");
251 case '0.3.9': // SQL queries for v0.3.9
252 // Update notes (these will be set as task text!)
253 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
256 case '0.4.0': // SQL queries for v0.4.0
257 // Update notes (these will be set as task text!)
258 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
261 case '0.4.1': // SQL queries for v0.4.1
262 // Update notes (these will be set as task text!)
263 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
266 case '0.4.2': // SQL queries for v0.4.2
267 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'");
269 // Update notes (these will be set as task text!)
270 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.");
273 case '0.4.3': // SQL queries for v0.4.3
274 // Update notes (these will be set as task text!)
275 setExtensionUpdateNotes("Parser-Error in <strong>inc/modules/guest/what-register.php</strong> beseitigt.");
278 case '0.4.4': // SQL queries for v0.4.4
279 // Update notes (these will be set as task text!)
280 setExtensionUpdateNotes("Anmeldefehler (EMail-Adresse war immer ein Ausrufezeichen) beseitigt.");
283 case '0.4.5': // SQL queries for v0.4.5
284 // Update notes (these will be set as task text!)
285 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
288 case '0.4.6': // SQL queries for v0.4.6
289 // Update notes (these will be set as task text!)
290 setExtensionUpdateNotes("Einstellung nach {?POINTS?}-Einstellungen verlagert.");
293 case '0.4.7': // SQL queries for v0.4.7
294 // Update notes (these will be set as task text!)
295 setExtensionUpdateNotes("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
298 case '0.4.8': // SQL queries for v0.4.8
299 // Update notes (these will be set as task text!)
300 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
303 case '0.4.9': // SQL queries for v0.4.9
304 // Update notes (these will be set as task text!)
305 setExtensionUpdateNotes("Problem mit nicht anzeigbaren Kategorien in der Anmeldung beseitigt.");
308 case '0.5.0': // SQL queries for v0.5.0
309 // Update notes (these will be set as task text!)
310 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.");
313 case '0.5.1': // SQL queries for v0.5.1
314 // Update notes (these will be set as task text!)
315 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!");
318 case '0.5.2': // SQL queries for v0.5.2
319 // Update notes (these will be set as task text!)
320 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
323 case '0.5.3': // SQL queries for v0.5.3
325 registerFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', false, true, getExtensionDryRun());
328 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('gender','Y')");
329 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('email','Y')");
330 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('birthday','Y')");
331 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('marker','Y')");
333 // Update notes (these will be set as task text!)
334 setExtensionUpdateNotes("Filter <strong>register_must_fillout</strong> hinzugefügt, weitere Felder in <em>{?_MYSQL_PREFIX?}_must_register</em> eingefügt.");
337 case '0.5.4': // SQL queries for v0.5.4
338 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);
340 // Update notes (these will be set as task text!)
341 setExtensionUpdateNotes("Weiteren Menüpunkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
347 case 'modify': // When the extension got modified
350 case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
353 case 'init': // Do stuff when extension is initialized
356 default: // Unknown extension mode
357 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));