logo       

cvs: pearweb /public_html/bugs report.php: msg#00055

php.pear.core

Subject: cvs: pearweb /public_html/bugs report.php

cellog Wed Oct 18 19:12:54 2006 UTC

Modified files:
/pearweb/public_html/bugs report.php
Log:
fix Bug #9069: ERROR: Incorrect Captcha

http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/report.php?r1=1.65&r2=1.66&diff_format=u
Index: pearweb/public_html/bugs/report.php
diff -u pearweb/public_html/bugs/report.php:1.65
pearweb/public_html/bugs/report.php:1.66
--- pearweb/public_html/bugs/report.php:1.65 Mon Oct 16 20:48:18 2006
+++ pearweb/public_html/bugs/report.php Wed Oct 18 19:12:54 2006
@@ -17,7 +17,7 @@
* @package Bugs
* @copyright Copyright (c) 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License
- * @version $Id: report.php,v 1.65 2006/10/16 20:48:18 arnaud Exp $
+ * @version $Id: report.php,v 1.66 2006/10/18 19:12:54 cellog Exp $
*/

/**
@@ -53,12 +53,19 @@
if (isset($_POST['in'])) {
$errors = incoming_details_are_valid($_POST['in'], 1, ($auth_user &&
$auth_user->registered));

+ // captcha is not necessary if the user is logged in
+ if ($auth_user && $auth_user->registered) {
+ if (isset($_SESSION['answer'])) {
+ unset($_SESSION['answer']);
+ }
+ }
+
/**
* Check if session answer is set, then compare
* it with the post captcha value. If it's not
* the same, then it's an incorrect password.
*/
- if (isset($_SESSION['answer'])) {
+ if (isset($_SESSION['answer']) && strlen(trim($_SESSION['answer'])) > 0) {
if ($_POST['captcha'] != $_SESSION['answer']) {
$errors[] = 'Incorrect Captcha';
}
@@ -465,6 +472,13 @@
value="<?php echo clean($_POST['in']['php_os']); ?>" />
</td>
</tr>
+ <?php if (!$auth_user): ?>
+ <tr>
+ <th>Solve the problem : <?php print $numeralCaptcha->getOperation(); ?> =
?</th>
+ <td class="form-input"><input type="text" name="captcha" /></td>
+ </tr>
+ <?php $_SESSION['answer'] = $numeralCaptcha->getAnswer(); ?>
+ <?php endif; // if (!$auth_user): ?>
<tr>
<th class="form-label_left">
Summary:
@@ -573,13 +587,6 @@
wrap="physical"><?php echo clean($_POST['in']['actres']); ?></textarea>
</td>
</tr>
- <?php if (!$auth_user) { ?>
- <tr>
- <th>What is the answer to this? : <?php print
$numeralCaptcha->getOperation(); ?></th>
- <td><input type="text" name="captcha" /></td>
- </tr>
- <?php $_SESSION['answer'] = $numeralCaptcha->getAnswer(); ?>
- <?php } ?>
<tr>
<th class="form-label_left">
Submit:

--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise