From a9837329d697a9e18401309a1496cc3b5015bc6a Mon Sep 17 00:00:00 2001 From: eliott Date: Sat, 17 Nov 2007 00:01:58 -0800 Subject: Hand diff of simo's patch to remove flag safe functionality. Simo's original commit text: The idea of safe flagging is unclear, poorly named, misunderstood, and not even used. At the time this patch was created, less than a third of the packages in unsupported were flagged safe, and less than a tenth of users knew how to interpret it. The safe flag has been replaced by a disclaimer on the main page. --- web/html/index.php | 37 +------------------------------------ web/html/packages.php | 49 ------------------------------------------------- web/html/pkgsubmit.php | 8 -------- 3 files changed, 1 insertion(+), 93 deletions(-) (limited to 'web/html') diff --git a/web/html/index.php b/web/html/index.php index b379d4d..854c32c 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -210,11 +210,6 @@ $result = db_query($q, $dbh); $row = mysql_fetch_row($result); $update_count = $row[0]; -$q = "SELECT count(*) FROM Packages,PackageLocations WHERE Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'unsupported' AND Packages.Safe = 1"; -$result = db_query($q, $dbh); -$row = mysql_fetch_row($result); -$safe_count = $row[0]; - # Added the user statistcs. # Added by: dsa $user = username_from_sid($_COOKIE["AURSID"]); @@ -270,30 +265,6 @@ if (!empty($user)) { print ""; print "$flagged_outdated"; print ""; - - # Number of safe packages - print ""; - print ""; - if ($atype == 'Trusted User' || $atype == 'Developer') { - $q = "SELECT count(*) FROM Packages,Users WHERE Packages.Safe = 1 AND Packages.VerifiedBy = Users.ID AND Users.Username='".mysql_real_escape_string($user)."'"; - $result = db_query($q, $dbh); - $row = mysql_fetch_row($result); - $flagged_safe = $row[0]; - - print "".__("Flagged as safe by me").""; - } - else - { - $q = "SELECT count(*) FROM Packages,Users WHERE Packages.Safe = 1 AND Packages.MaintainerUID = Users.ID AND Users.Username='".mysql_real_escape_string($user)."'"; - $result = db_query($q, $dbh); - $row = mysql_fetch_row($result); - $flagged_safe = $row[0]; - - print "".__("Flagged as safe").""; - } - print ""; - print "$flagged_safe"; - print ""; print "
"; } @@ -313,13 +284,6 @@ print ""; print "$unsupported_count"; print ""; -print ""; -print ""; -print "".__("Packages in unsupported and flagged as safe").""; -print ""; -print "$safe_count"; -print ""; - print ""; print ""; print "".__("Packages in [community]").""; @@ -356,6 +320,7 @@ print "\n"; print "\n"; echo "\n"; # End Table 1 +echo "".__("DISCLAIMER: Unsupported PKGBUILDs are user produced content, by downloading them you agree to do so at your own risk.").""; echo " "; echo ""; html_footer(AUR_VERSION); diff --git a/web/html/packages.php b/web/html/packages.php index 2ae3bf0..95b5979 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -491,55 +491,6 @@ if (isset($_REQUEST["do_Flag"])) { # FIXME: If someone hits the detail page's vote button, this link dies 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 == "Trusted 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 == "Trusted 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 diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 6e754bf..9bed3f5 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -412,11 +412,6 @@ if ($_COOKIE["AURSID"]) { $q.="Description='".mysql_real_escape_string($new_pkgbuild['pkgdesc'])."', "; $q.="URL='".mysql_real_escape_string($new_pkgbuild['url'])."', "; $q.="LocationID=2, "; - if (account_from_sid($_COOKIE["AURSID"]) == "Trusted User" || account_from_sid($_COOKIE["AURSID"]) == "Developer") { - $q.="Safe=1, VerifiedBy=".uid_from_sid($_COOKIE["AURSID"]).", "; - } else { - $q.="Safe=0, "; - } $fspath=INCOMING_DIR.$pkg_name."/".$_FILES["pfile"]["name"]; $q.="FSPath='".mysql_real_escape_string($fspath)."', "; $urlpath=URL_DIR.$pkg_name."/".$_FILES["pfile"]["name"]; @@ -481,9 +476,6 @@ if ($_COOKIE["AURSID"]) { # $q = "INSERT INTO Packages "; $q.= " (Name, License, Version, CategoryID, Description, URL, LocationID, "; - if (account_from_sid($_COOKIE["AURSID"]) == "Trusted User" || account_from_sid($_COOKIE["AURSID"]) == "Developer") { - $q.= "Safe, VerifiedBy,"; - } $q.= " SubmittedTS, SubmitterUID, MaintainerUID, FSPath, URLPath) "; $q.= "VALUES ('"; $q.= mysql_real_escape_string($new_pkgbuild['pkgname'])."', '"; -- cgit v1.2.3-70-g09d2