diff options
author | Callan Barrett <wizzomafizzo@gmail.com> | 2008-05-29 11:23:40 +0200 |
---|---|---|
committer | Callan Barrett <wizzomafizzo@gmail.com> | 2008-06-05 20:10:59 +0200 |
commit | 94a805321016db8646834d5fb26198ce738d459f (patch) | |
tree | 0f1e062d52883e6e16984c74db509ea3de4643a6 | |
parent | a49ee80aa2e03843748e89185fd811d83cd34db9 (diff) | |
download | aur-94a805321016db8646834d5fb26198ce738d459f.tar.gz aur-94a805321016db8646834d5fb26198ce738d459f.tar.xz |
Disable user package deletion
Users can no longer delete packages if they own them, only TUs and devs
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
-rw-r--r-- | web/html/packages.php | 3 | ||||
-rw-r--r-- | web/lib/pkgfuncs.inc | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/web/html/packages.php b/web/html/packages.php index 0394c6e1..80ddf209 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -218,9 +218,6 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) { # if ($atype == "Trusted User" || $atype == "Developer") { $result = db_query($q, $dbh); - } else { - $q.= "AND $field IN (0, " . uid_from_sid($_COOKIE["AURSID"]) . ")"; - $result = db_query($q, $dbh); } if ($result != Null && mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 5031aa4d..c6e7b8e8 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -512,8 +512,7 @@ function package_details($id=0, $SID="") { echo " value='".__("Disown Packages")."'>\n"; } - if ($row["MaintainerUID"] == uid_from_sid($SID) || - account_from_sid($SID) == "Trusted User" || + if (account_from_sid($SID) == "Trusted User" || account_from_sid($SID) == "Developer") { echo "<input type='submit' class='button' name='do_Delete'"; echo " value='".__("Delete Packages")."'>\n"; @@ -905,7 +904,9 @@ function pkg_search_page($SID="") { print "<option value='do_UnFlag'>".__("Unflag Out-of-date")."</option>\n"; print "<option value='do_Adopt'>".__("Adopt Packages")."</option>\n"; print "<option value='do_Disown'>".__("Disown Packages")."</option>\n"; - print "<option value='do_Delete'>".__("Delete Packages")."</option>\n"; + if (account_from_sid($SID) == "Trusted User" || account_from_sid($SID) == "Developer") { + print "<option value='do_Delete'>".__("Delete Packages")."</option>\n"; + } print "<option value='do_Notify'>".__("Toggle Notify")."</option>\n"; print "</select>"; print "<input type='submit' class='button' style='width: 80px' value='" . __("Go") . "' />"; |