cvs: php-bugs-web / bug-pwd-finder.php bug.php report.php

From: Date: Fri, 22 Apr 2005 13:25:08 +0000
Subject: cvs: php-bugs-web / bug-pwd-finder.php bug.php report.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-27993@lists.php.net to get a copy of this message
dufuz Fri Apr 22 09:25:08 2005 EDT Modified files: /php-bugs-web bug.php bug-pwd-finder.php report.php Log: Now we actually show the CAPTCHAs # The era of the CAPTCHA ;) http://cvs.php.net/diff.php/php-bugs-web/bug.php?r1=1.74&r2=1.75&ty=u Index: php-bugs-web/bug.php diff -u php-bugs-web/bug.php:1.74 php-bugs-web/bug.php:1.75 --- php-bugs-web/bug.php:1.74 Tue Apr 19 06:54:54 2005 +++ php-bugs-web/bug.php Fri Apr 22 09:25:07 2005 @@ -6,6 +6,9 @@ } $edit = (int)$edit; +// This is for the CAPTCHA image +session_start(); + require_once 'prepend.inc'; require_once 'cvs-auth.inc'; require_once 'trusted-devs.inc'; @@ -22,8 +25,7 @@ list($user,$pw) = explode(":", base64_decode($MAGIC_COOKIE)); } -@mysql_connect("localhost","nobody","") - or die("Unable to connect to SQL server."); +@mysql_connect("localhost","nobody","") or die("Unable to connect to SQL server."); @mysql_select_db("phpbugdb"); # fetch info about the bug into $bug @@ -39,7 +41,10 @@ $res = mysql_query($query); -if ($res) $bug = mysql_fetch_assoc($res); +if ($res) { + $bug = mysql_fetch_assoc($res); +} + if (!$res || !$bug) { commonHeader("No such bug."); echo "<h1 class=\"error\">No such bug #$id!</h1>"; @@ -74,6 +79,10 @@ $errors[] = "You can not add comments for bugs with the statuses:" . join(', ', $no_comments_allowed); } + if (!validate_captcha()) { + $errors[] = 'Incorrect CAPTCHA'; + } + if (!preg_match("/[.\\w+-]+@[.\\w-]+\\.\\w{2,}/i",$in['commentemail'])) { $errors[] = "You must provide a valid email address."; } @@ -433,6 +442,12 @@ <td><input type="text" size="40" maxlength="40" name="in[commentemail]" value="<?php echo clean($in['commentemail'])?>" /></td> <td><input type="hidden" name="id" value="<?php echo $id?>" /><input type="hidden" name="edit" value="<?php echo $edit?>" /><input type="submit" value="Submit" /></td> </tr> + <tr> + <th align="right">CAPTCHA:</th> + <td colspan="2"><font size="-1"> + <?php echo generate_captcha(); ?> + </font></td> + </tr> </table> <div> <textarea cols="60" rows="10" name="ncomment" wrap="physical"><?php echo clean($ncomment);?></textarea> http://cvs.php.net/diff.php/php-bugs-web/bug-pwd-finder.php?r1=1.11&r2=1.12&ty=u Index: php-bugs-web/bug-pwd-finder.php diff -u php-bugs-web/bug-pwd-finder.php:1.11 php-bugs-web/bug-pwd-finder.php:1.12 --- php-bugs-web/bug-pwd-finder.php:1.11 Thu Aug 5 09:55:44 2004 +++ php-bugs-web/bug-pwd-finder.php Fri Apr 22 09:25:07 2005 @@ -1,4 +1,7 @@ <?php +// This is for the CAPTCHA image +session_start(); + require_once 'prepend.inc'; /* See bugs.php for the table layout of bugdb. */ @@ -39,7 +42,9 @@ } } - } else { + } elseif (isset($_POST) && !validate_captcha()) { + $msg = 'Incorrect CAPTCHA'; + } else { $msg = "The provided #$bug_id bug id is invalid."; } @@ -64,8 +69,14 @@ <?php if ($msg) { echo "<p><font color=\"#cc0000\">$msg</font></p>"; } ?> <form method="post" action="<?php echo $PHP_SELF;?>"> -<p><b>Bug Report ID:</b> #<input type="text" size="20" name="bug_id"> -<input type="submit" value="Send"></p> +<p> + <b>Bug Report ID:</b> #<input type="text" size="20" name="bug_id"><br><br> + <b>CAPTCHA:</b> + <font size="-1"> + <?php echo generate_captcha(); ?> + </font> +</p> +<input type="submit" value="Send"> </form> <?php commonFooter(); ?> http://cvs.php.net/diff.php/php-bugs-web/report.php?r1=1.57&r2=1.58&ty=u Index: php-bugs-web/report.php diff -u php-bugs-web/report.php:1.57 php-bugs-web/report.php:1.58 --- php-bugs-web/report.php:1.57 Mon Apr 4 21:55:04 2005 +++ php-bugs-web/report.php Fri Apr 22 09:25:08 2005 @@ -1,5 +1,8 @@ <?php /* vim: set noet ts=4 sw=4: : */ +// This is for the CAPTCHA image +session_start(); + require_once 'prepend.inc'; require_once 'cvs-auth.inc'; @@ -273,6 +276,12 @@ at a later date. [<a href="/bug-pwd-finder.php">Lost a bug password?</a>] </font></td> </tr> + <tr> + <th align="right">CAPTCHA:</th> + <td colspan="2"><font size="-1"> + <?php echo generate_captcha(); ?> + </font></td> + </tr> </table> <table>

« previous php.mirrors (#27993) next »