X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-register.php;h=c1745541512c202d46eff0393d0b5fd504ff2a24;hp=a7eb9b6676f4af60f351efe1c55e4d4e9393fdfa;hb=dabf3d37a62230bc705be02682c656f4cb4a344f;hpb=db0c6702086eea2c44d0aae1702dc2e77a0afc4e diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index a7eb9b6676..c174554151 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-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 * @@ -37,129 +37,40 @@ // 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; - } - - // 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); - - // Other values - $content['surname'] = SQL_ESCAPE(postRequestParameter('surname')); - $content['family'] = SQL_ESCAPE(postRequestParameter('family')); - $content['street_nr'] = SQL_ESCAPE(postRequestParameter('street_nr')); - $content['zip'] = ''; - if (isPostRequestParameterSet('zip')) { - $content['zip'] = bigintval(postRequestParameter('zip')); +} else { + // Is a registration provider selected? + if (!isGetRequestElementSet('registration_provider')) { + // Display selector form + loadTemplate('guest_registration_select'); } // END - if - $content['city'] = SQL_ESCAPE(postRequestParameter('city')); - $content['email'] = SQL_ESCAPE(postRequestParameter('email')); - - // The admin may see all - $whereStatement = "WHERE `is_active`='Y'"; - if (isAdmin()) $whereStatement = ''; - - // Prepare country selection box - $OUT = ''; - $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]