aboutsummaryrefslogtreecommitdiffstats
path: root/editusers.cgi
diff options
context:
space:
mode:
authorGervase Markham <gerv@gerv.net>2015-09-04 10:56:40 +0100
committerGervase Markham <gerv@gerv.net>2015-09-04 10:56:40 +0100
commite76030a30c35bb23b0bf6d284e32b13384fd4954 (patch)
tree15a3c1a344c0b9d7d7a7352eb041d09e54976671 /editusers.cgi
parentea25c5cf646763926a8c6a5dfb04bd356e76905b (diff)
downloadbugs-e76030a30c35bb23b0bf6d284e32b13384fd4954.tar
bugs-e76030a30c35bb23b0bf6d284e32b13384fd4954.tar.gz
bugs-e76030a30c35bb23b0bf6d284e32b13384fd4954.tar.bz2
bugs-e76030a30c35bb23b0bf6d284e32b13384fd4954.tar.xz
bugs-e76030a30c35bb23b0bf6d284e32b13384fd4954.zip
Make editusers.cgi list users properly when is_enabled is not defined. r=LpSolit, a=simon
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-xeditusers.cgi6
1 files changed, 4 insertions, 2 deletions
diff --git a/editusers.cgi b/editusers.cgi
index a38195a4b..37665b12d 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -70,7 +70,8 @@ if ($action eq 'search') {
my $matchstr = trim($cgi->param('matchstr'));
my $matchtype = $cgi->param('matchtype');
my $grouprestrict = $cgi->param('grouprestrict') || '0';
- my $is_enabled = scalar $cgi->param('is_enabled');
+ # 0 = disabled only, 1 = enabled only, 2 = everyone
+ my $is_enabled = $cgi->param('is_enabled') // 2;
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';
@@ -163,11 +164,12 @@ if ($action eq 'search') {
}
detaint_natural($is_enabled);
- if ($is_enabled == 0 || $is_enabled == 1) {
+ if ($is_enabled && ($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,