Move functions to system

move some functions to system
This commit is contained in:
Adam Magness
2018-01-27 11:59:10 -05:00
parent f04d40a37e
commit 9b8599b619
21 changed files with 169 additions and 169 deletions

View File

@@ -4,12 +4,12 @@
*/
use Friendica\App;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Protocol\OStatus;
use Friendica\Protocol\Salmon;
use Friendica\Util\Crypto;
use Friendica\Util\Network;
require_once 'include/items.php';
@@ -39,7 +39,7 @@ function salmon_post(App $a) {
dbesc($nick)
);
if (! DBM::is_result($r)) {
Network::httpStatusExit(500);
System::httpExit(500);
}
$importer = $r[0];
@@ -59,7 +59,7 @@ function salmon_post(App $a) {
if(! $base) {
logger('mod-salmon: unable to locate salmon data in xml ');
Network::httpStatusExit(400);
System::httpExit(400);
}
// Stash the signature away for now. We have to find their key or it won't be good for anything.
@@ -97,7 +97,7 @@ function salmon_post(App $a) {
if(! $author_link) {
logger('mod-salmon: Could not retrieve author URI.');
Network::httpStatusExit(400);
System::httpExit(400);
}
// Once we have the author URI, go to the web and try to find their public key
@@ -108,7 +108,7 @@ function salmon_post(App $a) {
if(! $key) {
logger('mod-salmon: Could not retrieve author key.');
Network::httpStatusExit(400);
System::httpExit(400);
}
$key_info = explode('.',$key);
@@ -140,7 +140,7 @@ function salmon_post(App $a) {
if (! $verify) {
logger('mod-salmon: Message did not verify. Discarding.');
Network::httpStatusExit(400);
System::httpExit(400);
}
logger('mod-salmon: Message verified with mode '.$mode);
@@ -184,7 +184,7 @@ function salmon_post(App $a) {
//if((DBM::is_result($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) {
if (DBM::is_result($r) && $r[0]['blocked']) {
logger('mod-salmon: Ignoring this author.');
Network::httpStatusExit(202);
System::httpExit(202);
// NOTREACHED
}
@@ -195,5 +195,5 @@ function salmon_post(App $a) {
OStatus::import($data, $importer, $contact_rec, $hub);
Network::httpStatusExit(200);
System::httpExit(200);
}