d334f152bd4958ab8b9a5d0e5c214f273e846d2a
[mailer.git] / inc / extensions / ext-register.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 04/29/2004 *
4  * ================                             Last change: 11/23/2004 *
5  *                                                                      *
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  * -------------------------------------------------------------------- *
13  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
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.                                  *
22  *                                                                      *
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.                         *
27  *                                                                      *
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,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
37         require($INC);
38 }
39
40 // Version number
41 $EXT_VERSION = "0.5.2";
42
43 // Auto-set extension version
44 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
45
46 // Version history array (add more with , "0.1" and so on)
47 $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");
48
49 switch ($EXT_LOAD_MODE)
50 {
51 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
52         // SQL commands to run
53         $SQLs[] = "";
54
55         // Load own CSS file?
56         $EXT_CSS = "Y";
57         break;
58
59 case "remove": // Do stuff when removing extension
60         // SQL commands to run
61         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='setup' AND what='config_register' LIMIT 1";
62         break;
63
64 case "activate": // Do stuff when admin activates this extension
65         // SQL commands to run
66         $SQLs[] = "";
67         break;
68
69 case "deactivate": // Do stuff when admin deactivates this extension
70         // SQL commands to run
71         $SQLs[] = "";
72         break;
73
74 case "update": // Update an extension
75         switch ($EXT_VER)
76         {
77         case "0.1": // SQL queries for v0.1
78                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_must_register";
79                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_must_register (
80 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
81 field_name VARCHAR(255) NOT NULL DEFAULT '',
82 field_required ENUM('Y', 'N') NOT NULL DEFAULT 'Y',
83 PRIMARY KEY(id)
84 ) TYPE=MyISAM";
85
86                 // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
87                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('surname', 'Y')";
88                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('family_name', 'Y')";
89                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('street_nr', 'Y')";
90                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('cntry', 'Y')";
91                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('zip', 'Y')";
92                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_must_register (field_name, field_required) VALUES ('city', 'Y')";
93
94                 // Add admin menu
95                 $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)";
96
97                 // Update notes (these will be set as task text!)
98                 $UPDATE_NOTES = "Einstellbare Pflichtfelder hinzugef&uuml;gt.";
99                 break;
100
101         case "0.1.1": // SQL queries for v0.1.1
102                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_extensions SET ext_has_css='Y' WHERE ext_name='register' AND ext_has_css='N' LIMIT 1";
103
104                 // This update depends on sql_patches update!
105                 $EXT_UPDATE_DEPENDS = "sql_patches";
106
107                 // Update notes (these will be set as task text!)
108                 $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
109                 break;
110
111         case "0.1.3": // SQL queries for v0.1.3
112                 // This update depends on sql_patches update!
113                 $EXT_UPDATE_DEPENDS = "sql_patches";
114
115                 // Update notes (these will be set as task text!)
116                 $UPDATE_NOTES = "Standart Referral-ID kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)";
117                 break;
118
119         case "0.1.4": // SQL queries for v0.1.4
120                 // Update notes (these will be set as task text!)
121                 $UPDATE_NOTES = "Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.";
122                 break;
123
124         case "0.1.5": // SQL queries for v0.1.5
125                 // Update notes (these will be set as task text!)
126                 $UPDATE_NOTES = "Konfiguration der Pflichtangaben ausgelagert in Template";
127                 break;
128
129         case "0.1.6": // SQL queries for v0.1.6
130                 // Update notes (these will be set as task text!)
131                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
132                 break;
133
134         case "0.1.7": // SQL queries for v0.1.7
135                 // Update notes (these will be set as task text!)
136                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
137                 break;
138
139         case "0.1.8": // SQL queries for v0.1.8
140                 // Update notes (these will be set as task text!)
141                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
142                 break;
143
144         case "0.1.9": // SQL queries for v0.1.9
145                 // Update notes (these will be set as task text!)
146                 $UPDATE_NOTES = "Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)";
147                 break;
148
149         case "0.2.0": // SQL queries for v0.2.0
150                 // Update notes (these will be set as task text!)
151                 $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
152                 break;
153
154         case "0.2.1": // SQL queries for v0.2.1
155                 // Update notes (these will be set as task text!)
156                 $UPDATE_NOTES = "Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
157                 break;
158
159         case "0.2.2": // SQL queries for v0.2.2
160                 // Update notes (these will be set as task text!)
161                 $UPDATE_NOTES = "S&auml;mtliche Sperren bei eingeloggten Admin deaktiviert.";
162                 break;
163
164         case "0.2.3": // SQL queries for v0.2.3
165                 // Update notes (these will be set as task text!)
166                 $UPDATE_NOTES = "Cookie <U>refid</U> aus Anmeldeformular entfernt.";
167                 break;
168
169         case "0.2.4": // SQL queries for v0.2.4
170                 // Update notes (these will be set as task text!)
171                 $UPDATE_NOTES = "Design &quot;Solid-Business&quot; eingebaut.";
172                 break;
173
174         case "0.2.5": // SQL queries for v0.2.5
175                 // Update notes (these will be set as task text!)
176                 $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
177                 break;
178
179         case "0.2.6": // SQL queries for v0.2.6
180                 // Update notes (these will be set as task text!)
181                 $UPDATE_NOTES = "IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.";
182                 break;
183
184         case "0.2.7": // SQL queries for v0.2.7
185                 // Update notes (these will be set as task text!)
186                 $UPDATE_NOTES = "Referral-ID wird endlich korrekt gesetzt.";
187                 break;
188
189         case "0.2.8": // SQL queries for v0.2.8
190                 // Update notes (these will be set as task text!)
191                 $UPDATE_NOTES = "Parse error in <U>what-register.php</U> beseitigt.";
192                 break;
193
194         case "0.2.9": // SQL queries for v0.2.9
195                 // Update notes (these will be set as task text!)
196                 $UPDATE_NOTES = "Anrede &quot;Firma&quot; hinzugef&uuml;gt.";
197                 break;
198
199         case "0.3.0": // SQL queries for v0.3.0
200                 // Update notes (these will be set as task text!)
201                 $UPDATE_NOTES = "W&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
202                 break;
203
204         case "0.3.1": // SQL queries for v0.3.1
205                 // Update notes (these will be set as task text!)
206                 $UPDATE_NOTES = "Email-Adresse wird vor dem Speichern auf G&uml;tigkeit hin getestet.";
207                 break;
208
209         case "0.3.2": // SQL queries for v0.3.2
210                 // Update notes (these will be set as task text!)
211                 $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 />
212 <br />
213 <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>";
214
215                 // Depends on 'country'
216                 $EXT_UPDATE_DEPENDS = "country";
217                 break;
218
219         case "0.3.3": // SQL queries for v0.3.3
220                 // Update notes (these will be set as task text!)
221                 $UPDATE_NOTES = "Es werden dem Mitglied nur aktivierte L&auml;ndercodes zur Auswahl angeboten.";
222                 break;
223
224         case "0.3.4": // SQL queries for v0.3.4
225                 // Update notes (these will be set as task text!)
226                 $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)!";
227                 break;
228
229         case "0.3.5": // SQL queries for v0.3.5
230                 // Update notes (these will be set as task text!)
231                 $UPDATE_NOTES = "Design wird nach Anmeldung auch endlich im Mitgliedsmen&uuml; &uuml;bernommen.";
232                 break;
233
234         case "0.3.6": // SQL queries for v0.3.6
235                 // Update notes (these will be set as task text!)
236                 $UPDATE_NOTES = "Fehlermeldung <STRONG>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</STRONG> beseitigt.";
237                 break;
238
239         case "0.3.7": // SQL queries for v0.3.7
240                 // Update notes (these will be set as task text!)
241                 $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.";
242                 break;
243
244         case "0.3.8": // SQL queries for v0.3.8
245                 // Update notes (these will be set as task text!)
246                 $UPDATE_NOTES = "Weitere SQL-Befehle abgesichert.";
247                 break;
248
249         case "0.3.9": // SQL queries for v0.3.9
250                 // Update notes (these will be set as task text!)
251                 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
252                 break;
253
254         case "0.4.0": // SQL queries for v0.4.0
255                 // Update notes (these will be set as task text!)
256                 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
257                 break;
258
259         case "0.4.1": // SQL queries for v0.4.1
260                 // Update notes (these will be set as task text!)
261                 $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
262                 break;
263
264         case "0.4.2": // SQL queries for v0.4.2
265                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'";
266                 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_admin_menu SET what='config_register2' WHERE what='config_reg' LIMIT 1";
267
268                 // Update notes (these will be set as task text!)
269                 $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.";
270                 break;
271
272         case "0.4.3": // SQL queries for v0.4.3
273                 // Update notes (these will be set as task text!)
274                 $UPDATE_NOTES = "Parser-Error in <STRONG>inc/modules/guest/what-register.php</STRONG> beseitigt.";
275                 break;
276
277         case "0.4.4": // SQL queries for v0.4.4
278                 // Update notes (these will be set as task text!)
279                 $UPDATE_NOTES = "Anmeldefehler (EMail-Adresse war immer ein Ausrufezeichen) beseitigt.";
280                 break;
281
282         case "0.4.5": // SQL queries for v0.4.5
283                 // Update notes (these will be set as task text!)
284                 $UPDATE_NOTES = "if-Anweisungen auf Funktion <STRONG>empty()</STRONG> umgestellt.";
285                 break;
286
287         case "0.4.6": // SQL queries for v0.4.6
288                 // Update notes (these will be set as task text!)
289                 $UPDATE_NOTES = "Einstellung nach ".POINTS."-Einstellungen verlagert.";
290                 break;
291
292         case "0.4.7": // SQL queries for v0.4.7
293                 // Update notes (these will be set as task text!)
294                 $UPDATE_NOTES = "<STRONG>set_session()</STRONG> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
295                 break;
296
297         case "0.4.8": // SQL queries for v0.4.8
298                 // Update notes (these will be set as task text!)
299                 $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";
300                 break;
301
302         case "0.4.9": // SQL queries for v0.4.9
303                 // Update notes (these will be set as task text!)
304                 $UPDATE_NOTES = "Problem mit nicht anzeigbaren Kategorien in der Anmeldung beseitigt.";
305                 break;
306
307         case "0.5.0": // SQL queries for v0.5.0
308                 // Update notes (these will be set as task text!)
309                 $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.";
310                 break;
311
312         case "0.5.1": // SQL queries for v0.5.1
313                 // Update notes (these will be set as task text!)
314                 $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!";
315                 break;
316
317         case "0.5.2": // SQL queries for v0.5.2
318                 // Update notes (these will be set as task text!)
319                 $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
320                 break;
321         }
322         break;
323
324 default: // Do stuff when extension is loaded
325         break;
326 }
327
328 // Language file prefix
329 $EXT_LANG_PREFIX = "register";
330
331 // Extension is always active?
332 $EXT_ALWAYS_ACTIVE = "N";
333
334 //
335 ?>