a4df053cdfdc20d8940da475b4e3c617d59c6b90
[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 ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))
36 {
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
38         require($INC);
39 }
40
41 // Version number
42 $EXT_VERSION = "0.5.2";
43
44 // Auto-set extension version
45 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
46
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");
49
50 switch ($EXT_LOAD_MODE)
51 {
52 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
53         // SQL commands to run
54         $SQLs[] = "";
55
56         // Load own CSS file?
57         $EXT_CSS = 'Y';
58         break;
59
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";
63         break;
64
65 case "activate": // Do stuff when admin activates this extension
66         // SQL commands to run
67         $SQLs[] = "";
68         break;
69
70 case "deactivate": // Do stuff when admin deactivates this extension
71         // SQL commands to run
72         $SQLs[] = "";
73         break;
74
75 case "update": // Update an extension
76         switch ($EXT_VER)
77         {
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) NOT NULL auto_increment,
82 field_name varchar(255) not null default '',
83 field_required enum('Y', 'N') not null default 'Y',
84 PRIMARY KEY(id)
85 ) TYPE=MyISAM";
86
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')";
94
95                 // Add admin menu
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)";
97
98                 // Update notes (these will be set as task text!)
99                 $UPDATE_NOTES = "Einstellbare Pflichtfelder hinzugef&uuml;gt.";
100                 break;
101
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";
104
105                 // This update depends on sql_patches update!
106                 $EXT_UPDATE_DEPENDS = "sql_patches";
107
108                 // Update notes (these will be set as task text!)
109                 $UPDATE_NOTES = "CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.";
110                 break;
111
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";
115
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.)";
118                 break;
119
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&auml;ndert.";
123                 break;
124
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";
128                 break;
129
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.";
133                 break;
134
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.";
138                 break;
139
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.";
143                 break;
144
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???)";
148                 break;
149
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.";
153                 break;
154
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&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
158                 break;
159
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&auml;mtliche Sperren bei eingeloggten Admin deaktiviert.";
163                 break;
164
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.";
168                 break;
169
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 &quot;Solid-Business&quot; eingebaut.";
173                 break;
174
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> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
178                 break;
179
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.";
183                 break;
184
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.";
188                 break;
189
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.";
193                 break;
194
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 &quot;Firma&quot; hinzugef&uuml;gt.";
198                 break;
199
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&ouml;rter <STRONG>Mailtausch</STRONG>, <STRONG>Mailtausches</STRONG> und <STRONG>Mailtauscher</STRONG> sind austauschbar.";
203                 break;
204
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&uml;tigkeit hin getestet.";
208                 break;
209
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&amp;what=extensions&amp;do=search\">meiner Seite herunterladen</A> m&uuml;ssen.<br />
213 <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>";
215
216                 // Depends on 'country'
217                 $EXT_UPDATE_DEPENDS = "country";
218                 break;
219
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&auml;ndercodes zur Auswahl angeboten.";
223                 break;
224
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&uuml;tige Verkn&uuml;pfung ist nun eingebaut und die Anmeldung klappt wieder. Vielen Dank nochmals an den Bug-Reporter (Fehlermelder)!";
228                 break;
229
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&uuml; &uuml;bernommen.";
233                 break;
234
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.";
238                 break;
239
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.";
243                 break;
244
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.";
248                 break;
249
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.";
253                 break;
254
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.";
258                 break;
259
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.";
263                 break;
264
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";
268
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 &Auml;ndern des Templates <STRONG>templates/".GET_LANGUAGE()."/html/guest/guest_register.tpl</STRONG> ist nicht mehr n&ouml;tig.";
271                 break;
272
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.";
276                 break;
277
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.";
281                 break;
282
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.";
286                 break;
287
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.";
291                 break;
292
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.";
296                 break;
297
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.";
301                 break;
302
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.";
306                 break;
307
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.";
311                 break;
312
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&uuml;r die Fehlerfindung!";
316                 break;
317
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.";
321                 break;
322         }
323         break;
324
325 default: // Do stuff when extension is loaded
326         $DUMMY = LOAD_CONFIG("0");
327         // Copy data to config array
328         $_CONFIG['register_default'] = $DUMMY['register_default']; // Is Yes/No the default selection in category selection?
329         unset($DUMMY);
330         break;
331 }
332
333 // Language file prefix
334 $EXT_LANG_PREFIX = "register";
335
336 // Extension is always active?
337 $EXT_ALWAYS_ACTIVE = 'N';
338
339 //
340 ?>