X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fapi.php;h=406ef26c1c76adf22993b14e27da1badd1c87bb8;hb=6cef88c24ead66ed59d7fde4b9f975714c0ddddc;hp=67564836e8386b6a58abadc2d4fd51999fe5edbe;hpb=4d21671f75e35e7c2880467dddc0936e8c718d8c;p=friendica.git diff --git a/mod/api.php b/mod/api.php index 67564836e8..406ef26c1c 100644 --- a/mod/api.php +++ b/mod/api.php @@ -1,8 +1,10 @@ get_parameters(); $token = $params['oauth_token']; @@ -12,15 +14,14 @@ function oauth_get_client($request){ AND `tokens`.`id`='%s' AND `tokens`.`scope`='request'", dbesc($token)); - if (!count($r)) + if (!dbm::is_result($r)) return null; return $r[0]; } -} -if(! function_exists('api_post')) { function api_post(&$a) { + if(! local_user()) { notice( t('Permission denied.') . EOL); return; @@ -30,10 +31,9 @@ function api_post(&$a) { notice( t('Permission denied.') . EOL); return; } -} + } -if(! function_exists('api_content')) { function api_content(&$a) { if ($a->cmd=='api/oauth/authorize'){ /* @@ -114,4 +114,3 @@ function api_content(&$a) { echo api_call($a); killme(); } -}