[TEP-COMMIT] CVS: admin/admin customers.php,1.83,1.84

Mark Evans <[email protected]>
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Update of /cvsroot/tep/admin/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv21903

Modified Files:
	customers.php 
Log Message:
Fix bug 1500 and add a missing check on the customers gender

Index: customers.php
===================================================================
RCS file: /cvsroot/tep/admin/admin/customers.php,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- customers.php	30 Aug 2003 12:42:26 -0000	1.83
+++ customers.php	26 Dec 2003 14:13:49 -0000	1.84
@@ -42,6 +42,14 @@
         $entry_state = tep_db_prepare_input($HTTP_POST_VARS['entry_state']);
         if (isset($HTTP_POST_VARS['entry_zone_id'])) $entry_zone_id = tep_db_prepare_input($HTTP_POST_VARS['entry_zone_id']);
 
+        if (ACCOUNT_GENDER == 'true') {
+          if (($customers_gender != 'm') && ($customers_gender != 'f')) {
+            $error = true;
+            $entry_gender_error = true;
+          } else {
+            $entry_gender_error = false;
+        }
+
         if (strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
           $error = true;
           $entry_firstname_error = true;
@@ -255,11 +263,13 @@
   var customers_telephone = document.customers.customers_telephone.value;
 
 <?php if (ACCOUNT_GENDER == 'true') { ?>
-  if (document.customers.customers_gender[0].checked || document.customers.customers_gender[1].checked) {
-  } else {
-    error_message = error_message + "<?php echo JS_GENDER; ?>";
-    error = 1;
-  }
+    if (document.customers.elements['customers_gender'].type != "hidden") {
+      if (document.customers.customers_gender[0].checked || document.customers.customers_gender[1].checked) {
+      } else {
+        error_message = error_message + "<?php echo JS_GENDER; ?>";
+        error = 1;
+      }
+    }
 <?php } ?>
 
   if (customers_firstname == "" || customers_firstname.length < <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>) {



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.