X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-register.php;h=21fad5d869fc2423b26f8b8794e2a7a688417f1a;hp=874bc241b018bc71571ccc21a4bd801df4ad0f77;hb=15e0995f7a4a4b2c9b1b1a9273f785cf13605829;hpb=c3b4eaf29946349ff058691db2dcb615a5379bb2 diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index 874bc241b0..21fad5d869 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -41,323 +41,56 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.5.5'); +setThisExtensionVersion('0.5.9'); -// Version history array (add more with , '0.1.0' and so on) -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')); +// 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', '0.5.8', '0.5.9')); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running (modules.php?module=admin is called) + case 'setup': // Do stuff when installation is running // SQL commands to run - addExtensionSql(''); + addGuestMenuSql('members', 'register', 'Anmeldung', 2); break; case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_register'"); - addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`'); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_register' LIMIT 1"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='register' LIMIT 1"); + addDropTableSql('must_register'); - // Unregister a filter - unregisterFilter(__FUNCTION__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', true, isExtensionDryRun()); + // Unregister points data + unregisterExtensionPointsData('register_welcome'); + unregisterExtensionPointsData('referral_bonus'); + + // Unregister filter + unregisterFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', TRUE, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', TRUE, isExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension // SQL commands to run - addExtensionSql(''); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `locked`='N',`visible`='Y' WHERE `what`='register' LIMIT 1"); break; case 'deactivate': // Do stuff when admin deactivates this extension // SQL commands to run - addExtensionSql(''); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `locked`='Y',`visible`='N' WHERE `what`='register' LIMIT 1"); break; case 'update': // Update an extension - switch (getCurrentExtensionVersion()) { - case '0.1.0': // SQL queries for v0.1 - addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`'); - addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_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`) -) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci"); - - // 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 Profildaten ändern ein.', 12); - - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Einstellbare Pflichtfelder hinzugefügt."); - break; - - case '0.1.1': // SQL queries for v0.1.1 - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET ext_has_css='Y' WHERE `ext_name`='register' AND ext_has_css='N' LIMIT 1"); - - // This update depends on sql_patches update! - addExtensionDependency('sql_patches'); - - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("CSS-Datei kann per Admin-Bereich ein- und ausgeschaltet werden."); - break; - - case '0.1.3': // SQL queries for v0.1.3 - // This update depends on sql_patches update! - addExtensionDependency('sql_patches'); - - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Standart Referal-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ä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üpunkte im Gast-/Mitgliedsbereich kö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ä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 refid 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 "Solid-Business" eingebaut."); - break; - - case '0.2.5': // SQL queries for v0.2.5 - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Seit Patch 340 überflü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("Referal-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 what-register.php beseitigt."); - break; - - case '0.2.9': // SQL queries for v0.2.9 - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Anrede "Firma" hinzugefügt."); - break; - - case '0.3.0': // SQL queries for v0.3.0 - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Wörter {?mt_word?}, {?mt_word2?} und {?mt_word3?} 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¨tigkeit 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 country, die Sie sich noch optional von meiner Seite herunterladen müssen.
-
-Wichtig: Laden Sie noch das Template guest_register.tpl mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!"); - - // Depends on 'country' - addExtensionDependency('country'); - 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ä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 country in die Anmeldephase klappte die Anmeldung nicht. Die dazu nütige Verknü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ü übernommen."); - break; - - case '0.3.6': // SQL queries for v0.3.6 - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Fehlermeldung Fatal error: Call to undefined function: get_theme() in /../../guest/what-register.php on line 190 beseitigt."); - break; - - case '0.3.7': // SQL queries for v0.3.7 - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Fehlermeldung Fatal error: Call to undefined function: get_curr_themee() in /../../guest/what-register.php on line 190 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 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'"); - - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das Ändern des Templates templates/".getLanguage()."/html/guest/guest_register.tpl ist nicht mehr nö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 inc/modules/guest/what-register.php 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 empty() 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("setSession() 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 md5() auf bessere Funktion generateHash() 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 Fatal error: Call to undefined function registerGenerateCategoryTable() in {?PATH?}/inc/modules/guest/what-register.php on line 434 beseitigt."); - break; - - case '0.5.1': // SQL queries for v0.5.1 - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Mail-Template register-member.tpl gefixt. Danke an wliepe fü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('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 register_must_fillout hinzugefügt, weitere Felder in {?_MYSQL_PREFIX?}_must_register eingefü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üpunkt aus menu-{?DEFAULT_LANG?} heraus geholt."); - break; - - case '0.5.5': // SQL queries for v0.5.5 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `register_generate_password_empty` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); - - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Weiteren Menüpunkt aus menu-{?DEFAULT_LANG?} heraus geholt."); - break; - } // END - switch break; case 'modify': // When the extension got modified break; - case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305. + case 'test': // For testing purposes break; case 'init': // Do stuff when extension is initialized break; default: // Unknown extension mode - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); + reportBug(__FILE__, __LINE__, sprintf('Unknown extension mode %s in extension %s detected.', getExtensionMode(), getCurrentExtensionName())); break; } // END - switch