mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Update co-maintainers when disowning a package
When a user disowns a package, the co-maintainer with the highest priority automatically becomes the new maintainer. When the package is disowned by a Trusted User or a Developer, the list of co-maintainers is cleared. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
0dcdc23a7f
commit
422d8026da
1 changed files with 18 additions and 0 deletions
|
@ -638,6 +638,24 @@ function pkgbase_adopt ($base_ids, $action=true, $via) {
|
||||||
$q.= "WHERE ID IN (" . implode(",", $base_ids) . ") ";
|
$q.= "WHERE ID IN (" . implode(",", $base_ids) . ") ";
|
||||||
$dbh->exec($q);
|
$dbh->exec($q);
|
||||||
|
|
||||||
|
/* Update package co-maintainers when disowning a package. */
|
||||||
|
if (!$action) {
|
||||||
|
if (has_credential(CRED_PKGBASE_DISOWN)) {
|
||||||
|
foreach ($base_ids as $base_id) {
|
||||||
|
pkgbase_set_comaintainers($base_id, "");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
foreach ($base_ids as $base_id) {
|
||||||
|
$uids = pkgbase_get_comaintainers($base_id);
|
||||||
|
|
||||||
|
$q = "UPDATE PackageBases ";
|
||||||
|
$q.= "SET MaintainerUID = " . $uids[0] . " ";
|
||||||
|
$q.= "WHERE ID = " . $base_id;
|
||||||
|
$dbh->exec($q);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($action) {
|
if ($action) {
|
||||||
pkgbase_notify($base_ids);
|
pkgbase_notify($base_ids);
|
||||||
return array(true, __("The selected packages have been adopted."));
|
return array(true, __("The selected packages have been adopted."));
|
||||||
|
|
Loading…
Add table
Reference in a new issue