aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2004-11-24 06:41:43 +0000
committerjocuri%softhome.net <>2004-11-24 06:41:43 +0000
commiteb2423b1c5e3090d09db856e7020f4dd24232674 (patch)
tree9a2069d50391bec9e408fb25a48ce32de5cc5248 /editgroups.cgi
parentPatch for bug 269294: Do not mention QuickSearch in the error message if not ... (diff)
downloadbugzilla-eb2423b1c5e3090d09db856e7020f4dd24232674.tar.gz
bugzilla-eb2423b1c5e3090d09db856e7020f4dd24232674.tar.bz2
bugzilla-eb2423b1c5e3090d09db856e7020f4dd24232674.zip
Patch for bug 180879: Implement privs for bug flags modification; patch by Frédéric Buclin <LpSolit@netscape.net>, r=joel, a=justdave.
Diffstat (limited to 'editgroups.cgi')
-rwxr-xr-xeditgroups.cgi19
1 files changed, 19 insertions, 0 deletions
diff --git a/editgroups.cgi b/editgroups.cgi
index b3b6135e4..bc22d518e 100755
--- a/editgroups.cgi
+++ b/editgroups.cgi
@@ -317,12 +317,20 @@ if ($action eq 'del') {
$hasproduct = 1;
}
+ my $hasflags = 0;
+ SendSQL("SELECT id FROM flagtypes
+ WHERE grant_group_id = $gid OR request_group_id = $gid");
+ if (FetchOneColumn()) {
+ $hasflags = 1;
+ }
+
$vars->{'gid'} = $gid;
$vars->{'name'} = $name;
$vars->{'description'} = $desc;
$vars->{'hasusers'} = $hasusers;
$vars->{'hasbugs'} = $hasbugs;
$vars->{'hasproduct'} = $hasproduct;
+ $vars->{'hasflags'} = $hasflags;
$vars->{'buglist'} = $buglist;
print Bugzilla->cgi->header();
@@ -365,8 +373,19 @@ if ($action eq 'delete') {
$cantdelete = 1;
}
}
+ SendSQL("SELECT id FROM flagtypes
+ WHERE grant_group_id = $gid OR request_group_id = $gid");
+ if (FetchOneColumn()) {
+ if (!defined $cgi->param('removeflags')) {
+ $cantdelete = 1;
+ }
+ }
if (!$cantdelete) {
+ SendSQL("UPDATE flagtypes SET grant_group_id = NULL
+ WHERE grant_group_id = $gid");
+ SendSQL("UPDATE flagtypes SET request_group_id = NULL
+ WHERE request_group_id = $gid");
SendSQL("DELETE FROM user_group_map WHERE group_id = $gid");
SendSQL("DELETE FROM group_group_map WHERE grantor_id = $gid");
SendSQL("DELETE FROM bug_group_map WHERE group_id = $gid");