[aur-dev] [PATCH 3/6] Allow for closing package requests

Florian Pritz bluewind at xinu.at
Tue Jul 1 12:42:09 EDT 2014


On 25.06.2014 11:44, Lukas Fleischer wrote:
> This allows Trusted Users to close package requests via the request
> list. Also, entries are now sorted such that open requests are shown
> before closed requests.
> 
> Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
> ---
>  UPGRADING                       |  1 +
>  schema/aur-schema.sql           |  1 +
>  web/html/css/aur.css            | 30 ++++++++++++++++--------------
>  web/html/pkgbase.php            |  8 +++++++-
>  web/lib/pkgbasefuncs.inc.php    | 26 ++++++++++++++++++++++++--
>  web/lib/routing.inc.php         |  6 ++++++
>  web/template/pkgreq_results.php | 18 ++++++++++++++++++
>  7 files changed, 73 insertions(+), 17 deletions(-)

>  [...]

> diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
> index 505bb51..a039f83 100644
> --- a/web/lib/pkgbasefuncs.inc.php
> +++ b/web/lib/pkgbasefuncs.inc.php
> @@ -1070,3 +1072,23 @@ function pkgbase_file_request($ids, $type, $comments) {
>  
>  	return array(true, __("Added request successfully."));
>  }
> +
> +/**
> + * Close a deletion/orphan request
> + *
> + * @param int $id The package request to close
> + *
> + * @return void

You return an array, not void.

> + */
> +function pkgbase_close_request($id) {
> +	$dbh = DB::connect();
> +
> +	if (!check_user_privileges()) {
> +		return array(false, __("Only TUs and developers can close requests."));
> +	}
> +
> +	$q = "UPDATE PackageRequests SET Status = 1 WHERE ID = " . intval($id);
> +	$dbh->exec($q);
> +
> +	return array(true, __("Request closed successfully."));
> +}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/aur-dev/attachments/20140701/5db86840/attachment.asc>


More information about the aur-dev mailing list