]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-register.php
Updated copyright notice as there are changes in this year
[mailer.git] / inc / modules / guest / what-register.php
index c712e17ca7df4edeecb36187b9d10d03c948bb16..8809d0ed64923338f3f2fccbb3af3b18242a4d3b 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 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
-addMenuDescription('guest', __FILE__);
+addYouAreHereLink('guest', __FILE__);
 
 if (!isExtensionActive('register')) {
-       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('register'));
+       displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=register%}');
        return;
 } elseif (!isExtensionActive('country')) {
-       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('country'));
+       displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=country%}');
        return;
 }
 
@@ -57,111 +55,92 @@ if (!isExtensionActive('register')) {
 //* DEBUG: */ debugOutput('isFormSent=' . intval(isFormSent()) . ',isRegistrationDataComplete=' . intval(isRegistrationDataComplete()) . ',isAdmin=' . intval(isAdmin()));
 if ((isFormSent()) && (isRegistrationDataComplete())) {
        // Do the registration here
-       doRegistration();
+       doUserRegistration();
 
        // Output success registration
-       loadTemplate('admin_settings_saved', false, '{--REGISTRATION_DONE--}');
+       displayMessage('{--REGISTRATION_DONE--}');
 } else {
        // Do this only if form is sent
        if (isFormSent()) {
-               if (postRequestParameter('agree') == '!') {
+               if (postRequestElement('agree') == '!') {
                        registerOutputFailedMessage('HAVE_TO_AGREE');
                } // END - if
 
-               if (postRequestParameter('email') == '!') {
+               if (postRequestElement('email') == '!') {
                        registerOutputFailedMessage('ENTER_EMAIL');
-                       setPostRequestParameter('email', '');
-               } elseif (postRequestParameter('email') == '?') {
-                       registerOutputFailedMessage('EMAIL_ALREADY_DB');
-                       setPostRequestParameter('email', '');
+                       setPostRequestElement('email', '');
+               } elseif (postRequestElement('email') == '?') {
+                       registerOutputFailedMessage('GUEST_EMAIL_IS_ALREADY_REGISTERED');
+                       setPostRequestElement('email', '');
                }
 
-               if (postRequestParameter('surname') == '!') {
+               if (postRequestElement('surname') == '!') {
                        registerOutputFailedMessage('ENTER_SURNAME');
-                       setPostRequestParameter('surname', '');
+                       setPostRequestElement('surname', '');
                } // END - if
 
-               if (postRequestParameter('family') == '!') {
+               if (postRequestElement('family') == '!') {
                        registerOutputFailedMessage('ENTER_FAMILY');
-                       setPostRequestParameter('family', '');
+                       setPostRequestElement('family', '');
                } // END - if
 
-               if ((postRequestParameter('pass1') == '!') && (postRequestParameter('pass2') == '!')) {
+               if ((postRequestElement('password1') == '!') && (postRequestElement('password2') == '!')) {
                        registerOutputFailedMessage('ENTER_BOTH_PASSWORDS');
-               } elseif (postRequestParameter('pass1') == '!') {
-                       registerOutputFailedMessage('ENTER_PASS1');
-               } elseif (postRequestParameter('pass2') == '!') {
-                       registerOutputFailedMessage('ENTER_PASS2');
+               } elseif (postRequestElement('password1') == '!') {
+                       registerOutputFailedMessage('ENTER_PASSWORD1');
+               } elseif (postRequestElement('password2') == '!') {
+                       registerOutputFailedMessage('ENTER_PASSWORD2');
                }
 
-               if ((isset($GLOBALS['registration_short_password'])) && ($GLOBALS['registration_short_password'] === true)) {
-                       registerOutputFailedMessage('SHORT_PASS', ': ' . getConfig('pass_len'));
+               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)) {
+               if ((isset($GLOBALS['registration_ip_timeout'])) && ($GLOBALS['registration_ip_timeout'] === TRUE)) {
                        registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
                } // END - if
 
-               if ((!empty($GLOBALS['register_selected_cats'])) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats'))) {
-                       registerOutputFailedMessage('', getMessage('CATS_LEAST'));
+               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'));
+                       $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('month', postRequestParameter('month')).addSelectionBox('day', postRequestParameter('day')).addSelectionBox('year', postRequestParameter('year'));
+                       $content['birthday_selection'] = addSelectionBox('mo', postRequestElement('month')).addSelectionBox('da', postRequestElement('day')).addSelectionBox('ye', postRequestElement('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);
+       } // END - switch
 
        // Shall I display the refid or shall I make it editable?
-       if (getConfig('display_refid') == 'Y') {
+       if (isDisplayRefidEnabled()) {
                // Load "hide" form template
-               $content['refid_content'] = loadTemplate('guest_register_refid_hide', true);
+               $content['refid_content'] = loadTemplate('guest_register_refid_hide', TRUE);
        } else {
                // Load template to enter it
-               $content['refid_content'] = loadTemplate('guest_register_refid', true);
+               $content['refid_content'] = loadTemplate('guest_register_refid', TRUE);
        }
 
-       // 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'));
+       // ZIP codes are numerical values
+       $content['zip'] = '';
+       if ((isPostRequestElementSet('zip')) && (postRequestElement('zip') > 0)) {
+               $content['zip'] = bigintval(postRequestElement('zip'));
        } // 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  = '<select name="country_code" class="guest_select" size="1">';
-       $OUT .= generateOptionList('countries', 'id', 'descr', postRequestParameter('country_code'), 'code', $whereStatement);
-       $OUT .= '</select>';
-       $content['country'] = $OUT;
+       // Other values
+       foreach (array('gender', 'surname', 'family', 'street_nr', 'city', 'email') as $entry) {
+               $content[$entry] = SQL_ESCAPE(postRequestElement($entry));
+       } // END - foreach
 
        // Set must-fillout fields
        $content = runFilterChain('register_must_fillout', $content);
 
        // Display registration form
-       loadTemplate('guest_register', false, $content);
+       loadTemplate('guest_register', FALSE, $content);
 }
 
 // [EOF]