[gnome-web-www] Split if clauses



commit 24e86bd1bde1da078c042ce55d95ab307d670703
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Thu Jun 6 14:08:40 2019 +0200

    Split if clauses

 theme/page-apply.php | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/theme/page-apply.php b/theme/page-apply.php
index 30f039c..13e2ff5 100644
--- a/theme/page-apply.php
+++ b/theme/page-apply.php
@@ -15,21 +15,24 @@ if (array_key_exists('submit', $_POST)) {
     $obfuscated_email = str_replace("@", " AT ", $email);
     $ssh_key = trim($_POST['sshkey']);
     $not_spam = $_POST['not_spam'];
-    
-    if ($not_spam != 'not spam') {
-        $errors = true;
-    }
-
     $summary = trim(stripslashes($_POST['summary']));
     $gnome_mail_alias = trim(stripslashes($_POST['gnome_mail_alias']));
     $gnome_username= trim(stripslashes($_POST['gnome_username']));
     $gnome_jabber = trim(stripslashes($_POST['gnome_jabber']));
     $references = trim(stripslashes($_POST['references']));
     
-    if ($full_name == "" || $email == "" || $summary == "" || $ssh_key == "" || ($gnome_mail_alias == 'on' 
&& $gnome_username == "")) {
+    if ($not_spam != 'not spam') {
         $errors = true;
     }
-    
+
+    if ($full_name == "" || $email == "" || $summary == "" || $ssh_key == "") {
+        $errors = true;
+    }
+
+    if ($gnome_mail_alias != '' && $gnome_username == "") {
+        $errors = true;
+    }
+
     if ($errors == false) {
 
         $formmail = "Contact Information\n" .
@@ -86,14 +89,12 @@ if (array_key_exists('submit', $_POST)) {
         <p class="main_feature" style="text-align: center;">Your application has been submitted and it'll be 
reviewed by the <br /> GNOME Foundation Membership Committee within two weeks.</p>
         <p style="text-align: center"> You can check the status of your application at the following <a 
href="http://www.gnome.org/rt3-stats/membership.html";>page</a>.</p>
         <hr class="top_shadow" />
-
-    <?php if ($errors === true): ?>
+    <?php else: ?>
+        <?php if ($errors == true): ?>
         <p class="main_feature" style="text-align: center;">Some of required fields in the form are missing. 
Please fill them and submit it again.</p>
         <hr class="top_shadow" />
-    <?php endif; ?>
+        <?php endif; ?>
 
-    <?php else: ?>
-    
 <h2 style="text-align: center;">Application Form</h2>
 
 <form action="" method="post" id="application_form">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]