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>
This commit is contained in:
Callan Barrett 2008-01-03 05:53:50 +09:00 committed by Dan McGee
parent 5f4afcc8cb
commit 9a83e56b69
2 changed files with 7 additions and 2 deletions

View file

@ -171,7 +171,10 @@ if (isset($_REQUEST["do_Flag"])) {
$q = "UPDATE Packages "; $q = "UPDATE Packages ";
$q.= "SET ".$field." = 0 "; $q.= "SET ".$field." = 0 ";
$q.= "WHERE ID IN (" . $disown . ") "; $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); db_query($q, $dbh);
} }

View file

@ -492,7 +492,9 @@ function package_details($id=0, $SID="") {
echo " value='".__("Adopt Packages")."'>\n"; 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 "<input type='submit' class='button' name='do_Disown'";
echo " value='".__("Disown Packages")."'>\n"; echo " value='".__("Disown Packages")."'>\n";
} }