don't initialize the textarea with useless spaces, and get the POST
2003-11-11 Vincent Untz <vincent@vuntz.net> * foundation.gnome.org/membership/application.wml: don't initialize the textarea with useless spaces, and get the POST variables ASAP.
This commit is contained in:
		
							parent
							
								
									a0f2656ee2
								
							
						
					
					
						commit
						f1e5238a31
					
				
					 2 changed files with 33 additions and 29 deletions
				
			
		|  | @ -1,3 +1,8 @@ | ||||||
|  | 2003-11-11  Vincent Untz  <vincent@vuntz.net> | ||||||
|  | 
 | ||||||
|  | 	* foundation.gnome.org/membership/application.wml: don't initialize | ||||||
|  | 	the textarea with useless spaces, and get the POST variables ASAP. | ||||||
|  | 
 | ||||||
| 2003-11-11  Vincent Untz  <vincent@vuntz.net> | 2003-11-11  Vincent Untz  <vincent@vuntz.net> | ||||||
| 
 | 
 | ||||||
| 	* foundation.gnome.org/membership/application.wml: obfuscate a bit the | 	* foundation.gnome.org/membership/application.wml: obfuscate a bit the | ||||||
|  |  | ||||||
|  | @ -13,37 +13,44 @@ | ||||||
|   $bad_elements = array(); |   $bad_elements = array(); | ||||||
|   $errors = array(); |   $errors = array(); | ||||||
| 
 | 
 | ||||||
|   if ($_POST['submit']) { |   $submit = $_POST['submit']; | ||||||
|  |   $name = $_POST['name']; | ||||||
|  |   $email = $_POST['email']; | ||||||
|  |   $summary = $_POST['summary']; | ||||||
|  |   $details = $_POST['details']; | ||||||
|  |   $contacts = $_POST['contacts']; | ||||||
|  |   $comments = $_POST['comments']; | ||||||
|  |   $ircnick = $_POST['ircnick']; | ||||||
|  |   $cvsuser = $_POST['cvsuser']; | ||||||
|  |   $previousmember = $_POST['previousmember']; | ||||||
|  | 
 | ||||||
|  |   if ($submit) { | ||||||
|       /* remove the slashes */ |       /* remove the slashes */ | ||||||
|       $name = stripslashes($_POST['name']); |       $name = trim(stripslashes($name)); | ||||||
|       $email = stripslashes($_POST['email']); |       $email = trim(stripslashes($email)); | ||||||
|       $summary = stripslashes($_POST['summary']); |       $summary = trim(stripslashes($summary)); | ||||||
|       $details = stripslashes($_POST['details']); |       $details = trim(stripslashes($details)); | ||||||
|       $contacts = stripslashes($_POST['contacts']); |       $contacts = trim(stripslashes($contacts)); | ||||||
|       $comments = stripslashes($_POST['comments']); |       $comments = trim(stripslashes($comments)); | ||||||
| 
 | 
 | ||||||
|       $ircnick = $_POST['ircnick']; |       if (!$name || $name == "") { | ||||||
|       $cvsuser = $_POST['cvsuser']; |  | ||||||
|       $previousmember = $_POST['previousmember']; |  | ||||||
| 
 |  | ||||||
|       if (!$name || trim($name) == "") { |  | ||||||
|         $bad_elements[] = "name"; |         $bad_elements[] = "name"; | ||||||
|         $errors[] = "Please enter your name."; |         $errors[] = "Please enter your name."; | ||||||
|       } |       } | ||||||
|       if (!$email || !ereg("^[a-zA-Z0-9_.-]+@[a-zA-Z0-9_.-]+\.[a-zA-Z]+$", trim($email))) { |       if (!$email || !ereg("^[a-zA-Z0-9_.-]+@[a-zA-Z0-9_.-]+\.[a-zA-Z]+$", $email)) { | ||||||
|         $bad_elements[] = "email"; |         $bad_elements[] = "email"; | ||||||
|         $errors[] = "Please enter an email address we can use to contact you."; |         $errors[] = "Please enter an email address we can use to contact you."; | ||||||
|       } |       } | ||||||
|       $obfuscated_email = preg_replace("/@/", " AT ", $email); |       $obfuscated_email = preg_replace("/@/", " AT ", $email); | ||||||
| 
 | 
 | ||||||
|       if (!$summary || trim($summary) == "") { |       if (!$summary || $summary == "") { | ||||||
|         $bad_elements[] = "summary"; |         $bad_elements[] = "summary"; | ||||||
|         $errors[] = "Please enter a list of areas of GNOME to which you have made a non-trivial contribution."; |         $errors[] = "Please enter a list of areas of GNOME to which you have made a non-trivial contribution."; | ||||||
|       } else if (!$details || trim($details) == "") { |       } else if (!$details || $details == "") { | ||||||
|         $bad_elements[] = "details"; |         $bad_elements[] = "details"; | ||||||
|         $errors[] = "Please enter a more detailed description of your contributions."; |         $errors[] = "Please enter a more detailed description of your contributions."; | ||||||
|       } |       } | ||||||
|       if (!$contacts || trim($contacts) == "") { |       if (!$contacts || $contacts == "") { | ||||||
|         $bad_elements[] = "contacts"; |         $bad_elements[] = "contacts"; | ||||||
|         $errors[] = "Please enter a list of individuals who can confirm your contributions or indicate us how the membership committee can verify your contributions."; |         $errors[] = "Please enter a list of individuals who can confirm your contributions or indicate us how the membership committee can verify your contributions."; | ||||||
|       } |       } | ||||||
|  | @ -111,7 +118,7 @@ | ||||||
|       } |       } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if (! $_POST['submit'] || count($bad_elements) != 0) {  ?> |   if (! $submit || count($bad_elements) != 0) {  ?> | ||||||
| 
 | 
 | ||||||
|     <p> |     <p> | ||||||
|       To apply for membership in the GNOME Foundation, please complete the |       To apply for membership in the GNOME Foundation, please complete the | ||||||
|  | @ -204,9 +211,7 @@ | ||||||
|         For example, "Documentation, gnomecal, Debian packaging.": |         For example, "Documentation, gnomecal, Debian packaging.": | ||||||
|       </p> |       </p> | ||||||
| 
 | 
 | ||||||
|       <textarea name="summary" rows="3" cols="50"> |       <textarea name="summary" rows="3" cols="50"><?php if ($summary) { echo $summary; } ?></textarea> | ||||||
|         <?php if (trim($summary)) { echo trim($summary); } ?> |  | ||||||
|       </textarea> |  | ||||||
| 
 | 
 | ||||||
|       <p> |       <p> | ||||||
|         Please provide a more detailed description of your contributions to |         Please provide a more detailed description of your contributions to | ||||||
|  | @ -218,9 +223,7 @@ | ||||||
|         for Debian.": |         for Debian.": | ||||||
|       </p> |       </p> | ||||||
| 
 | 
 | ||||||
|       <textarea name="details" rows="10" cols="50"> |       <textarea name="details" rows="10" cols="50"><?php if ($details) { echo $details; } ?></textarea> | ||||||
|         <?php if (trim($details)) { echo trim($details); } ?> |  | ||||||
|       </textarea> |  | ||||||
| 
 | 
 | ||||||
|       <p> |       <p> | ||||||
|         Please list individuals (frequently, but not necessarily, project |         Please list individuals (frequently, but not necessarily, project | ||||||
|  | @ -234,9 +237,7 @@ | ||||||
|         maintainer); packaging logs at http://www.debian.org/packages/gnome/": |         maintainer); packaging logs at http://www.debian.org/packages/gnome/": | ||||||
|       </p> |       </p> | ||||||
| 
 | 
 | ||||||
|       <textarea name="contacts" rows="5" cols="50"> |       <textarea name="contacts" rows="5" cols="50"><?php if ($contacts) { echo $contacts; } ?></textarea> | ||||||
|         <?php if (trim($contacts)) { echo trim($contacts); } ?> |  | ||||||
|       </textarea> |  | ||||||
| 
 | 
 | ||||||
|       <h3>Other Comments</h3> |       <h3>Other Comments</h3> | ||||||
| 
 | 
 | ||||||
|  | @ -245,9 +246,7 @@ | ||||||
|         believe the committee should consider while reviewing your application: |         believe the committee should consider while reviewing your application: | ||||||
|       </p> |       </p> | ||||||
| 
 | 
 | ||||||
|       <textarea name="comments" rows="10" cols="50"> |       <textarea name="comments" rows="10" cols="50"><?php if ($comments) { echo $comments; } ?></textarea> | ||||||
|         <?php if (trim($comments)) { echo trim($comments); } ?> |  | ||||||
|       </textarea> |  | ||||||
| 
 | 
 | ||||||
|       <p> |       <p> | ||||||
|         <div class="center"> |         <div class="center"> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Vincent Untz
						Vincent Untz