/**
* @file mod/api.php
*/
+
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
-use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Module\Login;
-require_once 'include/api.php';
+require_once __DIR__ . '/../include/api.php';
-function oauth_get_client($request)
+function oauth_get_client(OAuthRequest $request)
{
-
-
$params = $request->get_parameters();
$token = $params['oauth_token'];
return;
}
- if (count($a->user) && x($a->user, 'uid') && $a->user['uid'] != local_user()) {
+ if (count($a->user) && !empty($a->user['uid']) && $a->user['uid'] != local_user()) {
notice(L10n::t('Permission denied.') . EOL);
return;
}
} catch (Exception $e) {
echo "<pre>";
var_dump($e);
- killme();
+ exit();
}
- if (x($_POST, 'oauth_yes')) {
+ if (!empty($_POST['oauth_yes'])) {
$app = oauth_get_client($request);
if (is_null($app)) {
return "Invalid request. Unknown token.";
$glue = "?";
}
$a->internalRedirect($consumer->callback_url . $glue . 'oauth_token=' . OAuthUtil::urlencode_rfc3986($params['oauth_token']) . '&oauth_verifier=' . OAuthUtil::urlencode_rfc3986($verifier));
- killme();
+ exit();
}
$tpl = Renderer::getMarkupTemplate("oauth_authorize_done.tpl");
}
echo api_call($a);
- killme();
+ exit();
}