From 57a5cbfd88b2b91722ce0bf6911b416d051dde65 Mon Sep 17 00:00:00 2001 From: Dan Vratil Date: Sun, 21 Nov 2010 02:59:07 -0500 Subject: Auto redirect from confirmation screens. Finally move comment deletion and category editing into functions and remove pkgedit.php Signed-off-by: Loui Chang -Fix indentation -Fix variable naming conflict $id vs $cid --- web/html/pkgedit.php | 109 --------------------------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 web/html/pkgedit.php (limited to 'web/html/pkgedit.php') diff --git a/web/html/pkgedit.php b/web/html/pkgedit.php deleted file mode 100644 index 0339d00..0000000 --- a/web/html/pkgedit.php +++ /dev/null @@ -1,109 +0,0 @@ -\n"; - html_footer(AUR_VERSION); - exit(); -} - -# Must know what package to operate on throughout this entire script -# -if (!$_REQUEST["ID"]) { - print __("Missing package ID."); - print "
\n"; - html_footer(AUR_VERSION); - exit(); -} - - -# Delete a comment for this package -# -if ($_REQUEST["del_Comment"]) { - if ($_REQUEST["comment_id"]) { - $uid = uid_from_sid($_COOKIE["AURSID"]); - if (canDeleteComment($_REQUEST["comment_id"], $atype, $uid)) { - $dbh = db_connect(); - $q = "UPDATE PackageComments "; - $q.= "SET DelUsersID = ".$uid." "; - $q.= "WHERE ID = ".intval($_REQUEST["comment_id"]); - db_query($q, $dbh); - print __("Comment has been deleted.")."
\n"; - } else { - print __("You are not allowed to delete this comment.")."
\n"; - } - } else { - print __("Missing comment ID.")."
\n"; - } - html_footer(AUR_VERSION); - exit(); -} - -# Change package category -# -if ($_REQUEST["change_Category"]) { - $cat_array = pkgCategories(); - $dbh = db_connect(); - - if ($_REQUEST["category_id"]) { - # Try and set the requested category_id - # - if (array_key_exists($_REQUEST["category_id"], $cat_array)) { - $q = "UPDATE Packages SET CategoryID = ".intval($_REQUEST["category_id"]); - $q.= " WHERE ID = ".intval($_REQUEST["ID"]); - db_query($q, $dbh); - print __("Package category updated.")."
\n"; - - } else { - print __("Invalid category ID.")."
\n"; - } - } else { - # Prompt visitor for new category_id - # - $q = "SELECT CategoryID FROM Packages WHERE ID = ".intval($_REQUEST["ID"]); - $result = db_query($q, $dbh); - if ($result != NULL) { - $catid = mysql_fetch_row($result); - } - print "
\n"; - print "\n"; - print "\n"; - print __("Select new category").": \n"; - print "\n"; - print "
 
\n"; - print "\n"; - print "\n"; - print "
\n"; - - } - html_footer(AUR_VERSION); - exit(); -} - -print __("You've found a bug if you see this....")."
\n"; - -html_footer(AUR_VERSION); - -- cgit v1.3.1