diff options
author | Andrew Dolgov <[email protected]> | 2011-12-21 08:46:39 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-12-21 08:50:37 +0400 |
commit | 1baac2803c1dee2fc2005c1039d349f4759d20e3 (patch) | |
tree | fd0594b0c7ff9e7032e6ee09c3ed85d3ce4ee11d /classes/rpc.php | |
parent | 8e70d965a8e60aecd17073f71e9646bb0f6a4839 (diff) |
add mail and share plugins
Diffstat (limited to 'classes/rpc.php')
-rw-r--r-- | classes/rpc.php | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/classes/rpc.php b/classes/rpc.php index 45915b9dc..55ea05da9 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -563,78 +563,6 @@ class RPC extends Protected_Handler { print json_encode(array("message" => "UPDATE_COUNTERS")); } - function sendEmail() { - $secretkey = $_REQUEST['secretkey']; - - require_once 'lib/phpmailer/class.phpmailer.php'; - - $reply = array(); - - if ($_SESSION['email_secretkey'] && - $secretkey == $_SESSION['email_secretkey']) { - - $_SESSION['email_secretkey'] = ''; - - $destination = $_REQUEST['destination']; - $subject = $_REQUEST['subject']; - $content = $_REQUEST['content']; - - $replyto = strip_tags($_SESSION['email_replyto']); - $fromname = strip_tags($_SESSION['email_fromname']); - - $mail = new PHPMailer(); - - $mail->PluginDir = "lib/phpmailer/"; - $mail->SetLanguage("en", "lib/phpmailer/language/"); - - $mail->CharSet = "UTF-8"; - - $mail->From = $replyto; - $mail->FromName = $fromname; - $mail->AddAddress($destination); - - if (SMTP_HOST) { - $mail->Host = SMTP_HOST; - $mail->Mailer = "smtp"; - $mail->SMTPAuth = SMTP_LOGIN != ''; - $mail->Username = SMTP_LOGIN; - $mail->Password = SMTP_PASSWORD; - } - - $mail->IsHTML(false); - $mail->Subject = $subject; - $mail->Body = $content; - - $rc = $mail->Send(); - - if (!$rc) { - $reply['error'] = $mail->ErrorInfo; - } else { - save_email_address($this->link, db_escape_string($destination)); - $reply['message'] = "UPDATE_COUNTERS"; - } - - } else { - $reply['error'] = "Not authorized."; - } - - print json_encode($reply); - } - - function completeEmails() { - $search = db_escape_string($_REQUEST["search"]); - - print "<ul>"; - - foreach ($_SESSION['stored_emails'] as $email) { - if (strpos($email, $search) !== false) { - print "<li>$email</li>"; - } - } - - print "</ul>"; - } - function quickAddCat() { $cat = db_escape_string($_REQUEST["cat"]); |