X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=blobdiff_plain;f=register.php;h=8bbce99328b31186e01c1a416712db8501c3dc89;hp=a8fdb483aec1c476f6f9c098a81a745d09f12326;hb=HEAD;hpb=6322ac79a020ab584d412d782d62b2ee77d7c6cf diff --git a/register.php b/register.php index a8fdb483..8bbce993 100644 --- a/register.php +++ b/register.php @@ -7,7 +7,6 @@ set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . get_include_path()); - require_once 'classes/ttrssmailer.php'; require_once "autoload.php"; require_once "functions.php"; require_once "sessions.php"; @@ -15,9 +14,9 @@ require_once "config.php"; require_once "db.php"; - $action = $_REQUEST["action"]; + startup_gettext(); - $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); + $action = $_REQUEST["action"]; if (!init_plugins()) return; @@ -95,10 +94,10 @@ Create new account - - - - + + + + - + @@ -308,15 +307,13 @@ "\n". "If that wasn't you, just ignore this message. Thanks."; - $mail = new ttrssMailer(); - $mail->IsHTML(false); - $rc = $mail->quickMail($email, "", "Registration information for Tiny Tiny RSS", $reg_text, false); + $mailer = new Mailer(); + $rc = $mailer->mail(["to_address" => $email, + "subject" => "Registration information for Tiny Tiny RSS", + "message" => $reg_text]); - if (!$rc) print_error($mail->ErrorInfo); + if (!$rc) print_error($mailer->error()); - unset($reg_text); - unset($mail); - unset($rc); $reg_text = "Hi!\n". "\n". "New user had registered at your Tiny Tiny RSS installation.\n". @@ -324,11 +321,12 @@ "Login: $login\n". "Email: $email\n"; + $mailer = new Mailer(); + $rc = $mailer->mail(["to_address" => REG_NOTIFY_ADDRESS, + "subject" => "Registration notice for Tiny Tiny RSS", + "message" => $reg_text]); - $mail = new ttrssMailer(); - $mail->IsHTML(false); - $rc = $mail->quickMail(REG_NOTIFY_ADDRESS, "", "Registration notice for Tiny Tiny RSS", $reg_text, false); - if (!$rc) print_error($mail->ErrorInfo); + if (!$rc) print_error($mailer->error()); print_notice(__("Account created successfully.")); @@ -364,4 +362,3 @@ -