]> git.wh0rd.org - tt-rss.git/commitdiff
ttrssMailer: actually use OOP properly
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Apr 2013 12:50:22 +0000 (16:50 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Apr 2013 12:50:22 +0000 (16:50 +0400)
classes/ttrssmailer.php
plugins/mail/mail.js

index 54d180620fee9f93f8579705e7516dc43862e618..fd7f969aa701cc73caeccb65c42711aef7096da2 100644 (file)
@@ -17,34 +17,29 @@ class ttrssMailer extends PHPMailer {
                public $CharSet = "UTF-8";\r
                public $PluginDir = "lib/phpmailer/";\r
                public $ContentType = "text/html"; //default email type is HTML\r
-               public $Host;\r
-               public $Port;\r
-               public $SMTPAuth=False;\r
-               public $Username;\r
-               public $Password;\r
 \r
        function __construct() {\r
                $this->SetLanguage("en", "lib/phpmailer/language/");\r
 \r
                if (SMTP_SERVER) {\r
                        $pair = explode(":", SMTP_SERVER, 2);\r
-                       $Mailer = "smtp";\r
+                       $this->Mailer = "smtp";\r
 \r
-                       $Host = $pair[0];\r
-                       $Port = $pair[1];\r
+                       $this->Host = $pair[0];\r
+                       $this->Port = $pair[1];\r
 \r
                        if (!$Port) $Port = 25;\r
                } else {\r
-                       $Host = '';\r
-                       $Port = '';\r
+                       $this->Host = '';\r
+                       $this->Port = '';\r
                }\r
 \r
 \r
                //if SMTP_LOGIN is specified, set credentials and enable auth\r
                if(SMTP_LOGIN){\r
-                       $SMTPAuth = true;\r
-                       $Username = SMTP_LOGIN;\r
-                       $Password = SMTP_PASSWORD;\r
+                       $this->SMTPAuth = true;\r
+                       $this->Username = SMTP_LOGIN;\r
+                       $this->Password = SMTP_PASSWORD;\r
                        }\r
        }\r
        /*      @brief a simple mail function to send email using the defaults\r
index 39f753cc04ac47f4270f6bd907886256e0127a0e..6166f01c11f4266d0ef58c3a56d56a4a3d5bb8b0 100644 (file)
@@ -26,6 +26,7 @@ function emailArticle(id) {
                                        new Ajax.Request("backend.php", {
                                                parameters: dojo.objectToQuery(this.attr('value')),
                                                onComplete: function(transport) {
+                                                       console.log(transport.responseText);
 
                                                        var reply = JSON.parse(transport.responseText);