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
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
} // 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
// 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
} // 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');
} // 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
// 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
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?}->Wernis versehen. Prozentualer Abzug als "Betreibergebühr hinzugefügt, was z.B. fü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("Überweisungen vom Portal werden nun ü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
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');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Tabelle für Mitgliedsanmelde-Provider hinzugefü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ür das Handling der Anmeldeanfragen hinzugeügt.");
+ break;
} // END - switch
// [EOF]
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]
?>
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Tabelle für Mitgliedslogin-Provider hinzugefü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ür das Handling der Loginanfragen hinzugeügt.");
+ break;
} // END - switch
// [EOF]
--- /dev/null
+Deny from all
--- /dev/null
+<?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?}->Wernis versehen. Prozentualer Abzug als "Betreibergebühr hinzugefügt, was z.B. fü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("Überweisungen vom Portal werden nun ü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 ürber WDS66 API angefangen: Filter registriert.");
+ break;
+} // END - switch
+
+// [EOF]
+?>
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]
?>
// 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());
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;
}
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]
?>
--- /dev/null
+<?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]
+?>
'network_handler_config',
'network_data_id',
'network_type_id',
- true,
+ TRUE,
sprintf(' AND `network_id`=%s', bigintval($networkId))
) == 1);
} // END - if
'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
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();
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?
'user_subids',
'id',
'userid',
- true,
- sprintf(" AND `id`=%s", bigintval($subId))
+ TRUE,
+ sprintf(' AND `id`=%s', bigintval($subId))
) == 1
)
);
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
//-----------------------------------------------------------------------------
// 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]
<div align="center">
{%form,formMethodPost,formNameRegister=modules.php?module=index&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">