exit(1);
}
-require_once INSTALLDIR . '/lib/apioauthstore.php';
+require_once INSTALLDIR . '/lib/apioauth.php';
/**
* Exchange an authorized OAuth request token for an access token
* @link http://status.net/
*/
-class ApiOauthAccessTokenAction extends Action
+class ApiOauthAccessTokenAction extends ApiOauthAction
{
- /**
- * Is read only?
- *
- * @return boolean false
- */
- function isReadOnly()
- {
- return false;
- }
-
/**
* Class handler.
*
$server->add_signature_method($hmac_method);
- $atok = null;
+ $atok = null;
try {
$req = OAuthRequest::from_request();
} catch (OAuthException $e) {
common_log(LOG_WARN, 'API OAuthException - ' . $e->getMessage());
- common_debug(var_export($req, true));
- $this->outputError($e->getMessage());
- return;
+ common_debug(var_export($req, true));
+ $this->outputError($e->getMessage());
+ return;
}
- if (empty($atok)) {
- common_debug('couldn\'t get access token.');
- print "Token exchange failed. Has the request token been authorized?\n";
- } else {
- print $atok;
- }
+ if (empty($atok)) {
+ common_debug('couldn\'t get access token.');
+ print "Token exchange failed. Has the request token been authorized?\n";
+ } else {
+ print $atok;
+ }
}
function outputError($msg)
{
- header('HTTP/1.1 401 Unauthorized');
- header('Content-Type: text/html; charset=utf-8');
- print $msg . "\n";
+ header('HTTP/1.1 401 Unauthorized');
+ header('Content-Type: text/html; charset=utf-8');
+ print $msg . "\n";
}
}