Commit 3b1dad22 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Fix category selection



Add a package ID parameter to pkg_change_category() instead of relying
on the "ID" or "N" GET parameters.

Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent c959d95f
...@@ -89,7 +89,7 @@ if (check_token()) { ...@@ -89,7 +89,7 @@ if (check_token()) {
} elseif (current_action("do_DeleteComment")) { } elseif (current_action("do_DeleteComment")) {
$output = pkg_delete_comment($atype); $output = pkg_delete_comment($atype);
} elseif (current_action("do_ChangeCategory")) { } elseif (current_action("do_ChangeCategory")) {
$output = pkg_change_category($atype); $output = pkg_change_category($pkgid, $atype);
} }
} }
......
...@@ -1206,7 +1206,7 @@ function pkg_delete_comment($atype, $dbh=NULL) { ...@@ -1206,7 +1206,7 @@ function pkg_delete_comment($atype, $dbh=NULL) {
* @param string $atype Account type, output of account_from_sid * @param string $atype Account type, output of account_from_sid
* @return string Translated error or success message * @return string Translated error or success message
*/ */
function pkg_change_category($atype, $dbh=NULL) { function pkg_change_category($pid, $atype, $dbh=NULL) {
if (!$atype) { if (!$atype) {
return __("You must be logged in before you can edit package information."); return __("You must be logged in before you can edit package information.");
} }
...@@ -1226,14 +1226,6 @@ function pkg_change_category($atype, $dbh=NULL) { ...@@ -1226,14 +1226,6 @@ function pkg_change_category($atype, $dbh=NULL) {
return __("Invalid category ID."); return __("Invalid category ID.");
} }
if (isset($_GET["ID"])) {
$pid = $_GET["ID"];
} elseif (isset($_GET["N"])) {
$pid = pkgid_from_name($_GET["N"]);
} else {
return __("Missing package ID.");
}
# Verify package ownership # Verify package ownership
$q = "SELECT Packages.MaintainerUID "; $q = "SELECT Packages.MaintainerUID ";
$q.= "FROM Packages "; $q.= "FROM Packages ";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment