summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-04-08 11:48:59 +0200
committerlpsolit%gmail.com <>2009-04-08 11:48:59 +0200
commitb180075f49d4a16474c3f9e88c723cca752f3880 (patch)
tree53adbc3639cef0e670a75816386f447b311449e0 /Bugzilla/User.pm
parent1bf19de15a64a50ea7b5c340f5088e9db61f88c2 (diff)
downloadbugzilla-b180075f49d4a16474c3f9e88c723cca752f3880.tar.gz
bugzilla-b180075f49d4a16474c3f9e88c723cca752f3880.tar.xz
Back out bug 440259. PostgreSQL fails
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index cf4cb5fa6..b6754c472 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -1017,7 +1017,7 @@ sub match {
if ($wildstr =~ s/\*/\%/g) { # don't do wildcards if no '*' in the string
# Build the query.
trick_taint($wildstr);
- my $query = "SELECT DISTINCT userid FROM profiles ";
+ my $query = "SELECT DISTINCT login_name FROM profiles ";
if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "INNER JOIN user_group_map
ON user_group_map.user_id = profiles.userid ";
@@ -1036,8 +1036,10 @@ sub match {
# Execute the query, retrieve the results, and make them into
# User objects.
- my $user_ids = $dbh->selectcol_arrayref($query, undef, ($wildstr, $wildstr));
- @users = @{Bugzilla::User->new_from_list($user_ids)};
+ my $user_logins = $dbh->selectcol_arrayref($query, undef, ($wildstr, $wildstr));
+ foreach my $login_name (@$user_logins) {
+ push(@users, new Bugzilla::User({ name => $login_name }));
+ }
}
else { # try an exact match
# Exact matches don't care if a user is disabled.
@@ -1053,7 +1055,7 @@ sub match {
if (!scalar(@users) && length($str) >= 3) {
trick_taint($str);
- my $query = "SELECT DISTINCT userid FROM profiles ";
+ my $query = "SELECT DISTINCT login_name FROM profiles ";
if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "INNER JOIN user_group_map
ON user_group_map.user_id = profiles.userid ";
@@ -1070,8 +1072,10 @@ sub match {
$query .= " ORDER BY login_name ";
$query .= $dbh->sql_limit($limit) if $limit;
- my $user_ids = $dbh->selectcol_arrayref($query, undef, ($str, $str));
- @users = @{Bugzilla::User->new_from_list($user_ids)};
+ my $user_logins = $dbh->selectcol_arrayref($query, undef, ($str, $str));
+ foreach my $login_name (@$user_logins) {
+ push(@users, new Bugzilla::User({ name => $login_name }));
+ }
}
return \@users;
}