[aur-dev] [PATCH 1/2] Fix permission check in pkgreq_close()
Make sure that requests can be auto-accepted if filed by a regular user. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/lib/pkgreqfuncs.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php index 9207043..b2a7089 100644 --- a/web/lib/pkgreqfuncs.inc.php +++ b/web/lib/pkgreqfuncs.inc.php @@ -241,7 +241,7 @@ function pkgreq_close($id, $reason, $comments, $auto_close=false) { $dbh = DB::connect(); $id = intval($id); - if (!has_credential(CRED_PKGREQ_CLOSE)) { + if (!$auto_close && !has_credential(CRED_PKGREQ_CLOSE)) { return array(false, __("Only TUs and developers can close requests.")); } -- 2.1.2
Fixes a regression introduced in c70b340 (Close requests before accepting, 2014-07-29). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/lib/pkgreqfuncs.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php index b2a7089..1b54a6a 100644 --- a/web/lib/pkgreqfuncs.inc.php +++ b/web/lib/pkgreqfuncs.inc.php @@ -199,13 +199,13 @@ function pkgreq_file($ids, $type, $merge_into, $comments) { * maintainer will not be included in the Cc list of the * request notification email. */ + $out_of_date_time = gmdate("Y-m-d", intval($details["OutOfDateTS"])); pkgreq_close($request_id, "accepted", "The package base has been flagged out-of-date " . "since " . $out_of_date_time . ".", true); $q = "UPDATE PackageBases SET MaintainerUID = NULL "; $q.= "WHERE ID = " . $base_id; $dbh->exec($q); - $out_of_date_time = gmdate("Y-m-d", intval($details["OutOfDateTS"])); } return array(true, __("Added request successfully.")); -- 2.1.2
participants (1)
-
Lukas Fleischer