Added update_year.sh (still not fully flexible) and updated all years with it.
[mailer.git] / inc / extensions / register / mode-update.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 01/23/2013 *
4  * ===================                          Last change: 01/23/2013 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : mode-update.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Swapped out registration system for new members  *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Ausgelagertes Anmeldesystem fuer Mitglieder      *
12  * -------------------------------------------------------------------- *
13  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
14  * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
15  * For more information visit: http://mxchange.org                      *
16  *                                                                      *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or    *
20  * (at your option) any later version.                                  *
21  *                                                                      *
22  * This program is distributed in the hope that it will be useful,      *
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
25  * GNU General Public License for more details.                         *
26  *                                                                      *
27  * You should have received a copy of the GNU General Public License    *
28  * along with this program; if not, write to the Free Software          *
29  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
30  * MA  02110-1301  USA                                                  *
31  ************************************************************************/
32
33 // Some security stuff...
34 if (!defined('__SECURITY')) {
35         die();
36 } // END - if
37
38 // @TODO Remove double tabs from all lines
39                 switch (getCurrentExtensionVersion()) {
40                         case '0.1.0': // SQL queries for v0.1.0
41                                 addDropTableSql('must_register');
42                                 addCreateTableSql('must_register', "
43 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
44 `field_name` VARCHAR(255) NOT NULL DEFAULT '',
45 `field_required` ENUM('Y','N') NOT NULL DEFAULT 'Y',
46 PRIMARY KEY (`id`)",
47                                         'Data which fields the user must fill out');
48
49                                 // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
50                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('surname', 'Y')");
51                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('family', 'Y')");
52                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('street_nr', 'Y')");
53                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('cntry', 'Y')");
54                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('zip', 'Y')");
55                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('city', 'Y')");
56
57                                 // Add admin menu
58                                 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);
59
60                                 // Update notes (these will be set as task text!)
61                                 setExtensionUpdateNotes("Einstellbare Pflichtfelder hinzugef&uuml;gt.");
62                                 break;
63
64                         case '0.1.1': // SQL queries for v0.1.1
65                                 // Update notes (these will be set as task text!)
66                                 setExtensionUpdateNotes("Veraltetes Update entfernt.");
67                                 break;
68
69                         case '0.1.3': // SQL queries for v0.1.3
70                                 // Update notes (these will be set as task text!)
71                                 setExtensionUpdateNotes("Standard Referral-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
72                                 break;
73
74                         case '0.1.4': // SQL queries for v0.1.4
75                                 // Update notes (these will be set as task text!)
76                                 setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.");
77                                 break;
78
79                         case '0.1.5': // SQL queries for v0.1.5
80                                 // Update notes (these will be set as task text!)
81                                 setExtensionUpdateNotes("Konfiguration der Pflichtangaben ausgelagert in Template");
82                                 break;
83
84                         case '0.1.6': // SQL queries for v0.1.6
85                                 // Update notes (these will be set as task text!)
86                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
87                                 break;
88
89                         case '0.1.7': // SQL queries for v0.1.7
90                                 // Update notes (these will be set as task text!)
91                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
92                                 break;
93
94                         case '0.1.8': // SQL queries for v0.1.8
95                                 // Update notes (these will be set as task text!)
96                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
97                                 break;
98
99                         case '0.1.9': // SQL queries for v0.1.9
100                                 // Update notes (these will be set as task text!)
101                                 setExtensionUpdateNotes("Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)");
102                                 break;
103
104                         case '0.2.0': // SQL queries for v0.2.0
105                                 // Update notes (these will be set as task text!)
106                                 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
107                                 break;
108
109                         case '0.2.1': // SQL queries for v0.2.1
110                                 // Update notes (these will be set as task text!)
111                                 setExtensionUpdateNotes("Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
112                                 break;
113
114                         case '0.2.2': // SQL queries for v0.2.2
115                                 // Update notes (these will be set as task text!)
116                                 setExtensionUpdateNotes("S&auml;mtliche Sperren bei eingeloggten Admin deaktiviert.");
117                                 break;
118
119                         case '0.2.3': // SQL queries for v0.2.3
120                                 // Update notes (these will be set as task text!)
121                                 setExtensionUpdateNotes("Cookie <u>refid</u> aus Anmeldeformular entfernt.");
122                                 break;
123
124                         case '0.2.4': // SQL queries for v0.2.4
125                                 // Update notes (these will be set as task text!)
126                                 setExtensionUpdateNotes("Design &quot;Solid-Business&quot; eingebaut.");
127                                 break;
128
129                         case '0.2.5': // SQL queries for v0.2.5
130                                 // Update notes (these will be set as task text!)
131                                 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
132                                 break;
133
134                         case '0.2.6': // SQL queries for v0.2.6
135                                 // Update notes (these will be set as task text!)
136                                 setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
137                                 break;
138
139                         case '0.2.7': // SQL queries for v0.2.7
140                                 // Update notes (these will be set as task text!)
141                                 setExtensionUpdateNotes("Referral-Id wird endlich korrekt gesetzt.");
142                                 break;
143
144                         case '0.2.8': // SQL queries for v0.2.8
145                                 // Update notes (these will be set as task text!)
146                                 setExtensionUpdateNotes("Parse error in <u>what-register.php</u> beseitigt.");
147                                 break;
148
149                         case '0.2.9': // SQL queries for v0.2.9
150                                 // Update notes (these will be set as task text!)
151                                 setExtensionUpdateNotes("Anrede &quot;Firma&quot; hinzugef&uuml;gt.");
152                                 break;
153
154                         case '0.3.0': // SQL queries for v0.3.0
155                                 // Update notes (these will be set as task text!)
156                                 setExtensionUpdateNotes("W&ouml;rter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
157                                 break;
158
159                         case '0.3.1': // SQL queries for v0.3.1
160                                 // Update notes (these will be set as task text!)
161                                 setExtensionUpdateNotes("Email-Adresse wird vor dem Speichern auf G&uuml;ltigkeit hin getestet.");
162                                 break;
163
164                         case '0.3.2': // SQL queries for v0.3.2
165                                 // Update notes (these will be set as task text!)
166                                 setExtensionUpdateNotes("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <strike>meiner Seite herunterladen</strike> m&uuml;ssen.<br />
167 <br />
168 <strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!</strong>");
169                                 break;
170
171                         case '0.3.3': // SQL queries for v0.3.3
172                                 // Update notes (these will be set as task text!)
173                                 setExtensionUpdateNotes("Es werden dem Mitglied nur aktivierte L&auml;ndercodes zur Auswahl angeboten.");
174                                 break;
175
176                         case '0.3.4': // SQL queries for v0.3.4
177                                 // Update notes (these will be set as task text!)
178                                 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)!");
179                                 break;
180
181                         case '0.3.5': // SQL queries for v0.3.5
182                                 // Update notes (these will be set as task text!)
183                                 setExtensionUpdateNotes("Design wird nach Anmeldung auch endlich im Mitgliedsmen&uuml; &uuml;bernommen.");
184                                 break;
185
186                         case '0.3.6': // SQL queries for v0.3.6
187                                 // Update notes (these will be set as task text!)
188                                 setExtensionUpdateNotes("Fehlermeldung <strong>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</strong> beseitigt.");
189                                 break;
190
191                         case '0.3.7': // SQL queries for v0.3.7
192                                 // Update notes (these will be set as task text!)
193                                 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.");
194                                 break;
195
196                         case '0.3.8': // SQL queries for v0.3.8
197                                 // Update notes (these will be set as task text!)
198                                 setExtensionUpdateNotes("Weitere SQL-Befehle abgesichert.");
199                                 break;
200
201                         case '0.3.9': // SQL queries for v0.3.9
202                                 // Update notes (these will be set as task text!)
203                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
204                                 break;
205
206                         case '0.4.0': // SQL queries for v0.4.0
207                                 // Update notes (these will be set as task text!)
208                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
209                                 break;
210
211                         case '0.4.1': // SQL queries for v0.4.1
212                                 // Update notes (these will be set as task text!)
213                                 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
214                                 break;
215
216                         case '0.4.2': // SQL queries for v0.4.2
217                                 addConfigAddSql('register_default', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
218
219                                 // Update notes (these will be set as task text!)
220                                 setExtensionUpdateNotes("Bei der Anmeldung kann die Standard-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.");
221                                 break;
222
223                         case '0.4.3': // SQL queries for v0.4.3
224                                 // Update notes (these will be set as task text!)
225                                 setExtensionUpdateNotes("Parser-Error in <strong>inc/modules/guest/what-register.php</strong> beseitigt.");
226                                 break;
227
228                         case '0.4.4': // SQL queries for v0.4.4
229                                 // Update notes (these will be set as task text!)
230                                 setExtensionUpdateNotes("Anmeldefehler (EMail-Adresse war immer ein Ausrufezeichen) beseitigt.");
231                                 break;
232
233                         case '0.4.5': // SQL queries for v0.4.5
234                                 // Update notes (these will be set as task text!)
235                                 setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
236                                 break;
237
238                         case '0.4.6': // SQL queries for v0.4.6
239                                 // Update notes (these will be set as task text!)
240                                 setExtensionUpdateNotes("Einstellung nach {?POINTS?}-Einstellungen verlagert.");
241                                 break;
242
243                         case '0.4.7': // SQL queries for v0.4.7
244                                 // Update notes (these will be set as task text!)
245                                 setExtensionUpdateNotes("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
246                                 break;
247
248                         case '0.4.8': // SQL queries for v0.4.8
249                                 // Update notes (these will be set as task text!)
250                                 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
251                                 break;
252
253                         case '0.4.9': // SQL queries for v0.4.9
254                                 // Update notes (these will be set as task text!)
255                                 setExtensionUpdateNotes("Problem mit nicht anzeigbaren Kategorien in der Anmeldung beseitigt.");
256                                 break;
257
258                         case '0.5.0': // SQL queries for v0.5.0
259                                 // Update notes (these will be set as task text!)
260                                 setExtensionUpdateNotes("Fehlermeldung <span class=\"bad\"><strong>Fatal error:</strong> Call to undefined function registerGenerateCategoryTable() in <strong>{?PATH?}/inc/modules/guest/what-register.php</strong> on line <strong>434</strong></span> beseitigt.");
261                                 break;
262
263                         case '0.5.1': // SQL queries for v0.5.1
264                                 // Update notes (these will be set as task text!)
265                                 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!");
266                                 break;
267
268                         case '0.5.2': // SQL queries for v0.5.2
269                                 // Update notes (these will be set as task text!)
270                                 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
271                                 break;
272
273                         case '0.5.3': // SQL queries for v0.5.3
274                                 // Register a filter
275                                 registerFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', FALSE, TRUE, isExtensionDryRun());
276
277                                 // Run these SQLs
278                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('gender','Y')");
279                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('email','Y')");
280                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('birthday','Y')");
281                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('marker','Y')");
282
283                                 // Update notes (these will be set as task text!)
284                                 setExtensionUpdateNotes("Filter <strong>register_must_fillout</strong> hinzugef&uuml;gt, weitere Felder in <span class=\"bad\">{?_MYSQL_PREFIX?}_must_register</span> eingef&uuml;gt.");
285                                 break;
286
287                         case '0.5.4': // SQL queries for v0.5.4
288                                 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);
289
290                                 // Update notes (these will be set as task text!)
291                                 setExtensionUpdateNotes("Weiteren Men&uuml;punkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
292                                 break;
293
294                         case '0.5.5': // SQL queries for v0.5.5
295                                 addConfigAddSql('register_generate_password_empty', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
296
297                                 // Update notes (these will be set as task text!)
298                                 setExtensionUpdateNotes("Weiteren Men&uuml;punkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
299                                 break;
300
301                         case '0.5.6': // SQL queries for v0.5.6
302                                 // Register points data
303                                 registerExtensionPointsData('register_welcome', 'points', 'LOCKED', 'DIRECT');
304
305                                 // Update notes
306                                 setExtensionUpdateNotes("Anmeldewillkommensgutschrift wird nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
307                                 break;
308
309                         case '0.5.7': // SQL queries for v0.5.7
310                                 // Register a filter
311                                 registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', FALSE, TRUE, isExtensionDryRun());
312
313                                 // Register points data
314                                 registerExtensionPointsData('referral_bonus', 'points', 'LOCKED', 'DIRECT');
315
316                                 // Update notes
317                                 setExtensionUpdateNotes("Anmeldeformular komplett auf drei Filter umgestrickt (mehr dazu siehe Wiki) und weitere Verwendungszwecke registriert.");
318                                 break;
319
320                         case '0.5.8': // SQL queries for v0.5.8
321                                 addConfigAddSql('least_cats', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 5');
322                                 addConfigAddSql('display_refid', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
323                                 addConfigAddSql('ip_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 86400');
324
325                                 // Update notes
326                                 setExtensionUpdateNotes("Anmeldewillkommensgutschrift wird nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
327                                 break;
328
329                         case '0.5.9': // SQL queries for v0.5.9
330                                 // Add table for user register provider
331                                 addDropTableSql('user_register_provider');
332                                 addCreateTableSql('user_register_provider', "
333 `provider_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
334 `provider_name` VARCHAR(255) NOT NULL DEFAULT 'local_generic_user_register',
335 `provider_extension` VARCHAR(255) NOT NULL DEFAULT 'register',
336 `provider_is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
337 PRIMARY KEY (`provider_id`)",
338                                         'User register providers');
339
340                                 // Add (activated) default entry
341                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_register_provider` (`provider_is_active`) VALUES ('Y')");
342
343                                 // Admin menu
344                                 addAdminMenuSql('setup', 'list_usr_register_provider', 'MRPs verwalten', 'Alle Mitgliederregistrierungsprovider (MRP) auflisten und verwalten.', 11);
345
346                                 // Update notes (these will be set as task text!)
347                                 setExtensionUpdateNotes("Tabelle f&uuml;r Mitgliedsanmelde-Provider hinzugef&uuml;gt.");
348                                 break;
349
350                         case '0.6.0': // SQL queries for v0.6.0
351                                 // Register a filter
352                                 registerFilter(__FILE__, __LINE__, 'user_registration', 'GENERIC_USER_REGISTRATION', FALSE, TRUE, isExtensionDryRun());
353                                 registerFilter(__FILE__, __LINE__, 'user_registration_done', 'GENERIC_USER_REGISTRATION_DONE', FALSE, TRUE, isExtensionDryRun());
354                                 registerFilter(__FILE__, __LINE__, 'user_registration_failed', 'GENERIC_USER_REGISTRATION_FAILED', FALSE, TRUE, isExtensionDryRun());
355                                 registerFilter(__FILE__, __LINE__, 'user_registration_form', 'GENERIC_USER_REGISTRATION_FORM', FALSE, TRUE, isExtensionDryRun());
356                                 registerFilter(__FILE__, __LINE__, 'check_user_registration', 'GENERIC_USER_REGISTRATION_CHECK', FALSE, TRUE, isExtensionDryRun());
357
358                                 // Update default entry
359                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_register_provider` SET `provider_extension`='register' WHERE `provider_extension`='user'");
360
361                                 // Add config entry
362                                 // @TODO Make configurable through web interface
363                                 addConfigAddSql('default_registration_provider', "VARCHAR(255) NOT NULL DEFAULT 'register'");
364
365                                 // Add column for registration provider
366                                 addExtensionAddTableColumnSql('user_data', 'registration_provider', "VARCHAR(255) NOT NULL DEFAULT 'register'");
367
368                                 // Update notes (these will be set as task text!)
369                                 setExtensionUpdateNotes("Filter f&uuml;r das Handling der Anmeldeanfragen hinzuge&uuml;gt.");
370                                 break;
371                 } // END - switch
372
373 // [EOF]
374 ?>