summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago Mello <timello@gmail.com>2011-09-30 15:54:16 +0200
committerTiago Mello <timello@gmail.com>2011-09-30 15:54:16 +0200
commite4f8a784dea705fcc2d29183e5c899e4e6d8d6d1 (patch)
treeea709a86a2334f24d33a43c467216451bbe8ee1a
parentdd832b2728550c696a324d74a3a0013e87d8f5c8 (diff)
downloadbugzilla-e4f8a784dea705fcc2d29183e5c899e4e6d8d6d1.tar.gz
bugzilla-e4f8a784dea705fcc2d29183e5c899e4e6d8d6d1.tar.xz
Bug 315451: Add 'Enabled user accounts only' filter when searching for
user accounts. r=glob, a=LpSolit
-rwxr-xr-xeditusers.cgi7
-rw-r--r--template/en/default/admin/users/search.html.tmpl7
2 files changed, 14 insertions, 0 deletions
diff --git a/editusers.cgi b/editusers.cgi
index c25c5e9ef..02b7aa0c8 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -77,6 +77,7 @@ if ($action eq 'search') {
my $matchstr = trim($cgi->param('matchstr'));
my $matchtype = $cgi->param('matchtype');
my $grouprestrict = $cgi->param('grouprestrict') || '0';
+ my $enabled_only = $cgi->param('enabled_only') || '0';
my $query = 'SELECT DISTINCT userid, login_name, realname, is_enabled ' .
'FROM profiles';
my @bindValues;
@@ -167,6 +168,12 @@ if ($action eq 'search') {
@{Bugzilla::Group->flatten_group_membership($group->id)});
$query .= " $nextCondition ugm.group_id IN($grouplist) ";
}
+
+ if ($enabled_only eq '1') {
+ $query .= " $nextCondition profiles.is_enabled = 1 ";
+ $nextCondition = 'AND';
+ }
+
$query .= ' ORDER BY profiles.login_name';
$vars->{'users'} = $dbh->selectall_arrayref($query,
diff --git a/template/en/default/admin/users/search.html.tmpl b/template/en/default/admin/users/search.html.tmpl
index 82e0afda7..2ecbbe8db 100644
--- a/template/en/default/admin/users/search.html.tmpl
+++ b/template/en/default/admin/users/search.html.tmpl
@@ -62,6 +62,13 @@
[% END %]
</select></p>
[% END %]
+
+<p>
+ <input type="checkbox" name="enabled_only" value="1" id="enabled_only"
+ checked="checked">
+ <label for="enabled_only">Enabled user accounts only</label>
+</p>
+
</form>
[% IF editusers %]