Skip to content

Commit 4205bd7

Browse files
committed
removed email change logic
1 parent 9a54d04 commit 4205bd7

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

userprefs.cgi

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -135,42 +135,10 @@ sub SaveAccount {
135135
if (Bugzilla::Token::HasEmailChangeToken($user->id)) {
136136
ThrowUserError("login_change_during_email_change");
137137
}
138-
138+
139139
$user->set_login($new_login);
140140
}
141141

142-
if ( $user->authorizer->can_change_email
143-
&& Bugzilla->params->{"allowemailchange"}
144-
&& $new_login_name)
145-
{
146-
if ($user->login ne $new_login_name) {
147-
$oldpassword || ThrowUserError("old_password_required");
148-
149-
# Block multiple email changes for the same user.
150-
if (Bugzilla::Token::HasEmailChangeToken($user->id)) {
151-
ThrowUserError("email_change_in_progress");
152-
}
153-
154-
# Before changing an email address, confirm one does not exist.
155-
validate_email_syntax($new_login_name)
156-
|| ThrowUserError('illegal_email_address', {addr => $new_login_name});
157-
is_available_username($new_login_name)
158-
|| ThrowUserError("account_exists", {email => $new_login_name});
159-
160-
if ($user->mfa) {
161-
push @mfa_events,
162-
{
163-
type => 'set_login',
164-
reason => 'changing your email address',
165-
login => $new_login_name,
166-
};
167-
}
168-
else {
169-
Bugzilla::Token::IssueEmailChangeToken($user, $new_login_name);
170-
$vars->{email_changes_saved} = 1;
171-
}
172-
}
173-
}
174142

175143
$user->set_name($cgi->param('realname'));
176144
$user->update({keep_session => 1, keep_tokens => 1});

0 commit comments

Comments
 (0)