summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCallan Barrett <wizzomafizzo@gmail.com>2008-01-02 21:53:50 +0100
committerDan McGee <dan@archlinux.org>2008-01-20 07:21:19 +0100
commit9a83e56b69bff3ef1921d3f8dab0b2daabb4d4c3 (patch)
treefd04b21f29daf8a0e0071b78a9bbd863e9b65552
parent5f4afcc8cb6dcc5dcbe4d5161fad5372eb5f6435 (diff)
downloadaur-9a83e56b69bff3ef1921d3f8dab0b2daabb4d4c3.tar.gz
aur-9a83e56b69bff3ef1921d3f8dab0b2daabb4d4c3.tar.xz
Adds support for TUs and devs to disown packages they do not own
This is to add support for either devs or TUs to disown packages whether they own them or not. I know of countless times where I or another TU have been asked to orphan packages for someone and end up having to adopt the package first and then disown it, this gets really tedious for more than one package. As far as I can tell there's no other way to disown packages you don't own and if there is at least this is a more obvious way, pretty sure I didn't leave anything out in the patch. Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
-rw-r--r--web/html/packages.php5
-rw-r--r--web/lib/pkgfuncs.inc4
2 files changed, 7 insertions, 2 deletions
diff --git a/web/html/packages.php b/web/html/packages.php
index 95b59798..85ab6b75 100644
--- a/web/html/packages.php
+++ b/web/html/packages.php
@@ -171,7 +171,10 @@ if (isset($_REQUEST["do_Flag"])) {
$q = "UPDATE Packages ";
$q.= "SET ".$field." = 0 ";
$q.= "WHERE ID IN (" . $disown . ") ";
- $q.= "AND ".$field." = ".uid_from_sid($_COOKIE["AURSID"]);
+ # If a user is a TU or dev they can disown any package
+ if ($atype == "User") {
+ $q.= "AND ".$field." = ".uid_from_sid($_COOKIE["AURSID"]);
+ }
db_query($q, $dbh);
}
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index ad9630e9..eaeeca8b 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -492,7 +492,9 @@ function package_details($id=0, $SID="") {
echo " value='".__("Adopt Packages")."'>\n";
}
- if ($row["MaintainerUID"] == uid_from_sid($SID)) {
+ if ($row["MaintainerUID"] == uid_from_sid($SID) ||
+ account_from_sid($SID) == "Trusted User" ||
+ account_from_sid($SID) == "Developer") {
echo "<input type='submit' class='button' name='do_Disown'";
echo " value='".__("Disown Packages")."'>\n";
}