summaryrefslogtreecommitdiffstats
path: root/web/html
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2015-01-07 12:10:53 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2015-01-07 12:21:21 +0100
commitfc23a9bd5012d07cc6ef9d1eba12f320763068d9 (patch)
tree733f53ac3bcc122afaf6e47a6c3b92cb3da5c66f /web/html
parentb32458cb8a043422bfc2962c03a70deaee9eaca9 (diff)
downloadaurweb-fc23a9bd5012d07cc6ef9d1eba12f320763068d9.tar.xz
Add support for package base co-maintainers
This allows for having multiple co-maintainers for AUR packages. Co-maintainers have push access to the package base Git repository but are not allowed to change the package base category, disown the package or modify the list of co-maintainers. The primary maintainer of an AUR package can edit the list of co-maintainers from the Package Actions box. Implements FS#17911. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html')
-rw-r--r--web/html/comaintainers.php21
-rw-r--r--web/html/index.php3
-rw-r--r--web/html/pkgbase.php4
3 files changed, 27 insertions, 1 deletions
diff --git a/web/html/comaintainers.php b/web/html/comaintainers.php
new file mode 100644
index 0000000..591fcad
--- /dev/null
+++ b/web/html/comaintainers.php
@@ -0,0 +1,21 @@
+<?php
+
+set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
+
+include_once("aur.inc.php");
+include_once("pkgbasefuncs.inc.php");
+
+set_lang();
+check_sid();
+
+if (!isset($base_id) || !has_credential(CRED_PKGBASE_EDIT_COMAINTAINERS, array(pkgbase_maintainer_uid($base_id)))) {
+ header('Location: /');
+ exit();
+}
+
+html_header(__("Manage Co-maintainers"));
+$users = pkgbase_get_comaintainers($base_id);
+include('comaintainers_form.php');
+html_footer(AUR_VERSION);
+
+
diff --git a/web/html/index.php b/web/html/index.php
index 9c321fa..cfd6598 100644
--- a/web/html/index.php
+++ b/web/html/index.php
@@ -78,6 +78,9 @@ if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) {
case "request":
include('pkgreq.php');
return;
+ case "comaintainers":
+ include('comaintainers.php');
+ return;
default:
header("HTTP/1.0 404 Not Found");
include "./404.php";
diff --git a/web/html/pkgbase.php b/web/html/pkgbase.php
index bdce516..201749e 100644
--- a/web/html/pkgbase.php
+++ b/web/html/pkgbase.php
@@ -97,6 +97,8 @@ if (check_token()) {
list($ret, $output) = pkgreq_file($ids, $_POST['type'], $_POST['merge_into'], $_POST['comments']);
} elseif (current_action("do_CloseRequest")) {
list($ret, $output) = pkgreq_close($_POST['reqid'], $_POST['reason'], $_POST['comments']);
+ } elseif (current_action("do_EditComaintainers")) {
+ list($ret, $output) = pkgbase_set_comaintainers($base_id, explode("\n", $_POST['users']));
}
if (isset($_REQUEST['comment'])) {
@@ -124,7 +126,7 @@ if (check_token()) {
}
$pkgs = pkgbase_get_pkgnames($base_id);
-if (count($pkgs) == 1) {
+if (!$output && count($pkgs) == 1) {
/* Not a split package. Redirect to the package page. */
if (empty($_SERVER['QUERY_STRING'])) {
header('Location: ' . get_pkg_uri($pkgs[0]));