summaryrefslogtreecommitdiffstats
path: root/editusers.cgi
diff options
context:
space:
mode:
authorwurblzap%gmail.com <>2006-01-03 17:40:45 +0100
committerwurblzap%gmail.com <>2006-01-03 17:40:45 +0100
commit75ab7e0114759b02858199420a14fa6d30fde107 (patch)
treeb13b7edc119e6cd8841f88f5661a76c2ab038246 /editusers.cgi
parent972eed87eba7dafcf50b5cd9c8993735690807d9 (diff)
downloadbugzilla-75ab7e0114759b02858199420a14fa6d30fde107.tar.gz
bugzilla-75ab7e0114759b02858199420a14fa6d30fde107.tar.xz
Bug 322082: Clean up user selection SQL.
Patch by Marc Schumann <wurblzap@gmail.com>, r=LpSolit, a=justdave
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-xeditusers.cgi14
1 files changed, 9 insertions, 5 deletions
diff --git a/editusers.cgi b/editusers.cgi
index 40854775f..3e23d0808 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -100,9 +100,15 @@ if ($action eq 'search') {
} else {
$visibleGroups = 1;
if ($grouprestrict eq '1') {
- $query .= ', user_group_map AS ugm';
+ $query .= qq{, user_group_map AS ugm
+ WHERE ugm.user_id = profiles.userid
+ AND ugm.isbless = 0
+ };
+ $nextCondition = 'AND';
+ }
+ else {
+ $nextCondition = 'WHERE';
}
- $nextCondition = 'WHERE';
}
if (!$visibleGroups) {
@@ -137,9 +143,7 @@ if ($action eq 'search') {
if ($grouprestrict eq '1') {
my $grouplist = join(',',
@{Bugzilla::User->flatten_group_membership($group->id)});
- $query .= " $nextCondition profiles.userid = ugm.user_id " .
- "AND ugm.group_id IN($grouplist) " .
- "AND ugm.isbless = 0";
+ $query .= " $nextCondition ugm.group_id IN($grouplist) ";
}
$query .= ' ORDER BY profiles.login_name';