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