aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@netscape.net>2017-10-15 16:27:37 +0200
committerFrédéric Buclin <LpSolit@netscape.net>2017-10-15 16:27:37 +0200
commitade2227bb209e78eb9d7b089471988b3ef80fe3c (patch)
tree7eb015a468a45fd48522212c5adad9841f347721
parent7c65990927b3ededebdcd05d3ca71800a7a2458b (diff)
downloadbugs-ade2227bb209e78eb9d7b089471988b3ef80fe3c.tar
bugs-ade2227bb209e78eb9d7b089471988b3ef80fe3c.tar.gz
bugs-ade2227bb209e78eb9d7b089471988b3ef80fe3c.tar.bz2
bugs-ade2227bb209e78eb9d7b089471988b3ef80fe3c.tar.xz
bugs-ade2227bb209e78eb9d7b089471988b3ef80fe3c.zip
Allow to restrict the users list to direct group membership
-rwxr-xr-xeditusers.cgi3
-rw-r--r--template/en/default/admin/users/search.html.tmpl8
2 files changed, 8 insertions, 3 deletions
diff --git a/editusers.cgi b/editusers.cgi
index 5dea7c8a0..7f0d2e205 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -160,7 +160,8 @@ if ($action eq 'search') {
# Handle selection by group.
if ($grouprestrict eq '1') {
- my $grouplist = join(',',
+ my $direct_membership = $cgi->param('group_direct_membership');
+ my $grouplist = $direct_membership ? $group->id : join(',',
@{Bugzilla::Group->flatten_group_membership($group->id)});
$query .= " $nextCondition ugm.group_id IN($grouplist) ";
}
diff --git a/template/en/default/admin/users/search.html.tmpl b/template/en/default/admin/users/search.html.tmpl
index bab4338ae..f62148df2 100644
--- a/template/en/default/admin/users/search.html.tmpl
+++ b/template/en/default/admin/users/search.html.tmpl
@@ -46,14 +46,18 @@
</p>
[% IF restrictablegroups.size %]
- <p><input type="checkbox" name="grouprestrict" value="1" id="grouprestrict">
+ <p><input type="checkbox" name="grouprestrict" value="1" id="grouprestrict"
+ onchange="document.forms['f'].group_direct_membership.disabled=!this.checked">
<label for="grouprestrict">Restrict to users belonging to group</label>
<select name="groupid"
- onchange="document.forms['f'].grouprestrict.checked=true">
+ onchange="document.forms['f'].grouprestrict.checked=true;
+ document.forms['f'].group_direct_membership.disabled=false">
[% FOREACH group = restrictablegroups %]
<option value="[% group.id FILTER html %]">[% group.name FILTER html %]</option>
[% END %]
</select></p>
+ <p><input type="checkbox" name="group_direct_membership" value="1" id="group_direct_membership" disabled>
+ <label for="group_direct_membership">Restrict to users who are direct members of this group</label></p>
[% END %]
<p>