aboutsummaryrefslogtreecommitdiffstats
path: root/mod/post.php
diff options
context:
space:
mode:
authorOlivier Migeot <olivier@migeot.org>2011-10-04 11:45:57 +0200
committerOlivier Migeot <olivier@migeot.org>2011-10-04 11:45:57 +0200
commit273594af62c960b5a52da5ec1cf6d6bd450415ba (patch)
tree5f79914d28c343f7642ecb13b99f9e0e3f5090a7 /mod/post.php
parent1548449586f17c0ef9bfab0ffb16f2a495fc6082 (diff)
parentdfd5cc57c2134067dc6229b8583b5e808f160004 (diff)
downloadvolse-hubzilla-273594af62c960b5a52da5ec1cf6d6bd450415ba.tar.gz
volse-hubzilla-273594af62c960b5a52da5ec1cf6d6bd450415ba.tar.bz2
volse-hubzilla-273594af62c960b5a52da5ec1cf6d6bd450415ba.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'mod/post.php')
-rw-r--r--mod/post.php51
1 files changed, 51 insertions, 0 deletions
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 @@
+<?php
+
+/**
+ * Zot endpoint
+ */
+
+
+require_once('include/salmon.php');
+require_once('include/crypto.php');
+// not yet ready for prime time
+//require_once('include/zot.php');
+
+function post_post(&$a) {
+
+ $bulk_delivery = false;
+
+ if($a->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
+}
+