[gnome-web-www] Try to fix the validation



commit a103d42a4c40fe8504c02d300d99d651998b3583
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Wed Jun 5 13:40:58 2019 +0200

    Try to fix the validation

 theme/page-apply.php | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/theme/page-apply.php b/theme/page-apply.php
index 26801c4..5feb006 100644
--- a/theme/page-apply.php
+++ b/theme/page-apply.php
@@ -25,7 +25,7 @@ if (array_key_exists('submit', $_POST)) {
     $gnome_jabber = trim(stripslashes($_POST['gnome_jabber']));
     $references = trim(stripslashes($_POST['references']));
     
-    if (empty($full_name) || empty($email) || empty($summary) || empty($ssh_key) || ($gnome_mail_alias == 
'on' && empty($gnome_username))) {
+    if ($full_name == "" || $email == "" || $summary == "" || $ssh_key == "" || ($gnome_mail_alias == 'on' 
&& $gnome_username == "")) {
         $errors = true;
     }
     
@@ -87,11 +87,10 @@ if (array_key_exists('submit', $_POST)) {
         <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>
         
     <?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>
+        <?php endif: ?>
     
-    <?php while ( have_posts() ) : the_post(); ?>
-    <?php the_content(); ?>
-<?php endwhile; // End the loop. Whew. ?>
-
 <hr class="top_shadow" />
 
 <h2 style="text-align: center;">Application Form</h2>


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