]> git.mxchange.org Git - friendica.git/blob - src/Module/Inbox.php
0bc78b030cf3b54eccef48529bc7262c846a558e
[friendica.git] / src / Module / Inbox.php
1 <?php
2 /**
3  * @file src/Module/Inbox.php
4  */
5 namespace Friendica\Module;
6
7 use Friendica\BaseModule;
8 use Friendica\Database\DBA;
9 use Friendica\Model\Contact;
10 use Friendica\Util\HTTPSignature;
11 use Friendica\Util\Network;
12 use Friendica\Core\System;
13
14 /**
15  * ActivityPub Inbox
16  */
17 class Inbox extends BaseModule
18 {
19         public static function init()
20         {
21                 $a = self::getApp();
22
23                 $postdata = file_get_contents('php://input');
24
25                 if (empty($postdata)) {
26                         System::httpExit(400);
27                 }
28
29                 $tempfile = tempnam(get_temppath(), 'activitypub');
30                 file_put_contents($tempfile, json_encode(['header' => $_SERVER, 'body' => $postdata]));
31
32                 System::httpExit(200);
33         }
34 }