From: Sunil Joshi Date: Tue, 3 Sep 2013 23:57:17 +0000 (+1000) Subject: Bug 331529 - editusers list should let me search for disabled users X-Git-Tag: bugzilla-4.5.1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41eda66a29eea7fffe23508ecff6857bd951fcad;p=thirdparty%2Fbugzilla.git Bug 331529 - editusers list should let me search for disabled users r=simon, a=simon --- diff --git a/editusers.cgi b/editusers.cgi index e12fc35b62..f4e3c08417 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -68,7 +68,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 $is_enabled = scalar $cgi->param('is_enabled'); my $query = 'SELECT DISTINCT userid, login_name, realname, is_enabled, ' . $dbh->sql_date_format('last_seen_date', '%Y-%m-%d') . ' AS last_seen_date ' . 'FROM profiles'; @@ -160,11 +160,12 @@ if ($action eq 'search') { $query .= " $nextCondition ugm.group_id IN($grouplist) "; } - if ($enabled_only eq '1') { - $query .= " $nextCondition profiles.is_enabled = 1 "; + detaint_natural($is_enabled); + if ($is_enabled == 0 || $is_enabled == 1) { + $query .= " $nextCondition profiles.is_enabled = ?"; $nextCondition = 'AND'; + push(@bindValues, $is_enabled); } - $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 c66af4c5cf..55b7300a61 100644 --- a/template/en/default/admin/users/search.html.tmpl +++ b/template/en/default/admin/users/search.html.tmpl @@ -56,9 +56,13 @@ [% END %]

- - + Restrict search to + + users.

[% Hook.process('end') %]