From ca954fe95ad9537ad626e16dfec9512f9403e3ca Mon Sep 17 00:00:00 2001
From: Lukas Fleischer
Date: Wed, 21 Oct 2015 22:32:37 +0200
Subject: Do not redirect when showing errors during flagging
Fixes FS#46545.
Signed-off-by: Lukas Fleischer
---
web/html/pkgflag.php | 40 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/web/html/pkgflag.php b/web/html/pkgflag.php
index b1ca03b2..e6e7c647 100644
--- a/web/html/pkgflag.php
+++ b/web/html/pkgflag.php
@@ -8,6 +8,37 @@ include_once("pkgfuncs.inc.php");
set_lang();
check_sid();
+/* Grab the list of package base IDs to be operated on. */
+$ids = array();
+if (isset($_POST['IDs'])) {
+ foreach ($_POST['IDs'] as $id => $i) {
+ $id = intval($id);
+ if ($id > 0) {
+ $ids[] = $id;
+ }
+ }
+}
+
+/* Perform package base actions. */
+$ret = false;
+$output = "";
+if (check_token()) {
+ if (current_action("do_Flag")) {
+ list($ret, $output) = pkgbase_flag($ids, $_POST['comments']);
+ }
+
+ if ($ret) {
+ header('Location: ' . get_pkgbase_uri($pkgbase_name) . $fragment);
+ exit();
+ }
+}
+
+/* Get default comment. */
+$comment = '';
+if (isset($_POST['comments'])) {
+ $comment = $_POST['comments'];
+}
+
html_header(__("Flag Package Out-Of-Date"));
if (has_credential(CRED_PKGBASE_FLAG)): ?>
@@ -27,14 +58,19 @@ if (has_credential(CRED_PKGBASE_FLAG)): ?>
'', ''); ?>
= __('Enter details on why the package is out-of-date below, preferably including links to the release announcement or the new release tarball.'); ?>
-