diff options
author | Mark Weiman <mark.weiman@markzz.com> | 2018-02-06 03:54:56 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2018-02-24 14:57:31 +0100 |
commit | f15c700ad2ed2f5512a5574ab29f85c4848039e4 (patch) | |
tree | bc9232112070ce82dc18c4d5e5d7c0484187cad7 /web/html/pkgdisown.php | |
parent | 27654afadb5088dda4eafd83f07410c2a48fa4b0 (diff) | |
download | aur-f15c700ad2ed2f5512a5574ab29f85c4848039e4.tar.gz aur-f15c700ad2ed2f5512a5574ab29f85c4848039e4.tar.xz |
Add capability for co-maintainers to disown packages
Implements FS#53832.
Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/html/pkgdisown.php')
-rw-r--r-- | web/html/pkgdisown.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/web/html/pkgdisown.php b/web/html/pkgdisown.php index 4b04e85e..8da08cfe 100644 --- a/web/html/pkgdisown.php +++ b/web/html/pkgdisown.php @@ -7,10 +7,13 @@ include_once("pkgfuncs.inc.php"); html_header(__("Disown Package")); +$action = "do_Disown"; + $maintainer_uids = array(pkgbase_maintainer_uid($base_id)); $comaintainers = pkgbase_get_comaintainers($base_id); +$comaintainer_uids = pkgbase_get_comaintainer_uids(array($base_id)); -if (has_credential(CRED_PKGBASE_DISOWN, $maintainer_uids)): ?> +if (has_credential(CRED_PKGBASE_DISOWN, array_merge($maintainer_uids, $comaintainer_uids))): ?> <div class="box"> <h2><?= __('Disown Package') ?>: <?= htmlspecialchars($pkgbase_name) ?></h2> <p> @@ -23,7 +26,11 @@ if (has_credential(CRED_PKGBASE_DISOWN, $maintainer_uids)): ?> <?php endforeach; ?> </ul> <p> - <?php if (count($comaintainers) > 0 && !has_credential(CRED_PKGBASE_DISOWN)): ?> + + <?php if (in_array(uid_from_sid($_COOKIE["AURSID"]), $comaintainer_uids) && !has_credential(CRED_PKGBASE_DISOWN)): + $action = "do_DisownComaintainer"; ?> + <?= __("By selecting the checkbox, you confirm that you want to no longer be a package co-maintainer.") ?> + <?php elseif (count($comaintainers) > 0 && !has_credential(CRED_PKGBASE_DISOWN)): ?> <?= __('By selecting the checkbox, you confirm that you want to disown the package and transfer ownership to %s%s%s.', '<strong>', $comaintainers[0], '</strong>'); ?> <?php else: ?> @@ -40,7 +47,7 @@ if (has_credential(CRED_PKGBASE_DISOWN, $maintainer_uids)): ?> <?php endif; ?> <p><label class="confirmation"><input type="checkbox" name="confirm" value="1" /> <?= __("Confirm to disown the package") ?></label</p> - <p><input type="submit" class="button" name="do_Disown" value="<?= __("Disown") ?>" /></p> + <p><input type="submit" class="button" name="<?= $action ?>" value="<?= __("Disown") ?>" /></p> </fieldset> </form> </div> |