Commit a5fd2bb3 authored by Johannes Löthberg's avatar Johannes Löthberg Committed by Lukas Fleischer
Browse files

Let co-maintainers unflag the package


Signed-off-by: Johannes Löthberg's avatarJohannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
parent 5eb7354e
...@@ -411,7 +411,8 @@ function pkgbase_unflag($base_ids) { ...@@ -411,7 +411,8 @@ function pkgbase_unflag($base_ids) {
$q.= "OutOfDateTS = NULL "; $q.= "OutOfDateTS = NULL ";
$q.= "WHERE ID IN (" . implode(",", $base_ids) . ") "; $q.= "WHERE ID IN (" . implode(",", $base_ids) . ") ";
if (!has_credential(CRED_PKGBASE_UNFLAG)) { $maintainers = array_merge(pkgbase_maintainer_uids($base_ids), pkgbase_get_comaintainer_uids($base_ids));
if (!has_credential(CRED_PKGBASE_UNFLAG, $maintainers)) {
$q.= "AND MaintainerUID = " . $uid; $q.= "AND MaintainerUID = " . $uid;
} }
......
...@@ -18,6 +18,12 @@ $maintainer = username_from_id($row["MaintainerUID"]); ...@@ -18,6 +18,12 @@ $maintainer = username_from_id($row["MaintainerUID"]);
$comaintainers = pkgbase_get_comaintainers($base_id); $comaintainers = pkgbase_get_comaintainers($base_id);
$packager = username_from_id($row["PackagerUID"]); $packager = username_from_id($row["PackagerUID"]);
if ($row["MaintainerUID"] !== NULL) {
$maintainers = array_merge(array($row["MaintainerUID"]), pkgbase_get_comaintainer_uids(array($base_id)));
} else {
$maintainers = NULL;
}
$votes = $row['NumVotes']; $votes = $row['NumVotes'];
# In case of wanting to put a custom message # In case of wanting to put a custom message
...@@ -99,7 +105,7 @@ $sources = pkg_sources($row["ID"]); ...@@ -99,7 +105,7 @@ $sources = pkg_sources($row["ID"]);
<input type="submit" class="button text-button" name="do_Flag" value="<?= __('Flag package out-of-date') ?>" /> <input type="submit" class="button text-button" name="do_Flag" value="<?= __('Flag package out-of-date') ?>" />
</form> </form>
</li> </li>
<?php elseif (($row["OutOfDateTS"] !== NULL) && has_credential(CRED_PKGBASE_UNFLAG, array($row["MaintainerUID"]))): ?> <?php elseif (($row["OutOfDateTS"] !== NULL) && has_credential(CRED_PKGBASE_UNFLAG, $maintainers)): ?>
<li> <li>
<form action="<?= get_pkgbase_uri($row['BaseName']) . 'unflag/'; ?>" method="post"> <form action="<?= get_pkgbase_uri($row['BaseName']) . 'unflag/'; ?>" method="post">
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" /> <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment