]> git.mxchange.org Git - mailer.git/commitdiff
Continued with registration provider:
authorRoland Häder <roland@mxchange.org>
Wed, 31 Jul 2013 01:34:28 +0000 (01:34 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 31 Jul 2013 01:34:28 +0000 (01:34 +0000)
- Added a lot filter for both ext-register/wernis to handle (partly finished)
  registration requests and forms
- Add config entry (currently not changeable in web interface) for default
  registration and login provider

17 files changed:
.gitattributes
inc/extensions/ext-register.php
inc/extensions/ext-user.php
inc/extensions/ext-wernis.php
inc/extensions/register/mode-update.php
inc/extensions/user/mode-remove.php
inc/extensions/user/mode-update.php
inc/extensions/wernis/.htaccess [new file with mode: 0644]
inc/extensions/wernis/mode-update.php [new file with mode: 0644]
inc/filter/register_filter.php
inc/filter/user_filter.php
inc/filter/wernis_filter.php [new file with mode: 0644]
inc/libs/network_functions.php
inc/libs/register_functions.php
inc/libs/user_functions.php
inc/modules/guest/what-register.php
templates/de/html/guest/guest_register.tpl

index af7a7ce1b4350046ab2fd8e0cd3547ed217c72a6..80a004b10a97378473de1522cc0646245b731951 100644 (file)
@@ -295,6 +295,8 @@ inc/extensions/user/.htaccess svneol=native#text/plain
 inc/extensions/user/mode-remove.php svneol=native#text/plain
 inc/extensions/user/mode-setup.php svneol=native#text/plain
 inc/extensions/user/mode-update.php svneol=native#text/plain
+inc/extensions/wernis/.htaccess svneol=native#text/plain
+inc/extensions/wernis/mode-update.php svneol=native#text/plain
 inc/filter-functions.php svneol=native#text/plain
 inc/filter/.htaccess svneol=native#text/plain
 inc/filter/_filter.php svneol=native#text/plain
@@ -327,6 +329,7 @@ inc/filter/timezone_filter.php svneol=native#text/plain
 inc/filter/transaction_filter.php svneol=native#text/plain
 inc/filter/uberwach_filter.php svneol=native#text/plain
 inc/filter/user_filter.php svneol=native#text/plain
+inc/filter/wernis_filter.php svneol=native#text/plain
 inc/filters.php svneol=native#text/plain
 inc/fix_filters.php svneol=native#text/plain
 inc/fix_menu.php svneol=native#text/plain
index 21fad5d869fc2423b26f8b8794e2a7a688417f1a..904713111118f45014cd05a839c41d753167100e 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.5.9');
+setThisExtensionVersion('0.6.0');
 
 // 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'));
+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', '0.6.0'));
 
 switch (getExtensionMode()) {
        case 'setup': // Do stuff when installation is running
@@ -65,6 +65,11 @@ switch (getExtensionMode()) {
                // 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());
+               unregisterFilter(__FILE__, __LINE__, 'user_registration', 'GENERIC_USER_REGISTRATION', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'user_registration_done', 'GENERIC_USER_REGISTRATION_DONE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'user_registration_failed', 'GENERIC_USER_REGISTRATION_FAILED', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'user_registration_form', 'GENERIC_USER_REGISTRATION_FORM', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'check_user_registration', 'GENERIC_USER_REGISTRATION_CHECK', TRUE, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
index 4dcc4c25ae431a68db452fdcd1033b54ad807e39..960827873ce445e38bb09e73885a5f463664be7f 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.6.1');
+setThisExtensionVersion('0.6.2');
 
 // 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', '0.6.0', '0.6.1'));
+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', '0.6.0', '0.6.1', '0.6.2'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
index 79256cda881a092d775f184bad9155ba4f332db3..3c5e659fcb43003ccb06dcbfc6b48e93bf4ca37d 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version of this extension
-setThisExtensionVersion('0.0.6');
+setThisExtensionVersion('0.0.7');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7'));
 
 switch (getExtensionMode()) {
        case 'setup': // Do stuff when installation is running
@@ -94,6 +94,13 @@ INDEX (`userid`)",
 
                // Unregister points data
                unregisterExtensionPointsData('wernis_withdraw');
+
+               // Unregister all filters
+               unregisterFilter(__FILE__, __LINE__, 'user_registration', 'WERNIS_USER_REGISTRATION', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'user_registration_done', 'WERNIS_USER_REGISTRATION_DONE', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'user_registration_failed', 'WERNIS_USER_REGISTRATION_FAILED', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'user_registration_form', 'WERNIS_USER_REGISTRATION_FORM', TRUE, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'user_login', 'WERNIS_USER_LOGIN', TRUE, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -109,62 +116,6 @@ INDEX (`userid`)",
                break;
 
        case 'update': // Update an extension
-               switch (getCurrentExtensionVersion()) {
-                       case '0.0.1': // SQL queries for v0.0.1
-                               addConfigAddSql('wernis_payout_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
-                               addConfigAddSql('wernis_withdraw_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
-                               addConfigAddSql('wernis_payout_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000');
-                               addConfigAddSql('wernis_withdraw_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000');
-                               addConfigAddSql('wernis_payout_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
-                               addConfigAddSql('wernis_withdraw_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
-                               addConfigAddSql('wernis_payout_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
-                               addConfigAddSql('wernis_withdraw_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Ein-/Auszahlungsfunktion getrennt ein- und ausschaltbar, sowie mit Umrechungsfaktoren {?POINTS?}-&gt;Wernis versehen. Prozentualer Abzug als &quot;Betreibergeb&uuml;hr hinzugef&uuml;gt, was z.B. f&uuml;r Wechselstuben interessant ist.");
-                               break;
-
-                       case '0.0.2': // SQL queries for v0.0.2
-                               addConfigAddSql('wernis_pass_md5', "VARCHAR(32) NOT NULL DEFAULT ''");
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Auszahlungsfunktion an die neue API 0.2-BETA angepasst. Demnach muss Ihr Wernis-Passwort beim Auszahlen benutzt werden und in Ihrem {?mt_word?} als MD5-Hash gespeichert werden.");
-                               break;
-
-                       case '0.0.3': // SQL queries for v0.0.3
-                               addConfigAddSql('wernis_refid', 'INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT 00000');
-
-                               // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("WDS66-Username muss nun eintragen werden (API-Anpassung).");
-                               break;
-
-                       case '0.0.4': // SQL queries for v0.0.4
-                               // Register points data
-                               registerExtensionPointsData('wernis_withdraw', 'order_points', 'LOCKED', 'DIRECT');
-
-                               // Update notes
-                               setExtensionUpdateNotes("&Uuml;berweisungen vom Portal werden nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
-                               break;
-
-                       case '0.0.5': // SQL queries for v0.0.5
-                               addExtensionChangeTableColumnSql('user_wernis', 'wernis_type', 'wernis_type', "ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED'");
-
-                               // Update notes
-                               setExtensionUpdateNotes("IN/OUT ersetzt mit WITHDRAW/PAYOUT.");
-                               break;
-
-                       case '0.0.6': // SQL queries for v0.0.6
-                               addExtensionChangeTableColumnSql('config', 'wernis_pass_md5', 'wernis_pass_md5', " VARCHAR(255) NOT NULL DEFAULT ''");
-
-                               // Update notes
-                               setExtensionUpdateNotes("Es wird seit API-Version 0.6-BETA SHA256 (hexadezimal kodiert) verwendet.");
-                               break;
-
-                       case '0.0.7': // SQL queries for v0.0.7
-                               // Update notes
-                               setExtensionUpdateNotes("");
-                               break;
-               } // END - switch
                break;
 
        case 'modify': // When the extension got modified
index 99576ee6874e66c0e91ab3890aea8daa9144de91..d5dc82b6200e7cbc36c4c6fb3e10788f0d590495 100644 (file)
@@ -337,7 +337,7 @@ PRIMARY KEY (`id`)",
                                addCreateTableSql('user_register_provider', "
 `provider_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `provider_name` VARCHAR(255) NOT NULL DEFAULT 'local_generic_user_register',
-`provider_extension` VARCHAR(255) NOT NULL DEFAULT 'user',
+`provider_extension` VARCHAR(255) NOT NULL DEFAULT 'register',
 `provider_is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
 PRIMARY KEY (`provider_id`)",
                                        'User register providers');
@@ -351,6 +351,28 @@ PRIMARY KEY (`provider_id`)",
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Tabelle f&uuml;r Mitgliedsanmelde-Provider hinzugef&uuml;gt.");
                                break;
+
+                       case '0.6.0': // SQL queries for v0.6.0
+                               // Register a filter
+                               registerFilter(__FILE__, __LINE__, 'user_registration', 'GENERIC_USER_REGISTRATION', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'user_registration_done', 'GENERIC_USER_REGISTRATION_DONE', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'user_registration_failed', 'GENERIC_USER_REGISTRATION_FAILED', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'user_registration_form', 'GENERIC_USER_REGISTRATION_FORM', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'check_user_registration', 'GENERIC_USER_REGISTRATION_CHECK', FALSE, TRUE, isExtensionDryRun());
+
+                               // Update default entry
+                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_user_register_provider` SET `provider_extension`='register' WHERE `provider_extension`='user'");
+
+                               // Add config entry
+                               // @TODO Make configurable through web interface
+                               addConfigAddSql('default_registration_provider', "VARCHAR(255) NOT NULL DEFAULT 'register'");
+
+                               // Add column for registration provider
+                               addExtensionAddTableColumnSql('user_data', 'registration_provider', "VARCHAR(255) NOT NULL DEFAULT 'register'");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Filter f&uuml;r das Handling der Anmeldeanfragen hinzuge&uuml;gt.");
+                               break;
                } // END - switch
 
 // [EOF]
index 2760f86cacbdea4fb162e11bafb4b059fd4de30b..58f5830cce34edc28195631bfa65ffc2d51558ad 100644 (file)
@@ -72,6 +72,8 @@ unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USE
 unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', TRUE, isExtensionDryRun());
 unregisterFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', TRUE, isExtensionDryRun());
 unregisterFilter(__FILE__, __LINE__, 'member_reflink_extra_content', 'MEMBER_REFLINK_USER_SUBIDS_CONTENT', TRUE, isExtensionDryRun());
+unregisterFilter(__FILE__, __LINE__, 'user_login', 'GENERIC_USER_LOGIN', TRUE, isExtensionDryRun());
+unregisterFilter(__FILE__, __LINE__, 'check_user_login', 'GENERIC_USER_LOGIN_CHECK', TRUE, isExtensionDryRun());
 
 // [EOF]
 ?>
index 7ff71f3a9a486aafde072c6eba65370eb55e5e2b..3a914dc42b4786e29da28f4e47c0ad23259d23a6 100644 (file)
@@ -546,6 +546,22 @@ PRIMARY KEY (`provider_id`)",
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Tabelle f&uuml;r Mitgliedslogin-Provider hinzugef&uuml;gt.");
                                break;
+
+                       case '0.6.2': // SQL queries for v0.6.2
+                               // Register a filter
+                               registerFilter(__FILE__, __LINE__, 'user_login', 'GENERIC_USER_LOGIN', FALSE, TRUE, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'check_user_login', 'GENERIC_USER_LOGIN_CHECK', FALSE, TRUE, isExtensionDryRun());
+
+                               // Add column for login provider
+                               addExtensionAddTableColumnSql('user_data', 'login_provider', "VARCHAR (255) NOT NULL DEFAULT 'user'");
+
+                               // Add config entry
+                               // @TODO Make configurable through web interface
+                               addConfigAddSql('default_login_provider', "VARCHAR(255) NOT NULL DEFAULT 'login'");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Filter f&uuml;r das Handling der Loginanfragen hinzuge&uuml;gt.");
+                               break;
                } // END - switch
 
 // [EOF]
diff --git a/inc/extensions/wernis/.htaccess b/inc/extensions/wernis/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/extensions/wernis/mode-update.php b/inc/extensions/wernis/mode-update.php
new file mode 100644 (file)
index 0000000..6be7b14
--- /dev/null
@@ -0,0 +1,119 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 07/31/2013 *
+ * ===================                          Last change: 07/31/2013 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : mode-update.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Wernis extension                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Auszahlung-Erweiterung                           *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * 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 *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// All updates
+switch (getCurrentExtensionVersion()) {
+       case '0.0.1': // SQL queries for v0.0.1
+               addConfigAddSql('wernis_payout_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
+               addConfigAddSql('wernis_withdraw_active', "ENUM ('Y','N') NOT NULL DEFAULT 'Y'");
+               addConfigAddSql('wernis_payout_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000');
+               addConfigAddSql('wernis_withdraw_factor', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000');
+               addConfigAddSql('wernis_payout_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
+               addConfigAddSql('wernis_withdraw_fee_percent', 'FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000');
+               addConfigAddSql('wernis_payout_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
+               addConfigAddSql('wernis_withdraw_fee_fix', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
+
+               // Update notes (these will be set as task text!)
+               setExtensionUpdateNotes("Ein-/Auszahlungsfunktion getrennt ein- und ausschaltbar, sowie mit Umrechungsfaktoren {?POINTS?}-&gt;Wernis versehen. Prozentualer Abzug als &quot;Betreibergeb&uuml;hr hinzugef&uuml;gt, was z.B. f&uuml;r Wechselstuben interessant ist.");
+               break;
+
+       case '0.0.2': // SQL queries for v0.0.2
+               addConfigAddSql('wernis_pass_md5', "VARCHAR(32) NOT NULL DEFAULT ''");
+
+               // Update notes (these will be set as task text!)
+               setExtensionUpdateNotes("Auszahlungsfunktion an die neue API 0.2-BETA angepasst. Demnach muss Ihr Wernis-Passwort beim Auszahlen benutzt werden und in Ihrem {?mt_word?} als MD5-Hash gespeichert werden.");
+               break;
+
+       case '0.0.3': // SQL queries for v0.0.3
+               addConfigAddSql('wernis_refid', 'INT(5) UNSIGNED ZEROFILL NOT NULL DEFAULT 00000');
+
+               // Update notes (these will be set as task text!)
+               setExtensionUpdateNotes("WDS66-Username muss nun eintragen werden (API-Anpassung).");
+               break;
+
+       case '0.0.4': // SQL queries for v0.0.4
+               // Register points data
+               registerExtensionPointsData('wernis_withdraw', 'order_points', 'LOCKED', 'DIRECT');
+
+               // Update notes
+               setExtensionUpdateNotes("&Uuml;berweisungen vom Portal werden nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
+               break;
+
+       case '0.0.5': // SQL queries for v0.0.5
+               addExtensionChangeTableColumnSql('user_wernis', 'wernis_type', 'wernis_type', "ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED'");
+
+               // Update notes
+               setExtensionUpdateNotes("IN/OUT ersetzt mit WITHDRAW/PAYOUT.");
+               break;
+
+       case '0.0.6': // SQL queries for v0.0.6
+               addExtensionChangeTableColumnSql('config', 'wernis_pass_md5', 'wernis_pass_md5', " VARCHAR(255) NOT NULL DEFAULT ''");
+
+               // Update notes
+               setExtensionUpdateNotes("Es wird seit API-Version 0.6-BETA SHA256 (hexadezimal kodiert) verwendet.");
+               break;
+
+       case '0.0.7': // SQL queries for v0.0.7
+               // This update depends on ext-register and ext-user
+               addExtensionDependency('register');
+               addExtensionDependency('user');
+
+               // Add data to both tables
+               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_register_provider` (`provider_name`, `provider_extension`) VALUES ('wernis_user_registration', 'wernis')");
+               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_user_login_provider` (`provider_name`, `provider_extension`) VALUES ('wernis_user_login', 'wernis')");
+
+               // Register all filters
+               registerFilter(__FILE__, __LINE__, 'user_registration', 'WERNIS_USER_REGISTRATION', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'user_registration_done', 'WERNIS_USER_REGISTRATION_DONE', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'user_registration_failed', 'WERNIS_USER_REGISTRATION_FAILED', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'user_registration_form', 'WERNIS_USER_REGISTRATION_FORM', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'user_login', 'WERNIS_USER_LOGIN', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'check_user_registration', 'WERNIS_USER_REGISTRATION_CHECK', FALSE, TRUE, isExtensionDryRun());
+               registerFilter(__FILE__, __LINE__, 'check_user_login', 'WERNIS_USER_LOGIN_CHECK', FALSE, TRUE, isExtensionDryRun());
+
+               // Update notes
+               setExtensionUpdateNotes("Anmeldung &uuml;rber WDS66 API angefangen: Filter registriert.");
+               break;
+} // END - switch
+
+// [EOF]
+?>
index 156362c2644628a6d778d191faa912d25c0641b3..a96e34080b94a8cae6e57bf67b8d9dbd3306a48a 100644 (file)
@@ -118,5 +118,79 @@ function FILTER_PRE_USER_REGISTRATION_GENERIC ($filterData) {
        return $filterData;
 }
 
+// Filter to run generic user registation (default)
+function FILTER_GENERIC_USER_REGISTRATION ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
+               // Run it
+               $filterData['status'] = doGenericUserRegistration();
+       } // END - if
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
+// Filter to run generic user registation check (default)
+function FILTER_GENERIC_USER_REGISTRATION_CHECK () {
+       // Default is form is not sent
+       $isFormSent = FALSE;
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is the registration provider set?
+       if ((isFormSent()) && (isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
+               // Check form
+               $isFormSent = isRegistrationDataComplete();
+       } // END - if
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $isFormSent;
+}
+
+// Filter to run generic things on registration done
+function FILTER_GENERIC_USER_REGISTRATION_DONE () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
+               // Run it
+               displayMessage('{--REGISTRATION_DONE--}');
+       } // END - if
+
+       // Return NULL
+       return NULL;
+}
+
+// Filter to run generic things on registration failed
+function FILTER_GENERIC_USER_REGISTRATION_FAILED () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'register')) {
+               // This should not be reached
+               reportBug(__FUNCTION__, __LINE__, 'This filter should not handle it.');
+       } // END - if
+
+       // Return NULL
+       return NULL;
+}
+
+// Filter to run generic things on registration form
+function FILTER_GENERIC_USER_REGISTRATION_FORM () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if (((isGetRequestElementSet('registration_provider')) && (getRequestElement('registration_provider') == 'register')) || (getDefaultRegistrationProvider() == 'register')) {
+               // Display generic form
+               doDisplayGenericUserRegistrationForm();
+       } // END - if
+
+       // Return NULL
+       return NULL;
+}
+
 // [EOF]
 ?>
index fde26ce488d497b1afdb2faf653c3c01948970b2..067a154ae3eb0eeda460c6a249ab5b1588963669 100644 (file)
@@ -175,6 +175,8 @@ function FILTER_SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS ($filterData) {
 
 // Generic filter for updating referral counter of currently detected referral id
 function FILTER_GENERIC_UPDATE_USER_REFERRAL ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
        // Make sure the referral id is detected
        assert(isValidReferralId());
 
@@ -182,6 +184,7 @@ function FILTER_GENERIC_UPDATE_USER_REFERRAL ($filterData) {
        sqlQuery('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`={%pipe,getReferralId%} LIMIT 1', __FUNCTION__, __LINE__);
 
        // Return filter data
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
        return $filterData;
 }
 
@@ -272,5 +275,25 @@ function FILTER_MEMBER_REFLINK_USER_SUBIDS_CONTENT ($content = '') {
        return $content;
 }
 
+// Filter for generic user login
+// @TODO 0% done
+function FILTER_GENERIC_USER_LOGIN ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Return filter data
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
+// Filter for generic user login check
+// @TODO 0% done
+function FILTER_GENERIC_USER_LOGIN_CHECK ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Return filter data
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
 // [EOF]
 ?>
diff --git a/inc/filter/wernis_filter.php b/inc/filter/wernis_filter.php
new file mode 100644 (file)
index 0000000..e363645
--- /dev/null
@@ -0,0 +1,133 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 07/31/2013 *
+ * ===================                          Last change: 07/31/2013 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : _filter.php                                      *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext-                                 *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Filter fuer ext-                                 *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * 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 *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Filter to run WDS66 API user registation
+function FILTER_WERNIS_USER_REGISTRATION ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
+               // Run it
+               $filterData['status'] = doWernisUserRegistration();
+       } // END - if
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
+// Filter to run WDS66 API user registation 'done'
+// @TODO 10% done
+function FILTER_WERNIS_USER_REGISTRATION_DONE () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
+               // Run it
+       } // END - if
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return NULL;
+}
+
+// Filter to run WDS66 API user registation 'failed'
+// @TODO 10% done
+function FILTER_WERNIS_USER_REGISTRATION_FAILED () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
+               // Run it
+       } // END - if
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return NULL;
+}
+
+// Filter to run WDS66 API user registation 'form'
+// @TODO 10% done
+function FILTER_WERNIS_USER_REGISTRATION_FORM () {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Is generic user registration selected?
+       if (((isGetRequestElementSet('registration_provider')) && (gettRequestElement('registration_provider') == 'wernis')) || (getDefaultRegistrationProvider() == 'wernis')) {
+               // Run it
+       } // END - if
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return NULL;
+}
+
+// Filter to run WDS66 API user registation check
+function FILTER_WERNIS_USER_REGISTRATION_CHECK ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Return it
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
+// Filter for WDS66 API user login
+// @TODO 0% done
+function FILTER_WERNIS_USER_LOGIN ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Return filter data
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
+// Filter for WDS66 API user login check
+// @TODO 0% done
+function FILTER_WERNIS_USER_LOGIN_CHECK ($filterData) {
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+       // Return filter data
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+       return $filterData;
+}
+
+// [EOF]
+?>
index deabc187338e61f96b79ead8aa03659a3ebf9a01..a13a12487753d245d9dd61a5e5157bec0c8ea9ca 100644 (file)
@@ -1097,7 +1097,7 @@ function isNetworkTypeHandlerConfigured ($networkId, $networkTypeId) {
                        'network_handler_config',
                        'network_data_id',
                        'network_type_id',
-                       true,
+                       TRUE,
                        sprintf(' AND `network_id`=%s', bigintval($networkId))
                ) == 1);
        } // END - if
@@ -2406,8 +2406,8 @@ function doAdminNetworkProcessAddNetworkArrayTranslation () {
                'network_array_translation',
                'network_array_id',
                'network_id',
-               true,
-               sprintf(" AND `network_type_id`=%s", bigintval(postRequestElement('network_type_id')))
+               TRUE,
+               sprintf(' AND `network_type_id`=%s', bigintval(postRequestElement('network_type_id')))
        ) + 1));
 
        // Add the whole request to database
index 9fdf938c698c4f5008ce37e29ab1d281430bd439..b330fea6c1aa225c098f9207a5da1ab5fad26fd3 100644 (file)
@@ -289,6 +289,21 @@ function doUserRegistration () {
                reportBug(__FUNCTION__, __LINE__, 'Tried to register a user account without ext-user installed.');
        } // END - if
 
+       // Init filter data array
+       $filterData = array(
+               // Registration status is always FALSE by default
+               'status' => FALSE,
+       );
+
+       // Run filter chain for user registration
+       $filterData = runFilterChain('user_registration', $filterData);
+
+       // Return status
+       return $filterData['status'];
+}
+
+// Generic user registration
+function doGenericUserRegistration () {
        // Init extra SQL data
        initExtraRegistrationSql();
 
@@ -612,6 +627,18 @@ function isRegisterGeneratePasswordEmptyEnabled () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// Getter for 'default_registration_provider'
+function getDefaultRegistrationProvider () {
+       // Is the cache entry set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // No, so determine it
+               $GLOBALS[__FUNCTION__] = getConfig('default_registration_provider');
+       } // END - if
+
+       // Return cached entry
+       return $GLOBALS[__FUNCTION__];
+}
+
 // "Getter" for least_cats
 function getLeastCats () {
        // Is there cache?
index 34c2c5d8e8cd20cbe617a687d1976bab31c62272..fbf7c455ddd9d78659ae8ebe40b859534c2b8dad 100644 (file)
@@ -875,8 +875,8 @@ function isUserSubIdAssignedToMember ($subId, $userid = NULL) {
                                                'user_subids',
                                                'id',
                                                'userid',
-                                               true,
-                                               sprintf(" AND `id`=%s", bigintval($subId))
+                                               TRUE,
+                                               sprintf(' AND `id`=%s', bigintval($subId))
                                ) == 1
                        )
                );
@@ -923,6 +923,91 @@ function getTotalMemberSubIds () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// Displays generic user registration form
+function doDisplayGenericUserRegistrationForm () {
+       // Do this only if form is sent
+       if (isFormSent()) {
+               if (postRequestElement('agree') == '!') {
+                       registerOutputFailedMessage('HAVE_TO_AGREE');
+               } // END - if
+
+               if (postRequestElement('email') == '!') {
+                       registerOutputFailedMessage('ENTER_EMAIL');
+                       setPostRequestElement('email', '');
+               } elseif (postRequestElement('email') == '?') {
+                       registerOutputFailedMessage('GUEST_EMAIL_IS_ALREADY_REGISTERED');
+                       setPostRequestElement('email', '');
+               }
+
+               if (postRequestElement('surname') == '!') {
+                       registerOutputFailedMessage('ENTER_SURNAME');
+                       setPostRequestElement('surname', '');
+               } // END - if
+
+               if (postRequestElement('family') == '!') {
+                       registerOutputFailedMessage('ENTER_FAMILY');
+                       setPostRequestElement('family', '');
+               } // END - if
+
+               if ((postRequestElement('password1') == '!') && (postRequestElement('password2') == '!')) {
+                       registerOutputFailedMessage('ENTER_BOTH_PASSWORDS');
+               } elseif (postRequestElement('password1') == '!') {
+                       registerOutputFailedMessage('ENTER_PASSWORD1');
+               } elseif (postRequestElement('password2') == '!') {
+                       registerOutputFailedMessage('ENTER_PASSWORD2');
+               }
+
+               if ((isset($GLOBALS['registration_weak_password'])) && ($GLOBALS['registration_weak_password'] === TRUE)) {
+                       registerOutputFailedMessage('GUEST_WEAK_PASSWORD');
+               } // END - if
+
+               if ((isset($GLOBALS['registration_ip_timeout'])) && ($GLOBALS['registration_ip_timeout'] === TRUE)) {
+                       registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
+               } // END - if
+
+               if ((!empty($GLOBALS['registration_selected_cats'])) && ($GLOBALS['registration_selected_cats'] < getLeastCats())) {
+                       registerOutputFailedMessage('', '{--CHOOSE_MORE_CATEGORIES--}');
+               } // END - if
+       } // END - if
+
+       // Generate birthday selection
+       switch (getLanguage()) {
+               case 'de': // German date format
+                       $content['birthday_selection'] = addSelectionBox('da', postRequestElement('day')).addSelectionBox('mo', postRequestElement('month')).addSelectionBox('ye', postRequestElement('year'));
+                       break;
+
+               default: // Default is the US date format... :)
+                       $content['birthday_selection'] = addSelectionBox('mo', postRequestElement('month')).addSelectionBox('da', postRequestElement('day')).addSelectionBox('ye', postRequestElement('year'));
+                       break;
+       } // END - switch
+
+       // Shall I display the refid or shall I make it editable?
+       if (isDisplayRefidEnabled()) {
+               // Load "hide" form template
+               $content['refid_content'] = loadTemplate('guest_register_refid_hide', TRUE);
+       } else {
+               // Load template to enter it
+               $content['refid_content'] = loadTemplate('guest_register_refid', TRUE);
+       }
+
+       // ZIP codes are numerical values
+       $content['zip'] = '';
+       if ((isPostRequestElementSet('zip')) && (isValidNumber(postRequestElement('zip')))) {
+               $content['zip'] = bigintval(postRequestElement('zip'));
+       } // END - if
+
+       // Other values
+       foreach (array('gender', 'surname', 'family', 'street_nr', 'city', 'email') as $entry) {
+               $content[$entry] = sqlEscapeString(postRequestElement($entry));
+       } // END - foreach
+
+       // Set must-fillout fields
+       $content = runFilterChain('register_must_fillout', $content);
+
+       // Display registration form
+       loadTemplate('guest_register', FALSE, $content);
+}
+
 //-----------------------------------------------------------------------------
 //                                EL code functions
 //-----------------------------------------------------------------------------
index d30a787e3f3677b3d313be08f6e4fb7c94b66e53..c1745541512c202d46eff0393d0b5fd504ff2a24 100644 (file)
@@ -53,94 +53,24 @@ if (!isExtensionActive('register')) {
 
 // Is the form sent and all went fine?
 //* DEBUG: */ debugOutput('isFormSent=' . intval(isFormSent()) . ',isRegistrationDataComplete=' . intval(isRegistrationDataComplete()) . ',isAdmin=' . intval(isAdmin()));
-if ((isFormSent()) && (isRegistrationDataComplete())) {
+if (runFilterChain('check_user_registration') === TRUE) {
        // Do the registration here
-       doUserRegistration();
-
-       // Output success registration
-       displayMessage('{--REGISTRATION_DONE--}');
-} else {
-       // Do this only if form is sent
-       if (isFormSent()) {
-               if (postRequestElement('agree') == '!') {
-                       registerOutputFailedMessage('HAVE_TO_AGREE');
-               } // END - if
-
-               if (postRequestElement('email') == '!') {
-                       registerOutputFailedMessage('ENTER_EMAIL');
-                       setPostRequestElement('email', '');
-               } elseif (postRequestElement('email') == '?') {
-                       registerOutputFailedMessage('GUEST_EMAIL_IS_ALREADY_REGISTERED');
-                       setPostRequestElement('email', '');
-               }
-
-               if (postRequestElement('surname') == '!') {
-                       registerOutputFailedMessage('ENTER_SURNAME');
-                       setPostRequestElement('surname', '');
-               } // END - if
-
-               if (postRequestElement('family') == '!') {
-                       registerOutputFailedMessage('ENTER_FAMILY');
-                       setPostRequestElement('family', '');
-               } // END - if
-
-               if ((postRequestElement('password1') == '!') && (postRequestElement('password2') == '!')) {
-                       registerOutputFailedMessage('ENTER_BOTH_PASSWORDS');
-               } elseif (postRequestElement('password1') == '!') {
-                       registerOutputFailedMessage('ENTER_PASSWORD1');
-               } elseif (postRequestElement('password2') == '!') {
-                       registerOutputFailedMessage('ENTER_PASSWORD2');
-               }
-
-               if ((isset($GLOBALS['registration_weak_password'])) && ($GLOBALS['registration_weak_password'] === TRUE)) {
-                       registerOutputFailedMessage('GUEST_WEAK_PASSWORD');
-               } // END - if
-
-               if ((isset($GLOBALS['registration_ip_timeout'])) && ($GLOBALS['registration_ip_timeout'] === TRUE)) {
-                       registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
-               } // END - if
-
-               if ((!empty($GLOBALS['registration_selected_cats'])) && ($GLOBALS['registration_selected_cats'] < getLeastCats())) {
-                       registerOutputFailedMessage('', '{--CHOOSE_MORE_CATEGORIES--}');
-               } // END - if
-       } // END - if
-
-       // Generate birthday selection
-       switch (getLanguage()) {
-               case 'de': // German date format
-                       $content['birthday_selection'] = addSelectionBox('da', postRequestElement('day')).addSelectionBox('mo', postRequestElement('month')).addSelectionBox('ye', postRequestElement('year'));
-                       break;
-
-               default: // Default is the US date format... :)
-                       $content['birthday_selection'] = addSelectionBox('mo', postRequestElement('month')).addSelectionBox('da', postRequestElement('day')).addSelectionBox('ye', postRequestElement('year'));
-                       break;
-       } // END - switch
-
-       // Shall I display the refid or shall I make it editable?
-       if (isDisplayRefidEnabled()) {
-               // Load "hide" form template
-               $content['refid_content'] = loadTemplate('guest_register_refid_hide', TRUE);
+       if (doUserRegistration()) {
+               // All done
+               runFilterChain('user_registration_done');
        } else {
-               // Load template to enter it
-               $content['refid_content'] = loadTemplate('guest_register_refid', TRUE);
+               // Something failed
+               runFilterChain('user_registration_failed');
        }
-
-       // ZIP codes are numerical values
-       $content['zip'] = '';
-       if ((isPostRequestElementSet('zip')) && (isValidNumber(postRequestElement('zip')))) {
-               $content['zip'] = bigintval(postRequestElement('zip'));
+} else {
+       // Is a registration provider selected?
+       if (!isGetRequestElementSet('registration_provider')) {
+               // Display selector form
+               loadTemplate('guest_registration_select');
        } // END - if
 
-       // Other values
-       foreach (array('gender', 'surname', 'family', 'street_nr', 'city', 'email') as $entry) {
-               $content[$entry] = sqlEscapeString(postRequestElement($entry));
-       } // END - foreach
-
-       // Set must-fillout fields
-       $content = runFilterChain('register_must_fillout', $content);
-
        // Display registration form
-       loadTemplate('guest_register', FALSE, $content);
+       runFilterChain('user_registration_form');
 }
 
 // [EOF]
index 33b82024b015f2fb489faa9f3f8d8f2599d64f80..9b2d2e3b2f21b84f4f9143bfe3f7f922e4dc63d7 100644 (file)
@@ -1,5 +1,6 @@
 <div align="center">
 {%form,formMethodPost,formNameRegister=modules.php?module=index&amp;what=register%}
+<input type="hidden" name="registration_provider" value="register" />
 <table border="0" cellspacing="0" cellpadding="0" width="640" class="table dashed">
        <tr>
                <td colspan="2" class="table_header bottom">