summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-29 16:26:09 +0300
committerAndrew Dolgov <[email protected]>2010-11-29 16:26:09 +0300
commit48efad70de1a2f0d4e29f0a8896278b82d70bc2e (patch)
treee931330deaedf4a291e124c8b7ea0021bb323279 /modules
parent0fe841efb91d208b2a348b4849a652ed346357d0 (diff)
rpc/sendEmail: use JSON
Diffstat (limited to 'modules')
-rw-r--r--modules/backend-rpc.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index fe4b6d302..d494cab41 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -668,23 +668,20 @@
}
if ($subop == "catchupFeed") {
-
$feed_id = db_escape_string($_REQUEST['feed_id']);
$is_cat = db_escape_string($_REQUEST['is_cat']);
- print "<rpc-reply>";
-
catchup_feed($link, $feed_id, $is_cat);
- print "</rpc-reply>";
-
return;
}
if ($subop == "sendEmail") {
+ header("Content-Type: text/plain");
+
$secretkey = $_REQUEST['secretkey'];
- print "<rpc-reply>";
+ $reply = array();
if (DIGEST_ENABLE && $_SESSION['email_secretkey'] &&
$secretkey == $_SESSION['email_secretkey']) {
@@ -724,18 +721,17 @@
$rc = $mail->Send();
if (!$rc) {
- print "<error><![CDATA[" . $mail->ErrorInfo . "]]></error>";
+ $reply['error'] = $mail->ErrorInfo;
} else {
save_email_address($link, db_escape_string($destination));
- print "<message>UPDATE_COUNTERS</message>";
+ $reply['message'] = "UPDATE_COUNTERS";
}
} else {
- print "<error>Not authorized.</error>";
+ $reply['error'] = "Not authorized.";
}
- print "</rpc-reply>";
-
+ print json_encode($reply);
return;
}