1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 11:55:56 +00:00

add notifications for mail and password changes

update and shorten some other message templates
This commit is contained in:
Andrew Dolgov
2019-10-09 09:04:51 +03:00
parent d029e18976
commit ef514bc4bd
11 changed files with 92 additions and 12 deletions

View File

@@ -211,6 +211,32 @@ class Auth_Internal extends Plugin implements IAuthModule {
$_SESSION["pwd_hash"] = $new_password_hash;
$sth = $this->pdo->prepare("SELECT email, login FROM ttrss_users WHERE id = ?");
$sth->execute([$owner_uid]);
if ($row = $sth->fetch()) {
$mailer = new Mailer();
require_once "lib/MiniTemplator.class.php";
$tpl = new MiniTemplator;
$tpl->readTemplateFromFile("templates/password_change_template.txt");
$tpl->setVariable('LOGIN', $row["login"]);
$tpl->setVariable('TTRSS_HOST', SELF_URL_PATH);
$tpl->addBlock('message');
$tpl->generateOutputToString($message);
$mailer->mail(["to_name" => $row["login"],
"to_address" => $row["email"],
"subject" => "[tt-rss] Password change notification",
"message" => $message]);
}
return __("Password has been changed.");
} else {
return "ERROR: ".__('Old password is incorrect.');