*/
function api_search($type)
{
+ $a = get_app();
+ $user_info = api_get_user($a);
+
+ if (api_user() === false || $user_info === false) {
+ throw new ForbiddenException();
+ }
+
$data = [];
$sql_extra = '';
$since_id
);
- $data['status'] = api_format_items(dba::inArray($r), api_get_user(get_app()));
+ $data['status'] = api_format_items(dba::inArray($r), $user_info);
return api_format_data("statuses", $type, $data);
}
function api_statuses_home_timeline($type)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
unset($_REQUEST["screen_name"]);
unset($_GET["screen_name"]);
- $user_info = api_get_user($a);
// get last network messages
// params
function api_statuses_public_timeline($type)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
- $user_info = api_get_user($a);
// get last network messages
// params
function api_statuses_networkpublic_timeline($type)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
- $user_info = api_get_user($a);
-
$since_id = x($_REQUEST, 'since_id') ? $_REQUEST['since_id'] : 0;
$max_id = x($_REQUEST, 'max_id') ? $_REQUEST['max_id'] : 0;
function api_statuses_show($type)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
- $user_info = api_get_user($a);
-
// params
$id = intval($a->argv[3]);
function api_conversation_show($type)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
- $user_info = api_get_user($a);
-
// params
$id = intval($a->argv[3]);
$count = (x($_REQUEST, 'count') ? $_REQUEST['count'] : 20);
function api_statuses_mentions($type)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
unset($_REQUEST["screen_name"]);
unset($_GET["screen_name"]);
- $user_info = api_get_user($a);
// get last network messages
-
// params
$since_id = defaults($_REQUEST, 'since_id', 0);
$max_id = defaults($_REQUEST, 'max_id' , 0);
function api_statuses_user_timeline($type)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
- $user_info = api_get_user($a);
-
logger(
"api_statuses_user_timeline: api_user: ". api_user() .
"\nuser_info: ".print_r($user_info, true) .
global $called_api;
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
$called_api = [];
- $user_info = api_get_user($a);
-
// in friendica starred item are private
// return favorites only for self
logger('api_favorites: self:' . $user_info['self']);
{
$a = get_app();
- if (api_user() === false) {
+ $user_info = api_get_user($a);
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
unset($_REQUEST["screen_name"]);
unset($_GET["screen_name"]);
- $user_info = api_get_user($a);
if (empty($_REQUEST['list_id'])) {
throw new BadRequestException('list_id not specified');
}
function api_direct_messages_box($type, $box, $verbose)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
unset($_REQUEST["screen_name"]);
unset($_GET["screen_name"]);
- $user_info = api_get_user($a);
$profile_url = $user_info["url"];
// pagination
*/
function prepare_photo_data($type, $scale, $photo_id)
{
+ $a = get_app();
+ $user_info = api_get_user($a);
+
+ if ($user_info === false) {
+ throw new ForbiddenException();
+ }
+
$scale_sql = ($scale === false ? "" : sprintf("AND scale=%d", intval($scale)));
$data_sql = ($scale === false ? "" : "data, ");
);
// prepare output of comments
- $commentData = api_format_items($r, api_get_user(get_app()), false, $type);
+ $commentData = api_format_items($r, $user_info, false, $type);
$comments = [];
if ($type == "xml") {
$k = 0;
function api_friendica_notification_seen($type)
{
$a = get_app();
+ $user_info = api_get_user($a);
- if (api_user() === false) {
+ if (api_user() === false || $user_info === false) {
throw new ForbiddenException();
}
if ($a->argc!==4) {
);
if ($r!==false) {
// we found the item, return it to the user
- $user_info = api_get_user($a);
$ret = api_format_items($r, $user_info, false, $type);
$data = ['status' => $ret];
return api_format_data("status", $type, $data);