Move package disowning to a separate page
[aur.git] / web / html / pkgdisown.php
blobcf7bb41e1168b86d887350e6b9f61827bf726fcf
1 <?php
3 set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
5 include_once("aur.inc.php");
6 include_once("pkgfuncs.inc.php");
8 set_lang();
9 check_sid();
11 html_header(__("Disown Package"));
13 $maintainer_uids = array(pkgbase_maintainer_uid($base_id));
14 $comaintainer_uids = pkgbase_get_comaintainers($base_id);
16 if (has_credential(CRED_PKGBASE_DISOWN, $maintainer_uids)): ?>
17 <div class="box">
18 <h2><?= __('Disown Package: %s', htmlspecialchars($pkgbase_name)) ?></h2>
19 <p>
20 <?= __('Use this form to disown the package base %s%s%s which includes the following packages: ',
21 '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?>
22 </p>
23 <ul>
24 <?php foreach(pkgbase_get_pkgnames($base_id) as $pkgname): ?>
25 <li><?= htmlspecialchars($pkgname) ?></li>
26 <?php endforeach; ?>
27 </ul>
28 <p>
29 <?php if (count($comaintainer_uids) > 0 && !has_credential(CRED_PKGBASE_DISOWN)): ?>
30 <?= __('By selecting the checkbox, you confirm that you want to disown the package and transfer ownership to %s%s%s.',
31 '<strong>', $comaintainer_uids[0], '</strong>'); ?>
32 <?php else: ?>
33 <?= __('By selecting the checkbox, you confirm that you want to disown the package.') ?>
34 <?php endif; ?>
35 </p>
36 <form action="<?= get_uri('/pkgbase/'); ?>" method="post">
37 <fieldset>
38 <input type="hidden" name="IDs[<?= $base_id ?>]" value="1" />
39 <input type="hidden" name="ID" value="<?= $base_id ?>" />
40 <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
41 <?php if (isset($_GET['via'])): ?>
42 <input type="hidden" name="via" value="<?= intval($_GET['via']) ?>" />
43 <?php endif; ?>
44 <p><input type="checkbox" name="confirm_Disown" value="1" />
45 <?= __("Confirm to disown the package") ?></p>
46 <p><input type="submit" class="button" name="do_Disown" value="<?= __("Disown") ?>" /></p>
47 </fieldset>
48 </form>
49 </div>
51 <?php else:
52 print __("Only Trusted Users and Developers can disown packages.");
53 endif;
55 html_footer(AURWEB_VERSION);