Hi, this patch is adding meta refresh tag and a link back to the package page from the screens that confirm comment deletion and change of package category.
The link is displayed always, but the autoredirection is done only when the action was sucessfull. This allows user to read or note down a possible error output in case of failure. The delay for refresh is set to 5 seconds, but that can be discussed. Dan -- --------------------------------- Dan Vrátil [email protected] ICQ 249163429 Jabber [email protected] Tel. +420 732 326 870 Tento email neobsahuje žádné viry, protože odesílatel nepoužívá Windows. / This email does not contain any viruses because the sender does not use Windows.
diff --git a/web/html/pkgedit.php b/web/html/pkgedit.php
index 0339d00..388c83e 100644
--- a/web/html/pkgedit.php
+++ b/web/html/pkgedit.php
@@ -44,12 +44,15 @@ if ($_REQUEST["del_Comment"]) {
$q.= "WHERE ID = ".intval($_REQUEST["comment_id"]);
db_query($q, $dbh);
print __("Comment has been deleted.")."<br />\n";
+ print __("You will be redirected to the package page within 5 seconds...")."<br />\n";
+ print "<meta http-equiv='refresh' content='5;url=packages.php?ID=".$_REQUEST["ID"]."' />\n";
} else {
print __("You are not allowed to delete this comment.")."<br />\n";
}
} else {
print __("Missing comment ID.")."<br />\n";
}
+ print "<a href='packages.php?ID=".$_REQUEST["ID"]."'>".__("Back to package")."</a>\n";
html_footer(AUR_VERSION);
exit();
}
@@ -68,10 +71,13 @@ if ($_REQUEST["change_Category"]) {
$q.= " WHERE ID = ".intval($_REQUEST["ID"]);
db_query($q, $dbh);
print __("Package category updated.")."<br />\n";
+ print __("You will be redirected to the package page within 5 seconds...")."<br />\n";
+ print "<meta http-equiv='refresh' content='5;url=packages.php?ID=".$_REQUEST["ID"]."' />\n";
} else {
print __("Invalid category ID.")."<br />\n";
}
+ print "<a href='packages.php?ID=".$_REQUEST["ID"]."'>".__("Back to package")."</a>\n";
} else {
# Prompt visitor for new category_id
#
signature.asc
Description: This is a digitally signed message part.
