mirror of
https://github.com/friendica/friendica
synced 2025-04-27 13:10:10 +00:00
Move functions to system
move some functions to system
This commit is contained in:
parent
f04d40a37e
commit
9b8599b619
21 changed files with 169 additions and 169 deletions
|
@ -6,9 +6,9 @@
|
|||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
/**
|
||||
* @param object $a App
|
||||
|
@ -19,7 +19,7 @@ function receive_post(App $a)
|
|||
$enabled = intval(Config::get('system', 'diaspora_enabled'));
|
||||
if (!$enabled) {
|
||||
logger('mod-diaspora: disabled');
|
||||
Network::httpStatusExit(500);
|
||||
System::httpExit(500);
|
||||
}
|
||||
|
||||
if (($a->argc == 2) && ($a->argv[1] === 'public')) {
|
||||
|
@ -29,13 +29,13 @@ function receive_post(App $a)
|
|||
$public = false;
|
||||
|
||||
if ($a->argc != 3 || $a->argv[1] !== 'users') {
|
||||
Network::httpStatusExit(500);
|
||||
System::httpExit(500);
|
||||
}
|
||||
$guid = $a->argv[2];
|
||||
|
||||
$importer = dba::selectFirst('user', [], ['guid' => $guid, 'account_expired' => false, 'account_removed' => false]);
|
||||
if (!DBM::is_result($importer)) {
|
||||
Network::httpStatusExit(500);
|
||||
System::httpExit(500);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ function receive_post(App $a)
|
|||
if (!$xml) {
|
||||
$postdata = file_get_contents("php://input");
|
||||
if ($postdata == '') {
|
||||
Network::httpStatusExit(500);
|
||||
System::httpExit(500);
|
||||
}
|
||||
|
||||
logger('mod-diaspora: message is in the new format', LOGGER_DEBUG);
|
||||
|
@ -68,7 +68,7 @@ function receive_post(App $a)
|
|||
logger('mod-diaspora: decoded msg: ' . print_r($msg, true), LOGGER_DATA);
|
||||
|
||||
if (!is_array($msg)) {
|
||||
Network::httpStatusExit(500);
|
||||
System::httpExit(500);
|
||||
}
|
||||
|
||||
logger('mod-diaspora: dispatching', LOGGER_DEBUG);
|
||||
|
@ -80,6 +80,6 @@ function receive_post(App $a)
|
|||
$ret = Diaspora::dispatch($importer, $msg);
|
||||
}
|
||||
|
||||
Network::httpStatusExit(($ret) ? 200 : 500);
|
||||
System::httpExit(($ret) ? 200 : 500);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue