mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
fix #750 Warn by mail that user passwaord has been changed
This commit is contained in:
@@ -75,6 +75,18 @@ class mail
|
||||
return self::send_mail($subject, $body, $to);
|
||||
}
|
||||
|
||||
public static function change_password(User_Adapter $user)
|
||||
{
|
||||
$subject = _('Password has been changed');
|
||||
|
||||
$body = "<div>" . _('This email warn you that the password for the following login account has been changed recently ')
|
||||
. "</div><div>\n\n" . $login . "</div>\n\n";
|
||||
|
||||
$to = array('email' => $user->get_email(), 'name' => $user->get_email());
|
||||
|
||||
return self::send_mail($subject, $body, $to);
|
||||
}
|
||||
|
||||
public static function register_confirm($email, $accept, $deny)
|
||||
{
|
||||
$registry = registry::get_instance();
|
||||
|
@@ -65,6 +65,9 @@ if (isset($parm['token']) && isset($parm['form_password']) && isset($parm['form_
|
||||
$datas = random::helloToken($parm['token']);
|
||||
$user = User_Adapter::getInstance($datas['usr_id'], $appbox);
|
||||
$user->set_password($parm['form_password_confirm']);
|
||||
|
||||
mail::change_password($user);
|
||||
|
||||
random::removeToken($parm['token']);
|
||||
|
||||
return phrasea::redirect('/login/index.php?confirm=password-update-ok');
|
||||
|
@@ -54,6 +54,8 @@ if ( ! is_null($parm['form_old_password']) && ! is_null($parm['form_password'])
|
||||
$auth->challenge_password();
|
||||
$user->set_password($parm['form_password_confirm']);
|
||||
|
||||
mail::change_password($user);
|
||||
|
||||
return phrasea::redirect('/login/account.php?notice=password-update-ok');
|
||||
} catch (Exception $e) {
|
||||
$error = true;
|
||||
|
Reference in New Issue
Block a user