]> git.wh0rd.org - tt-rss.git/blobdiff - register.php
remove page title stuff for the time being
[tt-rss.git] / register.php
index 678b3c31785ee4f4a55c9075ac9cda0c5f5f492e..035a2cd8e06bc8ea3b3b9c16e4aff6a797296f17 100644 (file)
@@ -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')");
        <?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."));
                                                "\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\">