com web/bugs: - Added option to close bug by using POST param status=Closed: www/rpc.php
| From: | Felipe Pena | Date: | Sat, 08 Sep 2012 18:02:20 +0000 |
| Subject: | com web/bugs: - Added option to close bug by using POST param status=Closed: www/rpc.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-14658@lists.php.net to get a copy of this message | ||
Commit: 2b8f9f1844bc720e1e65ab373d15165181d867c1
Author: Felipe Pena <felipensp@gmail.com> Sat, 8 Sep 2012 15:02:20 -0300
Parents: 98ae3ac025dc65752c9815cc480bd103e726c2df
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=2b8f9f1844bc720e1e65ab373d15165181d867c1
Log:
- Added option to close bug by using POST param status=Closed
Changed paths:
M www/rpc.php
Diff:
diff --git a/www/rpc.php b/www/rpc.php
index 652ce9a..5468101 100644
--- a/www/rpc.php
+++ b/www/rpc.php
@@ -52,6 +52,19 @@ if (!empty($_POST['ncomment']) &&
!empty($_POST['user'])) {
$res = $prep->execute(array ($bug_id, "{$user}@php.net", $ncomment, $user));
if ($res) {
+ /* Close the bug report as requested if it is not already closed */
+ if (!empty($_POST['status'])
+ && $bug['status'] !== 'Closed'
+ && $_POST['status'] === 'Closed') {
+ $prep = $dbh->prepare("
+ UPDATE bugdb
+ SET status = 'Closed'
+ WHERE id = ?
+ LIMIT 1
+ ");
+ $prep->execute(array($bug_id));
+ }
+
echo json_encode(array('result' => array('status' => $bug)));
exit;
} else {