More rewrites to configuration:
[mailer.git] / inc / extensions / ext-register.php
index e99a6fd9269b128aa4e027dfe83838575ca7dc1b..9282339313f941b69602622f74ba23d062b608d4 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.5.7');
+setThisExtensionVersion('0.5.8');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.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', '0.5.6', '0.5.7'));
+setExtensionVersionHistory(array('0.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', '0.5.6', '0.5.7', '0.5.8'));
 
 switch (getExtensionMode()) {
        case 'setup': // Do stuff when installation is running
@@ -79,288 +79,6 @@ switch (getExtensionMode()) {
                break;
 
        case 'update': // Update an extension
-               switch (getCurrentExtensionVersion()) {
-                       case '0.1.0': // SQL queries for v0.1.0
-                               addDropTableSql('must_register');
-                               addCreateTableSql('must_register', "
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`field_name` VARCHAR(255) NOT NULL DEFAULT '',
-`field_required` ENUM('Y','N') NOT NULL DEFAULT 'Y',
-PRIMARY KEY (`id`)",
-                                       'Data which fields the user must fill out');
-
-                               // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('surname', 'Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('family', 'Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('street_nr', 'Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('cntry', 'Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('zip', 'Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('city', 'Y')");
-
-                               // Add admin menu
-                               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);
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Einstellbare Pflichtfelder hinzugef&uuml;gt.");
-                               break;
-
-                       case '0.1.1': // SQL queries for v0.1.1
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Veraltetes Update entfernt.");
-                               break;
-
-                       case '0.1.3': // SQL queries for v0.1.3
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Standard Referral-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
-                               break;
-
-                       case '0.1.4': // SQL queries for v0.1.4
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Wegen des Theme-Supportes hat sich die URL zur CSS-Datei ge&auml;ndert.");
-                               break;
-
-                       case '0.1.5': // SQL queries for v0.1.5
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Konfiguration der Pflichtangaben ausgelagert in Template");
-                               break;
-
-                       case '0.1.6': // SQL queries for v0.1.6
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
-                               break;
-
-                       case '0.1.7': // SQL queries for v0.1.7
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
-                               break;
-
-                       case '0.1.8': // SQL queries for v0.1.8
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
-                               break;
-
-                       case '0.1.9': // SQL queries for v0.1.9
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Pflichtfelder wieder eingebaut (waren irgentwie ausgebaut???)");
-                               break;
-
-                       case '0.2.0': // SQL queries for v0.2.0
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
-                               break;
-
-                       case '0.2.1': // SQL queries for v0.2.1
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Men&uuml;punkte im Gast-/Mitgliedsbereich k&ouml;nnen nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
-                               break;
-
-                       case '0.2.2': // SQL queries for v0.2.2
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("S&auml;mtliche Sperren bei eingeloggten Admin deaktiviert.");
-                               break;
-
-                       case '0.2.3': // SQL queries for v0.2.3
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Cookie <u>refid</u> aus Anmeldeformular entfernt.");
-                               break;
-
-                       case '0.2.4': // SQL queries for v0.2.4
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Design &quot;Solid-Business&quot; eingebaut.");
-                               break;
-
-                       case '0.2.5': // SQL queries for v0.2.5
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Seit <strong>Patch 340</strong> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
-                               break;
-
-                       case '0.2.6': // SQL queries for v0.2.6
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
-                               break;
-
-                       case '0.2.7': // SQL queries for v0.2.7
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Referral-Id wird endlich korrekt gesetzt.");
-                               break;
-
-                       case '0.2.8': // SQL queries for v0.2.8
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Parse error in <u>what-register.php</u> beseitigt.");
-                               break;
-
-                       case '0.2.9': // SQL queries for v0.2.9
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Anrede &quot;Firma&quot; hinzugef&uuml;gt.");
-                               break;
-
-                       case '0.3.0': // SQL queries for v0.3.0
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("W&ouml;rter <strong>{?mt_word?}</strong>, <strong>{?mt_word2?}</strong> und <strong>{?mt_word3?}</strong> sind austauschbar.");
-                               break;
-
-                       case '0.3.1': // SQL queries for v0.3.1
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Email-Adresse wird vor dem Speichern auf G&uuml;ltigkeit hin getestet.");
-                               break;
-
-                       case '0.3.2': // SQL queries for v0.3.2
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <strike>meiner Seite herunterladen</strike> m&uuml;ssen.<br />
-<br />
-<strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!</strong>");
-                               break;
-
-                       case '0.3.3': // SQL queries for v0.3.3
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Es werden dem Mitglied nur aktivierte L&auml;ndercodes zur Auswahl angeboten.");
-                               break;
-
-                       case '0.3.4': // SQL queries for v0.3.4
-                               // Update notes (these will be set as task text!)
-                               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)!");
-                               break;
-
-                       case '0.3.5': // SQL queries for v0.3.5
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Design wird nach Anmeldung auch endlich im Mitgliedsmen&uuml; &uuml;bernommen.");
-                               break;
-
-                       case '0.3.6': // SQL queries for v0.3.6
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Fehlermeldung <strong>Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190</strong> beseitigt.");
-                               break;
-
-                       case '0.3.7': // SQL queries for v0.3.7
-                               // Update notes (these will be set as task text!)
-                               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.");
-                               break;
-
-                       case '0.3.8': // SQL queries for v0.3.8
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Weitere SQL-Befehle abgesichert.");
-                               break;
-
-                       case '0.3.9': // SQL queries for v0.3.9
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
-                               break;
-
-                       case '0.4.0': // SQL queries for v0.4.0
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
-                               break;
-
-                       case '0.4.1': // SQL queries for v0.4.1
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
-                               break;
-
-                       case '0.4.2': // SQL queries for v0.4.2
-                               addConfigAddSql('register_default', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
-
-                               // Update notes (these will be set as task text!)
-                               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.");
-                               break;
-
-                       case '0.4.3': // SQL queries for v0.4.3
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Parser-Error in <strong>inc/modules/guest/what-register.php</strong> beseitigt.");
-                               break;
-
-                       case '0.4.4': // SQL queries for v0.4.4
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Anmeldefehler (EMail-Adresse war immer ein Ausrufezeichen) beseitigt.");
-                               break;
-
-                       case '0.4.5': // SQL queries for v0.4.5
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("if-Anweisungen auf Funktion <strong>empty()</strong> umgestellt.");
-                               break;
-
-                       case '0.4.6': // SQL queries for v0.4.6
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Einstellung nach {?POINTS?}-Einstellungen verlagert.");
-                               break;
-
-                       case '0.4.7': // SQL queries for v0.4.7
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
-                               break;
-
-                       case '0.4.8': // SQL queries for v0.4.8
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
-                               break;
-
-                       case '0.4.9': // SQL queries for v0.4.9
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Problem mit nicht anzeigbaren Kategorien in der Anmeldung beseitigt.");
-                               break;
-
-                       case '0.5.0': // SQL queries for v0.5.0
-                               // Update notes (these will be set as task text!)
-                               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.");
-                               break;
-
-                       case '0.5.1': // SQL queries for v0.5.1
-                               // Update notes (these will be set as task text!)
-                               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!");
-                               break;
-
-                       case '0.5.2': // SQL queries for v0.5.2
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
-                               break;
-
-                       case '0.5.3': // SQL queries for v0.5.3
-                               // Register a filter
-                               registerFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', FALSE, TRUE, isExtensionDryRun());
-
-                               // Run these SQLs
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('gender','Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('email','Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('birthday','Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('marker','Y')");
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Filter <strong>register_must_fillout</strong> hinzugef&uuml;gt, weitere Felder in <span class=\"bad\">{?_MYSQL_PREFIX?}_must_register</span> eingef&uuml;gt.");
-                               break;
-
-                       case '0.5.4': // SQL queries for v0.5.4
-                               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);
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Weiteren Men&uuml;punkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
-                               break;
-
-                       case '0.5.5': // SQL queries for v0.5.5
-                               addConfigAddSql('register_generate_password_empty', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Weiteren Men&uuml;punkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
-                               break;
-
-                       case '0.5.6': // SQL queries for v0.5.6
-                               // Register points data
-                               registerExtensionPointsData('register_welcome', 'points', 'LOCKED', 'DIRECT');
-
-                               // Update notes
-                               setExtensionUpdateNotes("Anmeldewillkommensgutschrift wird nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
-                               break;
-
-                       case '0.5.7': // SQL queries for v0.5.7
-                               // Register a filter
-                               registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', FALSE, TRUE, isExtensionDryRun());
-
-                               // Register points data
-                               registerExtensionPointsData('referral_bonus', 'points', 'LOCKED', 'DIRECT');
-                               registerExtensionPointsData('referral_bonus_ref', 'points', 'LOCKED', 'DIRECT');
-
-                               // Update notes
-                               setExtensionUpdateNotes("Anmeldeformular komplett auf drei Filter umgestrickt (mehr dazu siehe Wiki) und weitere Verwendungszwecke registriert.");
-                               break;
-               } // END - switch
                break;
 
        case 'modify': // When the extension got modified