summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-03-31 21:35:25 +0200
committerlpsolit%gmail.com <>2009-03-31 21:35:25 +0200
commitabde2183d73d95f0ffefd61b0f469dd90fe86749 (patch)
tree23f9ac9f4b8c238f5f90e24dd3f1e026bebf00bb /Bugzilla
parentffc663e11c9bd310e5a15452739dc64b88095611 (diff)
downloadbugzilla-abde2183d73d95f0ffefd61b0f469dd90fe86749.tar.gz
bugzilla-abde2183d73d95f0ffefd61b0f469dd90fe86749.tar.xz
Bug 440259: User::match should be using Bugzilla::User->new_from_list - Patch by arbingersys <arbingersys@gmail.com> r=LpSolit a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/User.pm16
1 files changed, 6 insertions, 10 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 1e20ef73d..74289fe56 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -1015,7 +1015,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 login_name FROM profiles ";
+ my $query = "SELECT DISTINCT userid FROM profiles ";
if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "INNER JOIN user_group_map
ON user_group_map.user_id = profiles.userid ";
@@ -1034,10 +1034,8 @@ sub match {
# Execute the query, retrieve the results, and make them into
# User objects.
- my $user_logins = $dbh->selectcol_arrayref($query, undef, ($wildstr, $wildstr));
- foreach my $login_name (@$user_logins) {
- push(@users, new Bugzilla::User({ name => $login_name }));
- }
+ my $user_ids = $dbh->selectcol_arrayref($query, undef, ($wildstr, $wildstr));
+ @users = @{Bugzilla::User->new_from_list($user_ids)};
}
else { # try an exact match
# Exact matches don't care if a user is disabled.
@@ -1053,7 +1051,7 @@ sub match {
if (!scalar(@users) && length($str) >= 3) {
trick_taint($str);
- my $query = "SELECT DISTINCT login_name FROM profiles ";
+ my $query = "SELECT DISTINCT userid FROM profiles ";
if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "INNER JOIN user_group_map
ON user_group_map.user_id = profiles.userid ";
@@ -1070,10 +1068,8 @@ sub match {
$query .= " ORDER BY login_name ";
$query .= $dbh->sql_limit($limit) if $limit;
- my $user_logins = $dbh->selectcol_arrayref($query, undef, ($str, $str));
- foreach my $login_name (@$user_logins) {
- push(@users, new Bugzilla::User({ name => $login_name }));
- }
+ my $user_ids = $dbh->selectcol_arrayref($query, undef, ($str, $str));
+ @users = @{Bugzilla::User->new_from_list($user_ids)};
}
return \@users;
}