1
1
Fork 0

Move xml_status and http_status_exit

move functions
This commit is contained in:
Adam Magness 2018-01-26 23:37:55 -05:00
commit cd3643d174
18 changed files with 87 additions and 85 deletions

View file

@ -8,12 +8,13 @@ use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Protocol\PortableContact;
use Friendica\Util\Network;
function poco_init(App $a) {
$system_mode = false;
if (intval(Config::get('system', 'block_public')) || (Config::get('system', 'block_local_dir'))) {
http_status_exit(401);
Network::httpStatusExit(401);
}
if ($a->argc > 1) {
@ -22,7 +23,7 @@ function poco_init(App $a) {
if (! x($user)) {
$c = q("SELECT * FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1");
if (! DBM::is_result($c)) {
http_status_exit(401);
Network::httpStatusExit(401);
}
$system_mode = true;
}
@ -63,7 +64,7 @@ function poco_init(App $a) {
dbesc($user)
);
if (! DBM::is_result($users) || $users[0]['hidewall'] || $users[0]['hide-friends']) {
http_status_exit(404);
Network::httpStatusExit(404);
}
$user = $users[0];
@ -357,7 +358,7 @@ function poco_init(App $a) {
$ret['entry'][] = [];
}
} else {
http_status_exit(500);
Network::httpStatusExit(500);
}
logger("End of poco", LOGGER_DEBUG);
@ -371,6 +372,6 @@ function poco_init(App $a) {
echo json_encode($ret);
killme();
} else {
http_status_exit(500);
Network::httpStatusExit(500);
}
}