cc9ad96a6e0ad3c491653e3b2b88ab303207d96f
[mailer.git] / 0.2.1 / inc / extensions / ext-register.php
1 <?php\r
2 /************************************************************************\r
3  * MXChange v0.2.1                                    Start: 04/29/2004 *\r
4  * ================                             Last change: 11/23/2004 *\r
5  *                                                                      *\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
13  *                                                                      *\r
14  * -------------------------------------------------------------------- *\r
15  * Copyright (c) 2003 - 2007 by Roland Haeder                           *\r
16  * For more information visit: http://www.mxchange.org                  *\r
17  *                                                                      *\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
22  *                                                                      *\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
27  *                                                                      *\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
33 \r
34 // Some security stuff...\r
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))\r
36 {\r
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";\r
38         require($INC);\r
39 }\r
40 \r
41 // Version number\r
42 $EXT_VERSION = "0.5.2";\r
43 \r
44 // Auto-set extension version\r
45 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;\r
46 \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
49 \r
50 switch ($EXT_LOAD_MODE)\r
51 {\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
54         $SQLs[] = "";\r
55 \r
56         // Load own CSS file?\r
57         $EXT_CSS = "Y";\r
58         break;\r
59 \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
63         break;\r
64 \r
65 case "activate": // Do stuff when admin activates this extension\r
66         // SQL commands to run\r
67         $SQLs[] = "";\r
68         break;\r
69 \r
70 case "deactivate": // Do stuff when admin deactivates this extension\r
71         // SQL commands to run\r
72         $SQLs[] = "";\r
73         break;\r
74 \r
75 case "update": // Update an extension\r
76         switch ($EXT_VER)\r
77         {\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
84 PRIMARY KEY(id)\r
85 ) TYPE=MyISAM";\r
86 \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
94 \r
95                 // Add admin menu\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 &auml;ndern</STRONG> ein.', 12)";\r
97 \r
98                 // Update notes (these will be set as task text!)\r
99                 $UPDATE_NOTES = "Einstellbare Pflichtfelder hinzugef&uuml;gt.";\r
100                 break;\r
101 \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
104 \r
105                 // This update depends on sql_patches update!\r
106                 $EXT_UPDATE_DEPENDS = "sql_patches";\r
107 \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
110                 break;\r
111 \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
115 \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
118                 break;\r
119 \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&auml;ndert.";\r
123                 break;\r
124 \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
128                 break;\r
129 \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
133                 break;\r
134 \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
138                 break;\r
139 \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
143                 break;\r
144 \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
148                 break;\r
149 \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
153                 break;\r
154 \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&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";\r
158                 break;\r
159 \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&auml;mtliche Sperren bei eingeloggten Admin deaktiviert.";\r
163                 break;\r
164 \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
168                 break;\r
169 \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 &quot;Solid-Business&quot; eingebaut.";\r
173                 break;\r
174 \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> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";\r
178                 break;\r
179 \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
183                 break;\r
184 \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
188                 break;\r
189 \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
193                 break;\r
194 \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 &quot;Firma&quot; hinzugef&uuml;gt.";\r
198                 break;\r
199 \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&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";\r
203                 break;\r
204 \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&uml;tigkeit hin getestet.";\r
208                 break;\r
209 \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&amp;what=extensions&amp;do=search\">meiner Seite herunterladen</A> m&uuml;ssen.<BR>\r
213 <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
215 \r
216                 // Depends on 'country'\r
217                 $EXT_UPDATE_DEPENDS = "country";\r
218                 break;\r
219 \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&auml;ndercodes zur Auswahl angeboten.";\r
223                 break;\r
224 \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&uuml;tige Verkn&uuml;pfung ist nun eingebaut und die Anmeldung klappt wieder. Vielen Dank nochmals an den Bug-Reporter (Fehlermelder)!";\r
228                 break;\r
229 \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&uuml; &uuml;bernommen.";\r
233                 break;\r
234 \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
238                 break;\r
239 \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
243                 break;\r
244 \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
248                 break;\r
249 \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
253                 break;\r
254 \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
258                 break;\r
259 \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
263                 break;\r
264 \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
268 \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 &Auml;ndern des Templates <STRONG>templates/".GET_LANGUAGE()."/html/guest/guest_register.tpl</STRONG> ist nicht mehr n&ouml;tig.";\r
271                 break;\r
272 \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
276                 break;\r
277 \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
281                 break;\r
282 \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
286                 break;\r
287 \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
291                 break;\r
292 \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
296                 break;\r
297 \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
301                 break;\r
302 \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
306                 break;\r
307 \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
311                 break;\r
312 \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&uuml;r die Fehlerfindung!";\r
316                 break;\r
317 \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
321                 break;\r
322         }\r
323         break;\r
324 \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
329         unset($DUMMY);\r
330         break;\r
331 }\r
332 \r
333 // Language file prefix\r
334 $EXT_LANG_PREFIX = "register";\r
335 \r
336 // Extension is always active?\r
337 $EXT_ALWAYS_ACTIVE = "N";\r
338 \r
339 //\r
340 ?>\r