]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/guest/what-register.php
Casting added, fix for bigintval() verifcation
[mailer.git] / inc / modules / guest / what-register.php
index 01773d9b814bed13e12931bcf76744c885974122..6050874d19826384f1b9f646569a1ed2f6d9b740 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -41,13 +41,13 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Add description as navigation point
-addMenuDescription('guest', __FILE__);
+addYouAreHereLink('guest', __FILE__);
 
 if (!isExtensionActive('register')) {
-       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('register'));
+       displayMessage(generateExtensionInactiveNotInstalledMessage('register'));
        return;
 } elseif (!isExtensionActive('country')) {
-       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('country'));
+       displayMessage(generateExtensionInactiveNotInstalledMessage('country'));
        return;
 }
 
@@ -58,7 +58,7 @@ if ((isFormSent()) && (isRegistrationDataComplete())) {
        doRegistration();
 
        // Output success registration
-       loadTemplate('admin_settings_saved', false, '{--REGISTRATION_DONE--}');
+       displayMessage('{--REGISTRATION_DONE--}');
 } else {
        // Do this only if form is sent
        if (isFormSent()) {
@@ -93,15 +93,15 @@ if ((isFormSent()) && (isRegistrationDataComplete())) {
                }
 
                if ((isset($GLOBALS['registration_short_password'])) && ($GLOBALS['registration_short_password'] === true)) {
-                       registerOutputFailedMessage('SHORT_PASS', ': ' . getConfig('pass_len'));
+                       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['register_selected_cats'])) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats'))) {
-                       registerOutputFailedMessage('', '{--CATS_LEAST--}');
+               if ((!empty($GLOBALS['registration_selected_cats'])) && ($GLOBALS['registration_selected_cats'] < getLeastCats())) {
+                       registerOutputFailedMessage('', '{--CHOOSE_MORE_CATEGORIES--}');
                } // END - if
        } // END - if
 
@@ -114,7 +114,7 @@ if ((isFormSent()) && (isRegistrationDataComplete())) {
                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);
@@ -123,7 +123,7 @@ if ((isFormSent()) && (isRegistrationDataComplete())) {
        $content['max_receive_list'] = addMaxReceiveList('guest', '', true);
 
        // 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);
        } else {
@@ -134,20 +134,22 @@ if ((isFormSent()) && (isRegistrationDataComplete())) {
        // 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 ((isPostRequestParameterSet('zip')) && (postRequestParameter('zip') > 0)) {
+               $content['zip'] = bigintval(postRequestParameter('zip'));
        } // END - if
-       $content['city']      = SQL_ESCAPE(postRequestParameter('city'));
-       $content['email']     = SQL_ESCAPE(postRequestParameter('email'));
+
+       // 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 = '';
+       if (isAdmin()) {
+               $whereStatement = '';
+       } // END - if
 
        // Prepare country selection box
        $OUT  = '<select name="country_code" class="form_select" size="1">';