mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Move package comment check to packages.php
Checking whether to add a comment is something that really does not belong to a function named display_package_details(). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
bf019a5b6c
commit
c1c7f9b350
2 changed files with 6 additions and 4 deletions
|
@ -99,6 +99,12 @@ if (check_token()) {
|
||||||
list($ret, $output) = pkg_change_category($pkgid, $atype);
|
list($ret, $output) = pkg_change_category($pkgid, $atype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_REQUEST['comment'])) {
|
||||||
|
$uid = uid_from_sid($_COOKIE["AURSID"]);
|
||||||
|
add_package_comment($pkgid, $uid, $_REQUEST['comment']);
|
||||||
|
$ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
/* Redirect back to package page on success. */
|
/* Redirect back to package page on success. */
|
||||||
header('Location: ' . get_pkg_uri($pkgname));
|
header('Location: ' . get_pkg_uri($pkgname));
|
||||||
|
|
|
@ -449,10 +449,6 @@ function display_package_details($id=0, $row, $SID="") {
|
||||||
# Actions Bar
|
# Actions Bar
|
||||||
if ($SID) {
|
if ($SID) {
|
||||||
include('actions_form.php');
|
include('actions_form.php');
|
||||||
if (isset($_REQUEST['comment']) && check_token()) {
|
|
||||||
$uid = uid_from_sid($SID);
|
|
||||||
add_package_comment($id, $uid, $_REQUEST['comment']);
|
|
||||||
}
|
|
||||||
include('pkg_comment_form.php');
|
include('pkg_comment_form.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue