* $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 *
// Some security stuff...
if (!defined('__SECURITY')) {
- die();
+ exit();
} // END - if
// Add description as navigation point
addYouAreHereLink('guest', __FILE__);
if (!isExtensionActive('register')) {
- displayMessage(generateExtensionInactiveNotInstalledMessage('register'));
+ displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=register%}');
return;
} elseif (!isExtensionActive('country')) {
- displayMessage(generateExtensionInactiveNotInstalledMessage('country'));
+ displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=country%}');
return;
}
// 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
- doRegistration();
-
- // Output success registration
- displayMessage('{--REGISTRATION_DONE--}');
-} else {
- // Do this only if form is sent
- if (isFormSent()) {
- if (postRequestParameter('agree') == '!') {
- registerOutputFailedMessage('HAVE_TO_AGREE');
- } // END - if
-
- if (postRequestParameter('email') == '!') {
- registerOutputFailedMessage('ENTER_EMAIL');
- setPostRequestParameter('email', '');
- } elseif (postRequestParameter('email') == '?') {
- registerOutputFailedMessage('GUEST_EMAIL_ALREADY_DB');
- setPostRequestParameter('email', '');
- }
-
- if (postRequestParameter('surname') == '!') {
- registerOutputFailedMessage('ENTER_SURNAME');
- setPostRequestParameter('surname', '');
- } // END - if
-
- if (postRequestParameter('family') == '!') {
- registerOutputFailedMessage('ENTER_FAMILY');
- setPostRequestParameter('family', '');
- } // END - if
-
- if ((postRequestParameter('pass1') == '!') && (postRequestParameter('pass2') == '!')) {
- registerOutputFailedMessage('ENTER_BOTH_PASSWORDS');
- } elseif (postRequestParameter('pass1') == '!') {
- registerOutputFailedMessage('ENTER_PASS1');
- } elseif (postRequestParameter('pass2') == '!') {
- registerOutputFailedMessage('ENTER_PASS2');
- }
-
- if ((isset($GLOBALS['registration_short_password'])) && ($GLOBALS['registration_short_password'] === true)) {
- registerOutputFailedMessage('GUEST_SHORT_PASS', ': ' . getPassLen());
- } // 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('day', postRequestParameter('day')).addSelectionBox('month', postRequestParameter('month')).addSelectionBox('year', postRequestParameter('year'));
- break;
-
- default: // Default is the US date format... :)
- $content['birthday_selection'] = addSelectionBox('month', postRequestParameter('month')).addSelectionBox('day', postRequestParameter('day')).addSelectionBox('year', postRequestParameter('year'));
- break;
- } // END - switch
-
- // Adds a table for the guests with all visible categories
- $content['category_selection'] = registerGenerateCategoryTable('guest', true);
-
- // Adds maximum receiveable mails list... :)
- $content['max_receive_list'] = addMaxReceiveList('guest', '', true);
-
- // 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');
}
-
- // You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-)
- $content['header_content'] = loadTemplate('register_header', true);
-
- // ZIP codes are numerical values
- $content['zip'] = '';
- if (isPostRequestParameterSet('zip')) {
- $content['zip'] = bigintval(postRequestParameter('zip'));
- } // END - if
-
- // Other values
- foreach (array('gender', 'surname', 'family', 'street_nr', 'city', 'email') as $entry) {
- $content[$entry] = SQL_ESCAPE(postRequestParameter($entry));
- } // END - foreach
-
- // The admin may see all
- $whereStatement = "WHERE `is_active`='Y'";
- if (isAdmin()) {
- $whereStatement = '';
+} else {
+ // Is a registration provider selected?
+ if (!isGetRequestElementSet('registration_provider')) {
+ // Display selector form
+ loadTemplate('guest_registration_select');
} // END - if
- // Prepare country selection box
- $OUT = '<select name="country_code" class="form_select" size="1">';
- $OUT .= generateOptionList('countries', 'id', 'descr', postRequestParameter('country_code'), 'code', $whereStatement);
- $OUT .= '</select>';
- $content['country'] = $OUT;
-
- // Set must-fillout fields
- $content = runFilterChain('register_must_fillout', $content);
-
// Display registration form
- loadTemplate('guest_register', false, $content);
+ runFilterChain('user_registration_form');
}
// [EOF]