From 3891b63a1eb52076337885487f251a10580a4a85 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 27 Apr 2016 18:50:13 +0200 Subject: Bug 218917 - Allow the login name to be different from the email address Original patch by Gervase Markham r=gerv a=dkl --- extensions/Voting/Extension.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'extensions') diff --git a/extensions/Voting/Extension.pm b/extensions/Voting/Extension.pm index a0ed8f3fd..3de790d83 100644 --- a/extensions/Voting/Extension.pm +++ b/extensions/Voting/Extension.pm @@ -746,7 +746,7 @@ sub _remove_votes { my $whopart = ($who) ? " AND votes.who = $who" : ""; - my $sth = $dbh->prepare("SELECT profiles.login_name, " . + my $sth = $dbh->prepare("SELECT profiles.email, " . "profiles.userid, votes.vote_count, " . "products.votesperuser, products.maxvotesperbug " . "FROM profiles " . @@ -756,8 +756,8 @@ sub _remove_votes { "WHERE votes.bug_id = ? " . $whopart); $sth->execute($id); my @list; - while (my ($name, $userid, $oldvotes, $votesperuser, $maxvotesperbug) = $sth->fetchrow_array()) { - push(@list, [$name, $userid, $oldvotes, $votesperuser, $maxvotesperbug]); + while (my ($email, $userid, $oldvotes, $votesperuser, $maxvotesperbug) = $sth->fetchrow_array()) { + push(@list, [$email, $userid, $oldvotes, $votesperuser, $maxvotesperbug]); } # @messages stores all emails which have to be sent, if any. @@ -766,7 +766,7 @@ sub _remove_votes { if (scalar(@list)) { foreach my $ref (@list) { - my ($name, $userid, $oldvotes, $votesperuser, $maxvotesperbug) = (@$ref); + my ($email, $userid, $oldvotes, $votesperuser, $maxvotesperbug) = (@$ref); $maxvotesperbug = min($votesperuser, $maxvotesperbug); @@ -797,7 +797,7 @@ sub _remove_votes { # Now lets send the e-mail to alert the user to the fact that their votes have # been reduced or removed. my $vars = { - 'to' => $name . Bugzilla->params->{'emailsuffix'}, + 'to' => $email, 'bugid' => $id, 'reason' => $reason, -- cgit v1.2.3-24-g4f1b