prefs: allow setting email if it was previously blank

This commit is contained in:
Andrew Dolgov 2021-03-17 19:50:04 +03:00
parent ce9955c6ff
commit 43ea36d030
1 changed files with 15 additions and 15 deletions

View File

@ -231,11 +231,10 @@ class Pref_Prefs extends Handler_Protected {
if ($user) { if ($user) {
$user->full_name = clean($_POST['full_name']); $user->full_name = clean($_POST['full_name']);
if ($user->email != $new_email) if ($user->email != $new_email) {
Logger::log(E_USER_NOTICE, "Email address of user ".$user->login." has been changed to ${new_email}."); Logger::log(E_USER_NOTICE, "Email address of user ".$user->login." has been changed to ${new_email}.");
if ($user->email && $user->email != $new_email) { if ($user->email) {
$mailer = new Mailer(); $mailer = new Mailer();
$tpl = new Templator(); $tpl = new Templator();
@ -254,6 +253,7 @@ class Pref_Prefs extends Handler_Protected {
"to_address" => $user->email, "to_address" => $user->email,
"subject" => "[tt-rss] Email address change notification", "subject" => "[tt-rss] Email address change notification",
"message" => $message]); "message" => $message]);
}
$user->email = $new_email; $user->email = $new_email;
} }