Jan Lehnardt wrote:

this was proposed several times already and probably agreed on, too.
All it takes is a developer, who is _that_ annoyed to implement
something like this.
Everything is in CVS, send in patches, not enough karma is not a
valid excuse :)

Have a look at this patch. Maybe it will work ...


--
Ard
Index: cvs-php.php
===================================================================
RCS file: /repository/phpweb/cvs-php.php,v
retrieving revision 1.31
diff -u -r1.31 cvs-php.php
--- cvs-php.php 11 Sep 2003 16:45:13 -0000      1.31
+++ cvs-php.php 12 Mar 2004 13:56:12 -0000
@@ -12,8 +12,8 @@
 <?php
 
 // We have a form submitted, and the user have read all the comments
-if (count($_POST) && isset($_POST['checkread'])) {
+if (count($_POST) && (!is_array($_POST['purpose']) || !count($_POST['purpose']))) {
 
     // Clean up incoming POST vars
     if (get_magic_quotes_gpc()) {
         foreach ($_POST as $k => $v) {
@@ -34,7 +35,7 @@
     if (empty($_POST['fullname'])) {
         $error .= "You must supply your real name. ";
     }
-    if (empty($_POST['purpose'])) {
+    if (empty($_POST['realpurpose'])) {
         $error .= "You must supply a reason for requesting the CVS account. ";
     }
     if (empty($_POST['password'])) {
@@ -53,7 +54,7 @@
                 "name"     => $cleaned['fullname'],
                 "email"    => $cleaned['email'],
                 "passwd"   => $cleaned['password'],
-                "note"     => $cleaned['purpose']
+                "note"     => $cleaned['realpurpose']
             )
         );
         // Error while posting
@@ -127,7 +128,7 @@
 } // endif: no data or checkread not checked
 
 else {
-    if (count($_POST) && !isset($_POST['checkread'])) {
+       if (count($_POST)) {
         print <<<EOT
 <p class="formerror">
  We could not have said it more clearly. Read everything on
@@ -273,8 +274,24 @@
       class="max" value="<?php echo clean($_POST['email']);?>" /></td>
 </tr>
 <tr>
- <th class="subr">Purpose:</th>
- <td><textarea cols="50" rows="5" name="purpose" class="max"><?php echo 
clean($_POST['purpose']);?></textarea></td>
+ <th class="subr">For what purpose do you require a CVS account:<br>
+ (check all that apply)</th>
+ <td>
+<?php 
+$purposes = array("Learning PHP","Coding in PHP","Reading the PHP source",
+       "Using PHP extensions","Creating experimental PHP extensions",
+       "Submitting a patch to PHP","Adding notes to the documentation",
+       "Writing web pages with PHP","Setting up a php.net mirror site");
+
+foreach ($purposes as $i => $p): ?>
+  <input type="checkbox" name="purpose[<?php echo $i?>]" value="1" 
+       <?php echo $_POST['purpose'][$i] == '1' ? "checked":"" ?>/><?php echo $p?><br>
+<?php endforeach; ?>
+ </td>
+</tr>
+<tr>
+ <th class="subr">If your intended purpose is not in the list, <br>please state it 
here:</th>
+ <td><textarea cols="50" rows="5" name="realpurpose" class="max"><?php echo 
clean($_POST['realpurpose']);?></textarea></td>
 </tr>
 <tr>
  <th class="subr">User ID:<br /> <small>(single word, lower case)</small></th>
@@ -286,20 +303,6 @@
  <td><input type="password" size="10" name="password"
       class="max" value="<?php echo clean($_POST['password']);?>" /></td>
 </tr>
-<?php
-// if checkread is set here, we're redisplaying the form because of an error.
-if ($_POST['checkread']) {
-    echo "<input type=\"hidden\" name=\"checkread\" value=\"1\" />\n";
-}
-else {?>
-<tr>
- <th class="subr">You have read <em>all</em> the comments above:</th>
- <td>
-  <input type="checkbox" name="checkread" value="1" />
- </td>
-</tr>
-<?php
-}?>
 <tr>
  <th colspan="2"><input type="submit" value="Send Request" /></th>
 </tr>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to