Network AllAds4You now with request parameters
[mailer.git] / inc / extensions / ext-register.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                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  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
21  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
22  * For more information visit: http://www.mxchange.org                  *
23  *                                                                      *
24  * This program is free software; you can redistribute it and/or modify *
25  * it under the terms of the GNU General Public License as published by *
26  * the Free Software Foundation; either version 2 of the License, or    *
27  * (at your option) any later version.                                  *
28  *                                                                      *
29  * This program is distributed in the hope that it will be useful,      *
30  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
31  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
32  * GNU General Public License for more details.                         *
33  *                                                                      *
34  * You should have received a copy of the GNU General Public License    *
35  * along with this program; if not, write to the Free Software          *
36  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
37  * MA  02110-1301  USA                                                  *
38  ************************************************************************/
39
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
42         die();
43 } // END - if
44
45 // Version number
46 setThisExtensionVersion('0.5.4');
47
48 // Version history array (add more with , '0.1.0' and so on)
49 setExtensionVersionHistory(array('0.0', '0.1.0', '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', '0.5.3', '0.5.4'));
50
51 switch (getExtensionMode()) {
52         case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
53                 // SQL commands to run
54                 addExtensionSql('');
55                 break;
56
57         case 'remove': // Do stuff when removing extension
58                 // SQL commands to run
59                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_register'");
60                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`");
61
62                 // Unregister a filter
63                 unregisterFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', true, getExtensionDryRun());
64                 break;
65
66         case 'activate': // Do stuff when admin activates this extension
67                 // SQL commands to run
68                 addExtensionSql('');
69                 break;
70
71         case 'deactivate': // Do stuff when admin deactivates this extension
72                 // SQL commands to run
73                 addExtensionSql('');
74                 break;
75
76         case 'update': // Update an extension
77                 switch (getCurrentExtensionVersion())
78                 {
79                         case '0.1.0': // SQL queries for v0.1
80                                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`");
81                                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_must_register` (
82 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
83 field_name VARCHAR(255) NOT NULL DEFAULT '',
84 field_required ENUM('Y','N') NOT NULL DEFAULT 'Y',
85 PRIMARY KEY (id)
86 ) TYPE={?_TABLE_TYPE?}");
87
88                                 // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
89                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('surname','Y')");
90                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('family','Y')");
91                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('street_nr','Y')");
92                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('cntry','Y')");
93                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('zip','Y')");
94                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('city','Y')");
95
96                                 // Add admin menu
97                                 addAdminMenuSql('setup','config_register','Pflichtfelder','Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter <strong>Profildaten &auml;ndern</strong> ein.', 12);
98
99                                 // Update notes (these will be set as task text!)
100                                 setExtensionUpdateNotes("Einstellbare Pflichtfelder hinzugef&uuml;gt.");
101                                 break;
102
103                         case '0.1.1': // SQL queries for v0.1.1
104                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET ext_has_css='Y' WHERE `ext_name`='register' AND ext_has_css='N' LIMIT 1");
105
106                                 // This update depends on sql_patches update!
107                                 addExtensionUpdateDependency('sql_patches');
108
109                                 // Update notes (these will be set as task text!)
110                                 setExtensionUpdateNotes("CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden.");
111                                 break;
112
113                         case '0.1.3': // SQL queries for v0.1.3
114                                 // This update depends on sql_patches update!
115                                 addExtensionUpdateDependency('sql_patches');
116
117                                 // Update notes (these will be set as task text!)
118                                 setExtensionUpdateNotes("Standart Referal-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
119                                 break;
120
121                         case '0.1.4': // SQL queries for v0.1.4
122                                 // Update notes (these will be set as task text!)
123                                 setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.");
124                                 break;
125
126                         case '0.1.5': // SQL queries for v0.1.5
127                                 // Update notes (these will be set as task text!)
128                                 setExtensionUpdateNotes("Konfiguration der Pflichtangaben ausgelagert in Template");
129                                 break;
130
131                         case '0.1.6': // SQL queries for v0.1.6
132                                 // Update notes (these will be set as task text!)
133                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
134                                 break;
135
136                         case '0.1.7': // SQL queries for v0.1.7
137                                 // Update notes (these will be set as task text!)
138                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
139                                 break;
140
141                         case '0.1.8': // SQL queries for v0.1.8
142                                 // Update notes (these will be set as task text!)
143                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
144                                 break;
145
146                         case '0.1.9': // SQL queries for v0.1.9
147                                 // Update notes (these will be set as task text!)
148                                 setExtensionUpdateNotes("Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)");
149                                 break;
150
151                         case '0.2.0': // SQL queries for v0.2.0
152                                 // Update notes (these will be set as task text!)
153                                 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
154                                 break;
155
156                         case '0.2.1': // SQL queries for v0.2.1
157                                 // Update notes (these will be set as task text!)
158                                 setExtensionUpdateNotes("Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
159                                 break;
160
161                         case '0.2.2': // SQL queries for v0.2.2
162                                 // Update notes (these will be set as task text!)
163                                 setExtensionUpdateNotes("S&auml;mtliche Sperren bei eingeloggten Admin deaktiviert.");
164                                 break;
165
166                         case '0.2.3': // SQL queries for v0.2.3
167                                 // Update notes (these will be set as task text!)
168                                 setExtensionUpdateNotes("Cookie <u>refid</u> aus Anmeldeformular entfernt.");
169                                 break;
170
171                         case '0.2.4': // SQL queries for v0.2.4
172                                 // Update notes (these will be set as task text!)
173                                 setExtensionUpdateNotes("Design &quot;Solid-Business&quot; eingebaut.");
174                                 break;
175
176                         case '0.2.5': // SQL queries for v0.2.5
177                                 // Update notes (these will be set as task text!)
178                                 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
179                                 break;
180
181                         case '0.2.6': // SQL queries for v0.2.6
182                                 // Update notes (these will be set as task text!)
183                                 setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
184                                 break;
185
186                         case '0.2.7': // SQL queries for v0.2.7
187                                 // Update notes (these will be set as task text!)
188                                 setExtensionUpdateNotes("Referal-Id wird endlich korrekt gesetzt.");
189                                 break;
190
191                         case '0.2.8': // SQL queries for v0.2.8
192                                 // Update notes (these will be set as task text!)
193                                 setExtensionUpdateNotes("Parse error in <u>what-register.php</u> beseitigt.");
194                                 break;
195
196                         case '0.2.9': // SQL queries for v0.2.9
197                                 // Update notes (these will be set as task text!)
198                                 setExtensionUpdateNotes("Anrede &quot;Firma&quot; hinzugef&uuml;gt.");
199                                 break;
200
201                         case '0.3.0': // SQL queries for v0.3.0
202                                 // Update notes (these will be set as task text!)
203                                 setExtensionUpdateNotes("W&ouml;rter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
204                                 break;
205
206                         case '0.3.1': // SQL queries for v0.3.1
207                                 // Update notes (these will be set as task text!)
208                                 setExtensionUpdateNotes("Email-Adresse wird vor dem Speichern auf G&uml;tigkeit hin getestet.");
209                                 break;
210
211                         case '0.3.2': // SQL queries for v0.3.2
212                                 // Update notes (these will be set as task text!)
213                                 setExtensionUpdateNotes("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <strike>meiner Seite herunterladen</strike> m&uuml;ssen.<br />
214 <br />
215 <strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!</strong>");
216
217                                 // Depends on 'country'
218                                 addExtensionUpdateDependency('country');
219                                 break;
220
221                         case '0.3.3': // SQL queries for v0.3.3
222                                 // Update notes (these will be set as task text!)
223                                 setExtensionUpdateNotes("Es werden dem Mitglied nur aktivierte L&auml;ndercodes zur Auswahl angeboten.");
224                                 break;
225
226                         case '0.3.4': // SQL queries for v0.3.4
227                                 // Update notes (these will be set as task text!)
228                                 setExtensionUpdateNotes("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)!");
229                                 break;
230
231                         case '0.3.5': // SQL queries for v0.3.5
232                                 // Update notes (these will be set as task text!)
233                                 setExtensionUpdateNotes("Design wird nach Anmeldung auch endlich im Mitgliedsmen&uuml; &uuml;bernommen.");
234                                 break;
235
236                         case '0.3.6': // SQL queries for v0.3.6
237                                 // Update notes (these will be set as task text!)
238                                 setExtensionUpdateNotes("Fehlermeldung <strong>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</strong> beseitigt.");
239                                 break;
240
241                         case '0.3.7': // SQL queries for v0.3.7
242                                 // Update notes (these will be set as task text!)
243                                 setExtensionUpdateNotes("Fehlermeldung <strong>Fatal error: Call to undefined function: get_curr_theme<u>e</u>() in /../../guest/what-register.php on line 190</strong> beseitigt.");
244                                 break;
245
246                         case '0.3.8': // SQL queries for v0.3.8
247                                 // Update notes (these will be set as task text!)
248                                 setExtensionUpdateNotes("Weitere SQL-Befehle abgesichert.");
249                                 break;
250
251                         case '0.3.9': // SQL queries for v0.3.9
252                                 // Update notes (these will be set as task text!)
253                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
254                                 break;
255
256                         case '0.4.0': // SQL queries for v0.4.0
257                                 // Update notes (these will be set as task text!)
258                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
259                                 break;
260
261                         case '0.4.1': // SQL queries for v0.4.1
262                                 // Update notes (these will be set as task text!)
263                                 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
264                                 break;
265
266                         case '0.4.2': // SQL queries for v0.4.2
267                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'");
268
269                                 // Update notes (these will be set as task text!)
270                                 setExtensionUpdateNotes("Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das &Auml;ndern des Templates <strong>templates/".getLanguage()."/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                                 setExtensionUpdateNotes("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                                 setExtensionUpdateNotes("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                                 setExtensionUpdateNotes("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                                 setExtensionUpdateNotes("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                                 setExtensionUpdateNotes("<strong>setSession()</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                                 setExtensionUpdateNotes("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                                 setExtensionUpdateNotes("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                                 setExtensionUpdateNotes("Fehlermeldung <em><strong>Fatal error:</strong> Call to undefined function registerGenerateCategoryTable() 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                                 setExtensionUpdateNotes("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                                 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
321                                 break;
322
323                         case '0.5.3': // SQL queries for v0.5.3
324                                 // Register a filter
325                                 registerFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', false, true, getExtensionDryRun());
326
327                                 // Run these SQLs
328                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('gender','Y')");
329                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('email','Y')");
330                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('birthday','Y')");
331                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('marker','Y')");
332
333                                 // Update notes (these will be set as task text!)
334                                 setExtensionUpdateNotes("Filter <strong>register_must_fillout</strong> hinzugef&uuml;gt, weitere Felder in <em>{?_MYSQL_PREFIX?}_must_register</em> eingef&uuml;gt.");
335                                 break;
336
337                         case '0.5.4': // SQL queries for v0.5.4
338                                 addAdminMenuSql('setup','config_register2','Anmeldeformular','Stellen Sie ein, wie viel Kategorien der Gast bei der Anmeldung mindestens einstellen muss. Diese Einstellung gilt nachher auch im Mitgliedsbereich!',8);
339
340                                 // Update notes (these will be set as task text!)
341                                 setExtensionUpdateNotes("Weiteren Men&uuml;punkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
342                                 break;
343
344                 } // END - switch
345                 break;
346
347         case 'modify': // When the extension got modified
348                 break;
349
350         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
351                 break;
352
353         case 'init': // Do stuff when extension is initialized
354                 break;
355
356         default: // Unknown extension mode
357                 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
358                 break;
359 } // END - switch
360
361 // [EOF]
362 ?>