Fix several PHP short open tags
[aur.git] / web / html / pkgflag.php
blob44849d889527603dfe6fe31c01fe1965f9372913
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 /* Grab the list of package base IDs to be operated on. */
12 $ids = array();
13 if (isset($_POST['IDs'])) {
14 foreach ($_POST['IDs'] as $id => $i) {
15 $id = intval($id);
16 if ($id > 0) {
17 $ids[] = $id;
22 /* Perform package base actions. */
23 $ret = false;
24 $output = "";
25 if (check_token()) {
26 if (current_action("do_Flag")) {
27 list($ret, $output) = pkgbase_flag($ids, $_POST['comments']);
30 if ($ret) {
31 header('Location: ' . get_pkgbase_uri($pkgbase_name) . $fragment);
32 exit();
36 /* Get default comment. */
37 $comment = '';
38 if (isset($_POST['comments'])) {
39 $comment = $_POST['comments'];
42 html_header(__("Flag Package Out-Of-Date"));
44 if (has_credential(CRED_PKGBASE_FLAG)): ?>
45 <div class="box">
46 <h2><?= __('Flag Package Out-Of-Date') ?>: <?= htmlspecialchars($pkgbase_name) ?></h2>
47 <p>
48 <?= __('Use this form to flag the package base %s%s%s and the following packages out-of-date: ',
49 '<strong>', htmlspecialchars($pkgbase_name), '</strong>'); ?>
50 </p>
51 <ul>
52 <?php foreach(pkgbase_get_pkgnames($base_id) as $pkgname): ?>
53 <li><?= htmlspecialchars($pkgname) ?></li>
54 <?php endforeach; ?>
55 </ul>
56 <p>
57 <?= __('Please do %snot%s use this form to report bugs. Use the package comments instead.',
58 '<strong>', '</strong>'); ?>
59 <?= __('Enter details on why the package is out-of-date below, preferably including links to the release announcement or the new release tarball.'); ?>
60 </p>
62 <?php if ($output && !$ret): ?>
63 <ul class="errorlist"><li><?= htmlspecialchars($output) ?></li></ul>
64 <?php endif; ?>
66 <form action="<?= get_pkgbase_uri($pkgbase_name); ?>flag/" method="post">
67 <fieldset>
68 <input type="hidden" name="IDs[<?= $base_id ?>]" value="1" />
69 <input type="hidden" name="ID" value="<?= $base_id ?>" />
70 <input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
71 <p>
72 <label for="id_comments"><?= __("Comments") ?>:</label>
73 <textarea name="comments" id="id_comments" rows="5" cols="50"><?= htmlspecialchars($comment) ?></textarea>
74 </p>
75 <p><input type="submit" class="button" name="do_Flag" value="<?= __("Flag") ?>" /></p>
76 </fieldset>
77 </form>
78 </div>
80 <?php
81 else:
82 print __("Only registered users can flag packages out-of-date.");
83 endif;
85 html_footer(AURWEB_VERSION);