From 116fc7fcf216c5f962bc9c2238a9d6a3a21e436f Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 26 Sep 2011 02:25:43 -0700 Subject: zot endpoint --- mod/post.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 mod/post.php (limited to 'mod') diff --git a/mod/post.php b/mod/post.php new file mode 100644 index 000000000..4a7e33b23 --- /dev/null +++ b/mod/post.php @@ -0,0 +1,51 @@ +argc == 1) { + $bulk_delivery = true; + } + else { + $nickname = $a->argv[2]; + $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' + AND `account_expired` = 0 LIMIT 1", + dbesc($nickname) + ); + if(! count($r)) + http_status_exit(500); + + $importer = $r[0]; + } + + $xml = file_get_contents('php://input'); + + logger('mod-post: new zot: ' . $xml, LOGGER_DATA); + + if(! $xml) + http_status_exit(500); + + $msg = zot_decode($importer,$xml); + + logger('mod-post: decoded msg: ' . print_r($msg,true), LOGGER_DATA); + + if(! is_array($msg)) + http_status_exit(500); + + $ret = 0; + $ret = zot_incoming($bulk_delivery, $importer,$msg); + http_status_exit(($ret) ? $ret : 200); + // NOTREACHED +} + -- cgit v1.2.3