2 /************************************************************************
\r
3 * MXChange v0.2.1 Start: 04/29/2004 *
\r
4 * ================ Last change: 11/23/2004 *
\r
6 * -------------------------------------------------------------------- *
\r
7 * File : ext-register.php *
\r
8 * -------------------------------------------------------------------- *
\r
9 * Short description : Swapped out registration system for new members *
\r
10 * -------------------------------------------------------------------- *
\r
11 * Kurzbeschreibung : Ausgelagertes Anmeldesystem fuer Mitglieder *
\r
12 * -------------------------------------------------------------------- *
\r
14 * -------------------------------------------------------------------- *
\r
15 * Copyright (c) 2003 - 2007 by Roland Haeder *
\r
16 * For more information visit: http://www.mxchange.org *
\r
18 * This program is free software; you can redistribute it and/or modify *
\r
19 * it under the terms of the GNU General Public License as published by *
\r
20 * the Free Software Foundation; either version 2 of the License, or *
\r
21 * (at your option) any later version. *
\r
23 * This program is distributed in the hope that it will be useful, *
\r
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
\r
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
\r
26 * GNU General Public License for more details. *
\r
28 * You should have received a copy of the GNU General Public License *
\r
29 * along with this program; if not, write to the Free Software *
\r
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
\r
31 * MA 02110-1301 USA *
\r
32 ************************************************************************/
\r
34 // Some security stuff...
\r
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))
\r
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
\r
42 $EXT_VERSION = "0.5.2";
\r
44 // Auto-set extension version
\r
45 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
\r
47 // Version history array (add more with , "0.1" and so on)
\r
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");
\r
50 switch ($EXT_LOAD_MODE)
\r
52 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
\r
53 // SQL commands to run
\r
56 // Load own CSS file?
\r
60 case "remove": // Do stuff when removing extension
\r
61 // SQL commands to run
\r
62 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='setup' AND what='config_register' LIMIT 1";
\r
65 case "activate": // Do stuff when admin activates this extension
\r
66 // SQL commands to run
\r
70 case "deactivate": // Do stuff when admin deactivates this extension
\r
71 // SQL commands to run
\r
75 case "update": // Update an extension
\r
78 case "0.1": // SQL queries for v0.1
\r
79 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_must_register";
\r
80 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_must_register (
\r
81 id bigint(20) NOT NULL auto_increment,
\r
82 field_name varchar(255) not null default '',
\r
83 field_required enum('Y', 'N') not null default 'Y',
\r
87 // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
\r
88 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('surname', 'Y')";
\r
89 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('family_name', 'Y')";
\r
90 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('street_nr', 'Y')";
\r
91 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('cntry', 'Y')";
\r
92 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('zip', 'Y')";
\r
93 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('city', 'Y')";
\r
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)";
\r
98 // Update notes (these will be set as task text!)
\r
99 $UPDATE_NOTES = "Einstellbare Pflichtfelder hinzugefügt.";
\r
102 case "0.1.1": // SQL queries for v0.1.1
\r
103 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='register' AND ext_has_css='N' LIMIT 1";
\r
105 // This update depends on sql_patches update!
\r
106 $EXT_UPDATE_DEPENDS = "sql_patches";
\r
108 // Update notes (these will be set as task text!)
\r
109 $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
\r
112 case "0.1.3": // SQL queries for v0.1.3
\r
113 // This update depends on sql_patches update!
\r
114 $EXT_UPDATE_DEPENDS = "sql_patches";
\r
116 // Update notes (these will be set as task text!)
\r
117 $UPDATE_NOTES = "Standart Referral-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
\r
120 case "0.1.4": // SQL queries for v0.1.4
\r
121 // Update notes (these will be set as task text!)
\r
122 $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei geändert.";
\r
125 case "0.1.5": // SQL queries for v0.1.5
\r
126 // Update notes (these will be set as task text!)
\r
127 $UPDATE_NOTES = "Konfiguration der Pflichtangaben ausgelagert in Template";
\r
130 case "0.1.6": // SQL queries for v0.1.6
\r
131 // Update notes (these will be set as task text!)
\r
132 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
\r
135 case "0.1.7": // SQL queries for v0.1.7
\r
136 // Update notes (these will be set as task text!)
\r
137 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
\r
140 case "0.1.8": // SQL queries for v0.1.8
\r
141 // Update notes (these will be set as task text!)
\r
142 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
\r
145 case "0.1.9": // SQL queries for v0.1.9
\r
146 // Update notes (these will be set as task text!)
\r
147 $UPDATE_NOTES = "Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)";
\r
150 case "0.2.0": // SQL queries for v0.2.0
\r
151 // Update notes (these will be set as task text!)
\r
152 $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
\r
155 case "0.2.1": // SQL queries for v0.2.1
\r
156 // Update notes (these will be set as task text!)
\r
157 $UPDATE_NOTES = "Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
\r
160 case "0.2.2": // SQL queries for v0.2.2
\r
161 // Update notes (these will be set as task text!)
\r
162 $UPDATE_NOTES = "Sämtliche Sperren bei eingeloggten Admin deaktiviert.";
\r
165 case "0.2.3": // SQL queries for v0.2.3
\r
166 // Update notes (these will be set as task text!)
\r
167 $UPDATE_NOTES = "Cookie <U>refid</U> aus Anmeldeformular entfernt.";
\r
170 case "0.2.4": // SQL queries for v0.2.4
\r
171 // Update notes (these will be set as task text!)
\r
172 $UPDATE_NOTES = "Design "Solid-Business" eingebaut.";
\r
175 case "0.2.5": // SQL queries for v0.2.5
\r
176 // Update notes (these will be set as task text!)
\r
177 $UPDATE_NOTES = "Seit <A href=\"".SERVER_URL."/patches/340-Gast_Mitgliedsmenue_Deaktivieren.zip\">Patch 340</A> überflüssige HTML-Tags entfernt.";
\r
180 case "0.2.6": // SQL queries for v0.2.6
\r
181 // Update notes (these will be set as task text!)
\r
182 $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
\r
185 case "0.2.7": // SQL queries for v0.2.7
\r
186 // Update notes (these will be set as task text!)
\r
187 $UPDATE_NOTES = "Referral-ID wird endlich korrekt gesetzt.";
\r
190 case "0.2.8": // SQL queries for v0.2.8
\r
191 // Update notes (these will be set as task text!)
\r
192 $UPDATE_NOTES = "Parse error in <U>what-register.php</U> beseitigt.";
\r
195 case "0.2.9": // SQL queries for v0.2.9
\r
196 // Update notes (these will be set as task text!)
\r
197 $UPDATE_NOTES = "Anrede "Firma" hinzugefügt.";
\r
200 case "0.3.0": // SQL queries for v0.3.0
\r
201 // Update notes (these will be set as task text!)
\r
202 $UPDATE_NOTES = "Wörter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
\r
205 case "0.3.1": // SQL queries for v0.3.1
\r
206 // Update notes (these will be set as task text!)
\r
207 $UPDATE_NOTES = "Email-Adresse wird vor dem Speichern auf G¨tigkeit hin getestet.";
\r
210 case "0.3.2": // SQL queries for v0.3.2
\r
211 // Update notes (these will be set as task text!)
\r
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>
\r
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>";
\r
216 // Depends on 'country'
\r
217 $EXT_UPDATE_DEPENDS = "country";
\r
220 case "0.3.3": // SQL queries for v0.3.3
\r
221 // Update notes (these will be set as task text!)
\r
222 $UPDATE_NOTES = "Es werden dem Mitglied nur aktivierte Ländercodes zur Auswahl angeboten.";
\r
225 case "0.3.4": // SQL queries for v0.3.4
\r
226 // Update notes (these will be set as task text!)
\r
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)!";
\r
230 case "0.3.5": // SQL queries for v0.3.5
\r
231 // Update notes (these will be set as task text!)
\r
232 $UPDATE_NOTES = "Design wird nach Anmeldung auch endlich im Mitgliedsmenü übernommen.";
\r
235 case "0.3.6": // SQL queries for v0.3.6
\r
236 // Update notes (these will be set as task text!)
\r
237 $UPDATE_NOTES = "Fehlermeldung <STRONG>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</STRONG> beseitigt.";
\r
240 case "0.3.7": // SQL queries for v0.3.7
\r
241 // Update notes (these will be set as task text!)
\r
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.";
\r
245 case "0.3.8": // SQL queries for v0.3.8
\r
246 // Update notes (these will be set as task text!)
\r
247 $UPDATE_NOTES = "Weitere SQL-Befehle abgesichert.";
\r
250 case "0.3.9": // SQL queries for v0.3.9
\r
251 // Update notes (these will be set as task text!)
\r
252 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
\r
255 case "0.4.0": // SQL queries for v0.4.0
\r
256 // Update notes (these will be set as task text!)
\r
257 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
\r
260 case "0.4.1": // SQL queries for v0.4.1
\r
261 // Update notes (these will be set as task text!)
\r
262 $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
\r
265 case "0.4.2": // SQL queries for v0.4.2
\r
266 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD register_default ENUM('Y', 'N') NOT NULL DEFAULT 'N'";
\r
267 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_register2' WHERE what='config_reg' LIMIT 1";
\r
269 // Update notes (these will be set as task text!)
\r
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.";
\r
273 case "0.4.3": // SQL queries for v0.4.3
\r
274 // Update notes (these will be set as task text!)
\r
275 $UPDATE_NOTES = "Parser-Error in <STRONG>inc/modules/guest/what-register.php</STRONG> beseitigt.";
\r
278 case "0.4.4": // SQL queries for v0.4.4
\r
279 // Update notes (these will be set as task text!)
\r
280 $UPDATE_NOTES = "Anmeldefehler (EMail-Adresse war immer ein Ausrufezeichen) beseitigt.";
\r
283 case "0.4.5": // SQL queries for v0.4.5
\r
284 // Update notes (these will be set as task text!)
\r
285 $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
\r
288 case "0.4.6": // SQL queries for v0.4.6
\r
289 // Update notes (these will be set as task text!)
\r
290 $UPDATE_NOTES = "Einstellung nach ".POINTS."-Einstellungen verlagert.";
\r
293 case "0.4.7": // SQL queries for v0.4.7
\r
294 // Update notes (these will be set as task text!)
\r
295 $UPDATE_NOTES = "<STRONG>setcookie()</STRONG> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
\r
298 case "0.4.8": // SQL queries for v0.4.8
\r
299 // Update notes (these will be set as task text!)
\r
300 $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
\r
303 case "0.4.9": // SQL queries for v0.4.9
\r
304 // Update notes (these will be set as task text!)
\r
305 $UPDATE_NOTES = "Problem mit nicht anzeigbaren Kategorien in der Anmeldung beseitigt.";
\r
308 case "0.5.0": // SQL queries for v0.5.0
\r
309 // Update notes (these will be set as task text!)
\r
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.";
\r
313 case "0.5.1": // SQL queries for v0.5.1
\r
314 // Update notes (these will be set as task text!)
\r
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!";
\r
318 case "0.5.2": // SQL queries for v0.5.2
\r
319 // Update notes (these will be set as task text!)
\r
320 $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
\r
325 default: // Do stuff when extension is loaded
\r
326 $DUMMY = LOAD_CONFIG("0");
\r
327 // Copy data to config array
\r
328 $CONFIG['register_default'] = $DUMMY['register_default']; // Is Yes/No the default selection in category selection?
\r
333 // Language file prefix
\r
334 $EXT_LANG_PREFIX = "register";
\r
336 // Extension is always active?
\r
337 $EXT_ALWAYS_ACTIVE = "N";
\r