Update wiki links to the new short URL
[aur.git] / web / html / pkgflag.php
blob9cc6d7a2ccd2506c8c9169ab3b5f9ea1e83c89c9
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 /* Grab the list of package base IDs to be operated on. */
9 $ids = array();
10 if (isset($_POST['IDs'])) {
11 foreach ($_POST['IDs'] as $id => $i) {
12 $id = intval($id);
13 if ($id > 0) {
14 $ids[] = $id;
19 /* Perform package base actions. */
20 $ret = false;
21 $output = "";
22 if (check_token()) {
23 if (current_action("do_Flag")) {
24 list($ret, $output) = pkgbase_flag($ids, $_POST['comments']);
27 if ($ret) {
28 header('Location: ' . get_pkgbase_uri($pkgbase_name));
29 exit();
33 /* Get default comment. */
34 $comment = '';
35 if (isset($_POST['comments'])) {
36 $comment = $_POST['comments'];
39 html_header(__("Flag Package Out-Of-Date"));
41 if (has_credential(CRED_PKGBASE_FLAG)): ?>
42 <div class="box">
43 <h2><?= __('Flag Package Out-Of-Date') ?>: <?= htmlspecialchars($pkgbase_name) ?></h2>
44 <p>
45 <?= __('Use this form to flag the package base %s%s%s and the following packages out-of-date: ',
46 '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?>
47 </p>
48 <ul>
49 <?php foreach(pkgbase_get_pkgnames($base_id) as $pkgname): ?>
50 <li><?= htmlspecialchars($pkgname) ?></li>
51 <?php endforeach; ?>
52 </ul>
53 <?php if (pkgbase_is_vcs($base_id)): ?>
54 <p class="error">
55 This seems to be a VCS package. Please do <strong>not</strong>
56 flag it out-of-date if the package version in the AUR does not
57 match the most recent commit. Flagging this package should only
58 be done if the sources moved or changes in the PKGBUILD are
59 required because of recent upstream changes.
60 </p>
61 <?php endif; ?>
62 <p>
63 <?= __('Please do %snot%s use this form to report bugs. Use the package comments instead.',
64 '<strong>', '</strong>'); ?>
65 <?= __('Enter details on why the package is out-of-date below, preferably including links to the release announcement or the new release tarball.'); ?>
66 </p>
68 <?php if ($output && !$ret): ?>
69 <ul class="errorlist"><li><?= htmlspecialchars($output) ?></li></ul>
70 <?php endif; ?>
72 <form action="<?= get_pkgbase_uri($pkgbase_name); ?>flag/" method="post">
73 <fieldset>
74 <input type="hidden" name="IDs[<?= $base_id ?>]" value="1" />
75 <input type="hidden" name="ID" value="<?= $base_id ?>" />
76 <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
77 <p>
78 <label for="id_comments"><?= __("Comments") ?>:</label>
79 <textarea name="comments" id="id_comments" rows="5" cols="50"><?= htmlspecialchars($comment) ?></textarea>
80 </p>
81 <p><input type="submit" class="button" name="do_Flag" value="<?= __("Flag") ?>" /></p>
82 </fieldset>
83 </form>
84 </div>
86 <?php
87 else:
88 print __("Only registered users can flag packages out-of-date.");
89 endif;
91 html_footer(AURWEB_VERSION);