summaryrefslogtreecommitdiffstats
path: root/web/html
diff options
context:
space:
mode:
authoreric <eric>2004-06-28 19:37:02 +0000
committereric <eric>2004-06-28 19:37:02 +0000
commit4b80bc34ffb738ef3cd1a7944e8716d3e8140565 (patch)
treed371144998ca570b0808be07ff10c3a697a37bac /web/html
parentefcca46f26247ee69b33cb1effb0d34077817a80 (diff)
downloadaurweb-4b80bc34ffb738ef3cd1a7944e8716d3e8140565.tar.xz
re-working pkgsearch, NumVotes add to Packages table
Diffstat (limited to 'web/html')
-rw-r--r--web/html/index.php7
-rw-r--r--web/html/pkgmgmnt.php8
-rw-r--r--web/html/pkgsearch.php116
3 files changed, 104 insertions, 27 deletions
diff --git a/web/html/index.php b/web/html/index.php
index 67ff657..64a1c2f 100644
--- a/web/html/index.php
+++ b/web/html/index.php
@@ -25,11 +25,14 @@ if (isset($_REQUEST["user"]) || isset($_REQUEST["pass"])) {
$q.= "AND Passwd = '" . mysql_escape_string($_REQUEST["pass"]) . "'";
$result = db_query($q, $dbh);
if (!$result) {
- $login_error = __("Incorrect password for username, %s.",
+ $login_error = __("Error looking up username, %s.",
array($_REQUEST["user"]));
} else {
$row = mysql_fetch_row($result);
- if ($row[1]) {
+ if (empty($row)) {
+ $login_error = __("Incorrect password for username, %s.",
+ array($_REQUEST["user"]));
+ } elseif ($row[1]) {
$login_error = __("Your account has been suspended.");
}
}
diff --git a/web/html/pkgmgmnt.php b/web/html/pkgmgmnt.php
index 5544016..98c8400 100644
--- a/web/html/pkgmgmnt.php
+++ b/web/html/pkgmgmnt.php
@@ -6,10 +6,12 @@ check_sid(); # see if they're still logged in
html_header(); # print out the HTML header
-# Any text you print out to the visitor, use the __() function
-# for i18n support. See 'testpo.php' for more details.
+# vistor has requested package management for a specific package
+#
+print __("Manage package ID: %s", array($_REQUEST["ID"])) . "<br />\n";
+
+# NOTE: managing an orphaned package will automatically force adoption
#
-print __("Under construction...")."<br />\n";
html_footer("\$Id$");
diff --git a/web/html/pkgsearch.php b/web/html/pkgsearch.php
index 9d4521c..64d229b 100644
--- a/web/html/pkgsearch.php
+++ b/web/html/pkgsearch.php
@@ -6,14 +6,6 @@ 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
-# TODO Maybe pkgsearch, pkgvote can be consolidated? This script can
-# provide a search form. In the results, it can contain a checkbox
-# for 'flag out of date', 'vote', 'details' link, and a link to 'pkgmgmnt'.
-#
-# the results page should have columns for,
-# pkg name/ver, location, maintainer, description, O-O-D, Vote, details, mgmnt
-#
-
# get login privileges
#
@@ -25,30 +17,110 @@ if (isset($_COOKIE["AURSID"])) {
$atype = "";
}
+# grab the list of Package IDs to be operated on
+#
+isset($_REQUEST["IDs"]) ? $ids = $_REQUEST["IDs"] : $ids = array();
+
+
+# determine what button the visitor clicked
+#
+if (isset($_REQUEST["do_Flag"])) {
+ if (!$atype) {
+ print __("You must be logged in before you can flag packages.");
+ print "<br />\n";
+
+ } else {
+ # Flag the packages in $ids array, and unflag any other
+ # packages listed in $_REQUEST["All_IDs"]
+ #
+ print "flagging<br />\n";
+
+ # After flagging, show the search page again (or maybe print out
+ # a message and give the user a link to resume where they were
+ # in the search
+ #
+ pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
+ $_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
+ $_REQUEST["PP"]);
+ }
+
+
+} elseif (isset($_REQUEST["do_Disown"])) {
+ if ($atype != "User" && $atype != "") {
+ print __("You do not have access to disown packages.");
+ print "<br />\n";
+
+ } else {
+ # Disown the packages in $ids array
+ #
+ print "disowning<br />\n";
+
+ # After disowning, show the search page again (or maybe print out
+ # a message and give the user a link to resume where they were
+ # in the search
+ #
+ pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
+ $_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
+ $_REQUEST["PP"]);
+ }
-if ($atype && $_REQUEST["Action"] == "Something") {
- # do something based on what the user specifies
- #
-} elseif ($atype && $_REQUEST["Action"] == "SomethingElse") {
- # do something else based on what the user specifies
+} elseif (isset($_REQUEST["do_Adopt"])) {
+ if ($atype != "User" && $atype != "") {
+ print __("You do not have access to adopt packages.");
+ print "<br />\n";
+
+ } else {
+ # Adopt the packages in $ids array
+ #
+ print "adopting<br />\n";
+
+ # After adopting, show the search page again (or maybe print out
+ # a message and give the user a link to resume where they were
+ # in the search
+ #
+ pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
+ $_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
+ $_REQUEST["PP"]);
+ }
+
+
+} elseif (isset($_REQUEST["do_Vote"])) {
+ if (!$atype) {
+ print __("You must be logged in before you can vote for packages.");
+ print "<br />\n";
+
+ } else {
+ # vote on the packages in $ids array. 'unvote' for any packages
+ # listed in the $_REQUEST["All_IDs"] array.
+ #
+ print "adopting<br />\n";
+
+ # After voting, show the search page again (or maybe print out
+ # a message and give the user a link to resume where they were
+ # in the search
+ #
+ pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
+ $_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
+ $_REQUEST["PP"]);
+ }
+
+
+} elseif (isset($_REQUEST["do_Details"])) {
+ # give a link to 'manage', and another to return to search
+ # results.
#
+ print "details for package<br />\n";
+
-} elseif ($_REQUEST["Action"] == "SearchPkgs") {
- # the visitor has requested search options and/or hit the less/more button
+} else {
+ # do_More/do_Less/do_Search/do_MyPackages - just do a search
#
pkg_search_page($_COOKIE["AURSID"], $_REQUEST["L"], $_REQUEST["C"],
$_REQUEST["K"], $_REQUEST["SB"], $_REQUEST["M"], $_REQUEST["O"],
$_REQUEST["PP"]);
-} else {
- # do the default thing - give the user a search form that they
- # can specify: location, category, maintainer, name, 'my pkgs'
- # and display a list of packages based on no search options.
- #
- pkg_search_page($_COOKIE["AURSID"]);
}
-
html_footer("\$Id$");
?>