svn: /web/php-bugs/trunk/ include/functions.php www/report.php
| From: | Daniel Egeberg | Date: | Tue, 09 Mar 2010 11:07:13 +0000 |
| Subject: | svn: /web/php-bugs/trunk/ include/functions.php www/report.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-7524@lists.php.net to get a copy of this message | ||
degeberg Tue, 09 Mar 2010 11:07:13 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=295991
Log:
Removed the password requirement on 'Report a bug' for logged in (developer) users.
Changed paths:
U web/php-bugs/trunk/include/functions.php
U web/php-bugs/trunk/www/report.php
Modified: web/php-bugs/trunk/include/functions.php
===================================================================
--- web/php-bugs/trunk/include/functions.php 2010-03-09 09:32:41 UTC (rev 295990)
+++ web/php-bugs/trunk/include/functions.php 2010-03-09 11:07:13 UTC (rev 295991)
@@ -1090,7 +1090,7 @@
*
* @return void
*/
-function incoming_details_are_valid($in, $initial = 0)
+function incoming_details_are_valid($in, $initial = 0, $logged_in = false)
{
global $bug, $dbh, $bug_types;
@@ -1104,7 +1104,7 @@
$errors[] = 'Please provide a valid email address.';
}
}
- if ($initial && empty($in['passwd'])) {
+ if (!$logged_in && $initial && empty($in['passwd'])) {
$errors[] = 'Please provide a password for this bug report.';
}
Modified: web/php-bugs/trunk/www/report.php
===================================================================
--- web/php-bugs/trunk/www/report.php 2010-03-09 09:32:41 UTC (rev 295990)
+++ web/php-bugs/trunk/www/report.php 2010-03-09 11:07:13 UTC (rev 295991)
@@ -23,7 +23,7 @@
// Handle input
if (isset($_POST['in'])) {
- $errors = incoming_details_are_valid($_POST['in'], 1);
+ $errors = incoming_details_are_valid($_POST['in'], 1, $logged_in);
// 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.
@@ -33,6 +33,11 @@
}
}
+ // Set password blank for logged in users. This also disables the lost password feature.
+ if ($logged_in) {
+ $_POST['in']['passwd'] = '';
+ }
+
// try to verify the user
$_POST['in']['email'] = $auth_user->email;
@@ -349,31 +354,33 @@
<form method="post" action="report.php?package=<?php echo
htmlspecialchars($package); ?>" name="bugreport" id="bugreport"
enctype="multipart/form-data">
<input type="hidden" name="in[did_luser_search]" value="<?php echo
isset($_POST['in']['did_luser_search']) ?
$_POST['in']['did_luser_search'] : 0; ?>" />
<table class="form-holder" cellspacing="1">
+<?php if ($logged_in) { ?>
<tr>
-<?php if ($logged_in) { ?>
<th class="form-label_left">Your handle:</th>
<td class="form-input">
<?php echo $auth_user->handle; ?>
<input type="hidden" name="in[email]" value="<?php echo
$auth_user->email; ?>" />
</td>
+ </tr>
<?php } else { ?>
+ <tr>
<th class="form-label_left">Y<span
class="accesskey">o</span>ur email address:<br /><strong>MUST BE
VALID</strong></th>
<td class="form-input">
<input type="text" size="20" maxlength="40"
name="in[email]" value="<?php echo
htmlspecialchars($_POST['in']['email'], ENT_COMPAT, 'UTF-8');
?>" accesskey="o" />
</td>
</th>
-<?php } ?>
</tr>
<tr>
<th class="form-label_left"><span
class="accesskey">P</span>assword:</th>
<td class="form-input">
<input type="password" size="20" maxlength="20"
name="in[passwd]" value="<?php echo
htmlspecialchars($_POST['in']['passwd'], ENT_COMPAT,
'UTF-8');?>" accesskey="p" /><br />
- You <b>must</b> enter any password here, which will be stored for this bug
report.<br />
+ You <strong>must</strong> enter any password here, which will be stored for this
bug report.<br />
This password allows you to come back and modify your submitted bug report at a later date.
[<a href="bug-pwd-finder.php">Lost a bug password?</a>]
</td>
</tr>
+<?php } ?>
<tr>
<th class="form-label_left">PHP version:</th>