]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 315451: Add 'Enabled user accounts only' filter when searching for
authorTiago Mello <timello@gmail.com>
Fri, 30 Sep 2011 13:54:16 +0000 (10:54 -0300)
committerTiago Mello <timello@gmail.com>
Fri, 30 Sep 2011 13:54:16 +0000 (10:54 -0300)
user accounts.
r=glob, a=LpSolit

editusers.cgi
template/en/default/admin/users/search.html.tmpl

index c25c5e9ef07f7a7d29622a167a240c568274d9ac..02b7aa0c8c6c151b85358b9735acc73bedfc873a 100755 (executable)
@@ -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,
index 82e0afda71f3ea83cbcdbf957831d1ec901e0343..2ecbbe8dbcb4e1ea3cdfaa1e304011b03e7958dc 100644 (file)
     [% 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 %]