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