2 /************************************************************************
3 * MXChange v0.2.1 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 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
42 $EXT_VERSION = "0.5.2";
44 // Auto-set extension version
45 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
47 // Version history array (add more with , "0.1" and so on)
48 $EXT_VER_HISTORY = array("0.0", "0.1", "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");
50 switch ($EXT_LOAD_MODE)
52 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
53 // SQL commands to run
60 case "remove": // Do stuff when removing extension
61 // SQL commands to run
62 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='setup' AND what='config_register' LIMIT 1";
65 case "activate": // Do stuff when admin activates this extension
66 // SQL commands to run
70 case "deactivate": // Do stuff when admin deactivates this extension
71 // SQL commands to run
75 case "update": // Update an extension
78 case "0.1": // SQL queries for v0.1
79 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_must_register";
80 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_must_register (
81 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
82 field_name VARCHAR(255) NOT NULL DEFAULT '',
83 field_required ENUM('Y', 'N') NOT NULL DEFAULT 'Y',
87 // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
88 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('surname', 'Y')";
89 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('family_name', 'Y')";
90 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('street_nr', 'Y')";
91 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('cntry', 'Y')";
92 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('zip', 'Y')";
93 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('city', 'Y')";
96 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES('setup', 'config_register', 'Pflichtfelder', 'Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter <STRONG>Profildaten ändern</STRONG> ein.', 12)";
98 // Update notes (these will be set as task text!)
99 $UPDATE_NOTES = "Einstellbare Pflichtfelder hinzugefügt.";
102 case "0.1.1": // SQL queries for v0.1.1
103 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='register' AND ext_has_css='N' LIMIT 1";
105 // This update depends on sql_patches update!
106 $EXT_UPDATE_DEPENDS = "sql_patches";
108 // Update notes (these will be set as task text!)
109 $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
112 case "0.1.3": // SQL queries for v0.1.3
113 // This update depends on sql_patches update!
114 $EXT_UPDATE_DEPENDS = "sql_patches";
116 // Update notes (these will be set as task text!)
117 $UPDATE_NOTES = "Standart Referral-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
120 case "0.1.4": // SQL queries for v0.1.4
121 // Update notes (these will be set as task text!)
122 $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.";
125 case "0.1.5": // SQL queries for v0.1.5
126 // Update notes (these will be set as task text!)
127 $UPDATE_NOTES = "Konfiguration der Pflichtangaben ausgelagert in Template";
130 case "0.1.6": // SQL queries for v0.1.6
131 // Update notes (these will be set as task text!)
132 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
135 case "0.1.7": // SQL queries for v0.1.7
136 // Update notes (these will be set as task text!)
137 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
140 case "0.1.8": // SQL queries for v0.1.8
141 // Update notes (these will be set as task text!)
142 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
145 case "0.1.9": // SQL queries for v0.1.9
146 // Update notes (these will be set as task text!)
147 $UPDATE_NOTES = "Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)";
150 case "0.2.0": // SQL queries for v0.2.0
151 // Update notes (these will be set as task text!)
152 $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
155 case "0.2.1": // SQL queries for v0.2.1
156 // Update notes (these will be set as task text!)
157 $UPDATE_NOTES = "Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
160 case "0.2.2": // SQL queries for v0.2.2
161 // Update notes (these will be set as task text!)
162 $UPDATE_NOTES = "Sämtliche Sperren bei eingeloggten Admin deaktiviert.";
165 case "0.2.3": // SQL queries for v0.2.3
166 // Update notes (these will be set as task text!)
167 $UPDATE_NOTES = "Cookie <U>refid</U> aus Anmeldeformular entfernt.";
170 case "0.2.4": // SQL queries for v0.2.4
171 // Update notes (these will be set as task text!)
172 $UPDATE_NOTES = "Design "Solid-Business" eingebaut.";
175 case "0.2.5": // SQL queries for v0.2.5
176 // Update notes (these will be set as task text!)
177 $UPDATE_NOTES = "Seit <A href=\"".SERVER_URL."/patches/340-Gast_Mitgliedsmenue_Deaktivieren.zip\">Patch 340</A> überflüssige HTML-Tags entfernt.";
180 case "0.2.6": // SQL queries for v0.2.6
181 // Update notes (these will be set as task text!)
182 $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
185 case "0.2.7": // SQL queries for v0.2.7
186 // Update notes (these will be set as task text!)
187 $UPDATE_NOTES = "Referral-ID wird endlich korrekt gesetzt.";
190 case "0.2.8": // SQL queries for v0.2.8
191 // Update notes (these will be set as task text!)
192 $UPDATE_NOTES = "Parse error in <U>what-register.php</U> beseitigt.";
195 case "0.2.9": // SQL queries for v0.2.9
196 // Update notes (these will be set as task text!)
197 $UPDATE_NOTES = "Anrede "Firma" hinzugefügt.";
200 case "0.3.0": // SQL queries for v0.3.0
201 // Update notes (these will be set as task text!)
202 $UPDATE_NOTES = "Wörter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
205 case "0.3.1": // SQL queries for v0.3.1
206 // Update notes (these will be set as task text!)
207 $UPDATE_NOTES = "Email-Adresse wird vor dem Speichern auf G¨tigkeit hin getestet.";
210 case "0.3.2": // SQL queries for v0.3.2
211 // Update notes (these will be set as task text!)
212 $UPDATE_NOTES = "Einbindung der Erweiterung <STRONG>country</STRONG>, die Sie sich noch optional von <A href=\"".URL."/modules.php?module=admin&what=extensions&do=search\">meiner Seite herunterladen</A> müssen.<br />
214 <STRONG>Wichtig: Laden Sie noch das Template <STRONG>guest_register.tpl</STRONG> mit hoch, welches unter templates/".GET_LANGUAGE()."/html/guest/ zu finden ist!</STRONG>";
216 // Depends on 'country'
217 $EXT_UPDATE_DEPENDS = "country";
220 case "0.3.3": // SQL queries for v0.3.3
221 // Update notes (these will be set as task text!)
222 $UPDATE_NOTES = "Es werden dem Mitglied nur aktivierte Ländercodes zur Auswahl angeboten.";
225 case "0.3.4": // SQL queries for v0.3.4
226 // Update notes (these will be set as task text!)
227 $UPDATE_NOTES = "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)!";
230 case "0.3.5": // SQL queries for v0.3.5
231 // Update notes (these will be set as task text!)
232 $UPDATE_NOTES = "Design wird nach Anmeldung auch endlich im Mitgliedsmenü übernommen.";
235 case "0.3.6": // SQL queries for v0.3.6
236 // Update notes (these will be set as task text!)
237 $UPDATE_NOTES = "Fehlermeldung <STRONG>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</STRONG> beseitigt.";
240 case "0.3.7": // SQL queries for v0.3.7
241 // Update notes (these will be set as task text!)
242 $UPDATE_NOTES = "Fehlermeldung <STRONG>Fatal error: Call to undefined function: get_curr_theme<U>e</U>() in /../../guest/what-register.php on line 190</STRONG> beseitigt.";
245 case "0.3.8": // SQL queries for v0.3.8
246 // Update notes (these will be set as task text!)
247 $UPDATE_NOTES = "Weitere SQL-Befehle abgesichert.";
250 case "0.3.9": // SQL queries for v0.3.9
251 // Update notes (these will be set as task text!)
252 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
255 case "0.4.0": // SQL queries for v0.4.0
256 // Update notes (these will be set as task text!)
257 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
260 case "0.4.1": // SQL queries for v0.4.1
261 // Update notes (these will be set as task text!)
262 $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
265 case "0.4.2": // SQL queries for v0.4.2
266 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'";
267 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_register2' WHERE what='config_reg' LIMIT 1";
269 // Update notes (these will be set as task text!)
270 $UPDATE_NOTES = "Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das Ändern des Templates <STRONG>templates/".GET_LANGUAGE()."/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 $UPDATE_NOTES = "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 $UPDATE_NOTES = "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 $UPDATE_NOTES = "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 $UPDATE_NOTES = "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 $UPDATE_NOTES = "<STRONG>set_session()</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 $UPDATE_NOTES = "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 $UPDATE_NOTES = "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 $UPDATE_NOTES = "Fehlermeldung <em><strong>Fatal error:</strong> Call to undefined function REGISTER_ADD_CATEGORY_TABLE() 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 $UPDATE_NOTES = "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 $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
325 default: // Do stuff when extension is loaded
326 $dummy = LOAD_CONFIG();
327 $_CONFIG = merge_array($_CONFIG, $dummy);
332 // Language file prefix
333 $EXT_LANG_PREFIX = "register";
335 // Extension is always active?
336 $EXT_ALWAYS_ACTIVE = "N";