Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e7d28afb
Commit
e7d28afb
authored
Aug 17, 2011
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 677522: IssueEmailChangeToken() should get the old login name from the user object
r=timello a=LpSolit
parent
45a4eea5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
Token.pm
Bugzilla/Token.pm
+4
-4
userprefs.cgi
userprefs.cgi
+2
-5
No files found.
Bugzilla/Token.pm
View file @
e7d28afb
...
...
@@ -92,8 +92,9 @@ sub issue_new_user_account_token {
}
sub
IssueEmailChangeToken
{
my
(
$user
,
$
old_email
,
$
new_email
)
=
@_
;
my
(
$user
,
$new_email
)
=
@_
;
my
$email_suffix
=
Bugzilla
->
params
->
{
'emailsuffix'
};
my
$old_email
=
$user
->
login
;
my
(
$token
,
$token_ts
)
=
_create_token
(
$user
->
id
,
'emailold'
,
$old_email
.
":"
.
$new_email
);
...
...
@@ -445,7 +446,7 @@ Bugzilla::Token - Provides different routines to manage tokens.
use Bugzilla::Token;
Bugzilla::Token::issue_new_user_account_token($login_name);
Bugzilla::Token::IssueEmailChangeToken($user, $
old_email, $
new_email);
Bugzilla::Token::IssueEmailChangeToken($user, $new_email);
Bugzilla::Token::IssuePasswordToken($user);
Bugzilla::Token::DeletePasswordTokens($user_id, $reason);
Bugzilla::Token::Cancel($token, $cancelaction, $vars);
...
...
@@ -476,7 +477,7 @@ Bugzilla::Token - Provides different routines to manage tokens.
Returns: Nothing. It throws an error if the same user made the same
request in the last few minutes.
=item C<sub IssueEmailChangeToken($user, $
old_email, $
new_email)>
=item C<sub IssueEmailChangeToken($user, $new_email)>
Description: Sends two distinct tokens per email to the old and new email
addresses to confirm the email address change for the given
...
...
@@ -484,7 +485,6 @@ Bugzilla::Token - Provides different routines to manage tokens.
Params: $user - User object of the user requesting a new
email address.
$old_email - The current (old) email address of the user.
$new_email - The new email address of the user.
Returns: Nothing.
...
...
userprefs.cgi
View file @
e7d28afb
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment