From e7d28afbc4990c564be08f77cc472f92962f8f45 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 17 Aug 2011 14:53:36 +0200 Subject: Bug 677522: IssueEmailChangeToken() should get the old login name from the user object r=timello a=LpSolit --- userprefs.cgi | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'userprefs.cgi') diff --git a/userprefs.cgi b/userprefs.cgi index 343023635..de9757515 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -85,8 +85,6 @@ sub SaveAccount { my $oldpassword = $cgi->param('old_password'); my $pwd1 = $cgi->param('new_password1'); my $pwd2 = $cgi->param('new_password2'); - - my $old_login_name = $user->login; my $new_login_name = trim($cgi->param('new_login_name')); if ($user->authorizer->can_change_password @@ -120,7 +118,7 @@ sub SaveAccount { && Bugzilla->params->{"allowemailchange"} && $new_login_name) { - if ($old_login_name ne $new_login_name) { + if ($user->login ne $new_login_name) { $oldpassword || ThrowUserError("old_password_required"); # Block multiple email changes for the same user. @@ -134,8 +132,7 @@ sub SaveAccount { is_available_username($new_login_name) || ThrowUserError("account_exists", {email => $new_login_name}); - Bugzilla::Token::IssueEmailChangeToken($user, $old_login_name, - $new_login_name); + Bugzilla::Token::IssueEmailChangeToken($user, $new_login_name); $vars->{'email_changes_saved'} = 1; } -- cgit v1.2.3-24-g4f1b