diff options
author | Dan Vratil <vratil@progdansoft.com> | 2010-11-21 02:59:07 -0500 |
---|---|---|
committer | Loui Chang <louipc.ist@gmail.com> | 2010-11-21 03:37:17 -0500 |
commit | 57a5cbfd88b2b91722ce0bf6911b416d051dde65 (patch) | |
tree | c7a8175ec8c90ef6610aabce02af4d291ea74d14 /web/html | |
parent | 01fc2024cb48a68710065ceaae070f35aa69825d (diff) | |
download | aurweb-57a5cbfd88b2b91722ce0bf6911b416d051dde65.tar.xz |
Auto redirect from confirmation screens.
Finally move comment deletion and category editing into functions and
remove pkgedit.php
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
-Fix indentation
-Fix variable naming conflict $id vs $cid
Diffstat (limited to 'web/html')
-rw-r--r-- | web/html/css/containers.css | 4 | ||||
-rw-r--r-- | web/html/packages.php | 4 | ||||
-rw-r--r-- | web/html/pkgedit.php | 109 |
3 files changed, 8 insertions, 109 deletions
diff --git a/web/html/css/containers.css b/web/html/css/containers.css index fc092de..12362f6 100644 --- a/web/html/css/containers.css +++ b/web/html/css/containers.css @@ -187,4 +187,8 @@ input.button { font-size: 12px; padding: 2px 8px; } +input[type=image] { + border: 0; + background: none; +} diff --git a/web/html/packages.php b/web/html/packages.php index 472f6a2..741ffb1 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -57,6 +57,10 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { $output = pkg_notify($atype, $ids); } elseif ($_POST['action'] == "do_UnNotify" || isset($_POST['do_UnNotify'])) { $output = pkg_notify($atype, $ids, False); +} elseif ($_POST['action'] == "do_DeleteComment" || isset($_POST["do_DeleteComment"])) { + $output = pkg_delete_comment($atype); +} elseif ($_POST['action'] == "do_ChangeCategory" || isset($_POST['do_ChangeCategory'])) { + $output = pkg_change_category($atype); } html_header($title); 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 @@ -<?php - -set_include_path(get_include_path() . PATH_SEPARATOR . '../lib'); - -include_once("aur.inc"); # access AUR common functions -include_once("pkgfuncs.inc"); # use some form of this for i18n support -set_lang(); # this sets up the visitor's language -check_sid(); # see if they're still logged in -html_header(); # print out the HTML header - -# Make sure this visitor is logged in -# -if (isset($_COOKIE["AURSID"])) { - $atype = account_from_sid($_COOKIE["AURSID"]); -} else { - $atype = ""; -} -if (!$atype) { - print __("You must be logged in before you can edit package information."); - print "<br />\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 "<br />\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.")."<br />\n"; - } else { - print __("You are not allowed to delete this comment.")."<br />\n"; - } - } else { - print __("Missing comment ID.")."<br />\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.")."<br />\n"; - - } else { - print __("Invalid category ID.")."<br />\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 "<form action='pkgedit.php' method='post'>\n"; - print "<input type='hidden' name='change_Category' value='1'>\n"; - print "<input type='hidden' name='ID' value=\"".$_REQUEST["ID"]."\">\n"; - print __("Select new category").": \n"; - print "<select name='category_id'>\n"; - while (list($id,$cat) = each($cat_array)) { - print "<option value='".$id."'"; - if ($id == $catid[0]) { - print " selected"; - } - print "> ".$cat."</option>\n"; - } - print "</select>\n"; - print "<br /> <br />\n"; - print "<input type='submit' value=\"".__("Submit")."\">\n"; - print "<input type='reset' value=\"".__("Reset")."\">\n"; - print "</form>\n"; - - } - html_footer(AUR_VERSION); - exit(); -} - -print __("You've found a bug if you see this....")."<br />\n"; - -html_footer(AUR_VERSION); - |