From a8999a691777a96ea07f53a479a154b743712a46 Mon Sep 17 00:00:00 2001 From: pjmattal Date: Fri, 29 Jul 2005 12:29:23 +0000 Subject: added swiergot's checking patch as well as modifying it to also list package name in green on the package list page (with legend) --- web/html/packages.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'web/html/packages.php') diff --git a/web/html/packages.php b/web/html/packages.php index 4191440..d544e62 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -462,6 +462,54 @@ if (isset($_REQUEST["do_Flag"])) { pkgsearch_results_link(); +} elseif (isset($_REQUEST["do_FlagSafe"])) { + if (!$atype) { + print __("You must be logged in before you can flag packages."); + print "
\n"; + } else { + if (!empty($ids) || $atype == "User") { + $dbh = db_connect(); + # There currently shouldn't be multiple requests here, but the format in which + # it's sent requires this + while (list($pid, $v) = each($ids)) { + $q = "UPDATE Packages SET Safe = 1, VerifiedBy = ".uid_from_sid($_COOKIE["AURSID"])." WHERE ID = ".$pid; + db_query($q, $dbh); + print '

'; + print __("The selected packages have been flagged safe."); + print '

'; + pkgdetails_link($pid); + } + } else { + print '

'; + print __("Couldn't flag package safe."); + print '

'; + } + } + +} elseif (isset($_REQUEST["do_UnFlagSafe"])) { + if (!$atype) { + print __("You must be logged in before you can unflag packages."); + print "
\n"; + } else { + if (!empty($ids) || $atype == "User") { + $dbh = db_connect(); + # There currently shouldn't be multiple requests here, but the format in which + # it's sent requires this + while (list($pid, $v) = each($ids)) { + $q = "UPDATE Packages SET Safe = 0 WHERE ID = ".$pid; + db_query($q, $dbh); + print '

'; + print __("The selected packages have been unflagged safe."); + print '

'; + pkgdetails_link($pid); + } + } else { + print '

'; + print __("Couldn't unflag package safe."); + print '

'; + } + } + } elseif (isset($_REQUEST["do_Notify"])) { # I realize that the implementation here seems a bit convoluted, but we want to # ensure that everything happens as it should, even if someone called this page -- cgit v1.2.3-70-g09d2