diff options
Diffstat (limited to 'register.php')
-rw-r--r-- | register.php | 75 |
1 files changed, 19 insertions, 56 deletions
diff --git a/register.php b/register.php index 678b3c317..035a2cd8e 100644 --- a/register.php +++ b/register.php @@ -7,7 +7,7 @@ set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . get_include_path()); - require_once 'lib/phpmailer/class.phpmailer.php'; + require_once 'classes/ttrssmailer.php'; require_once "functions.php"; require_once "sessions.php"; @@ -74,7 +74,7 @@ if ($action == "check") { header("Content-Type: application/xml"); - $login = trim(db_escape_string($_REQUEST['login'])); + $login = trim(db_escape_string($link, $_REQUEST['login'])); $result = db_query($link, "SELECT id FROM ttrss_users WHERE LOWER(login) = LOWER('$login')"); @@ -242,9 +242,9 @@ <?php } else if ($action == "do_register") { ?> <?php - $login = mb_strtolower(trim(db_escape_string($_REQUEST["login"]))); - $email = trim(db_escape_string($_REQUEST["email"])); - $test = trim(db_escape_string($_REQUEST["turing_test"])); + $login = mb_strtolower(trim(db_escape_string($link, $_REQUEST["login"]))); + $email = trim(db_escape_string($link, $_REQUEST["email"])); + $test = trim(db_escape_string($link, $_REQUEST["turing_test"])); if (!$login || !$email || !$test) { print_error(__("Your registration information is incomplete.")); @@ -306,65 +306,28 @@ "\n". "If that wasn't you, just ignore this message. Thanks."; - $mail = new PHPMailer(); - - $mail->PluginDir = "lib/phpmailer/"; - $mail->SetLanguage("en", "lib/phpmailer/language/"); - - $mail->CharSet = "UTF-8"; - - $mail->From = SMTP_FROM_ADDRESS; - $mail->FromName = SMTP_FROM_NAME; - $mail->AddAddress($email); - - if (SMTP_HOST) { - $mail->Host = SMTP_HOST; - $mail->Mailer = "smtp"; - $mail->Username = SMTP_LOGIN; - $mail->Password = SMTP_PASSWORD; - } - - // $mail->IsHTML(true); - $mail->Subject = "Registration information for Tiny Tiny RSS"; - $mail->Body = $reg_text; - // $mail->AltBody = $digest_text; - - $rc = $mail->Send(); + $mail = new ttrssMailer(); + $mail->IsHTML(false); + $rc = $mail->quickMail($email, "", "Registration information for Tiny Tiny RSS", $reg_text, false); if (!$rc) print_error($mail->ErrorInfo); - + + unset($reg_text); + unset($mail); + unset($rc); $reg_text = "Hi!\n". "\n". "New user had registered at your Tiny Tiny RSS installation.\n". "\n". "Login: $login\n". "Email: $email\n"; - - $mail = new PHPMailer(); - - $mail->PluginDir = "lib/phpmailer/"; - $mail->SetLanguage("en", "lib/phpmailer/language/"); - - $mail->CharSet = "UTF-8"; - - $mail->From = SMTP_FROM_ADDRESS; - $mail->FromName = SMTP_FROM_NAME; - $mail->AddAddress(REG_NOTIFY_ADDRESS); - - if (SMTP_HOST) { - $mail->Host = SMTP_HOST; - $mail->Mailer = "smtp"; - $mail->Username = SMTP_LOGIN; - $mail->Password = SMTP_PASSWORD; - } - - // $mail->IsHTML(true); - $mail->Subject = "Registration notice for Tiny Tiny RSS"; - $mail->Body = $reg_text; - // $mail->AltBody = $digest_text; - - $rc = $mail->Send(); - + + + $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); + print_notice(__("Account created successfully.")); print "<p><form method=\"GET\" action=\"index.php\"> |