diff options
author | Adrian Lang <mail@adrianlang.de> | 2009-08-10 14:48:50 +0200 |
---|---|---|
committer | Adrian Lang <mail@adrianlang.de> | 2009-08-10 14:48:50 +0200 |
commit | ec88d2650ea4371cf53229171851747b31587e4b (patch) | |
tree | 00c3cd79bced5a5212fab07a97139c9717e1171f /actions/accesstoken.php | |
parent | ee9bfa715807cdd352407f3d01bc3126dc777b60 (diff) |
Replace own OMB stack with libomb.
Diffstat (limited to 'actions/accesstoken.php')
-rw-r--r-- | actions/accesstoken.php | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/actions/accesstoken.php b/actions/accesstoken.php index 2a8cd1713..dcd04a1b4 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -1,6 +1,6 @@ <?php /** - * Access token class. + * Access token class * * PHP version 5 * @@ -32,10 +32,11 @@ if (!defined('LACONICA')) { exit(1); } +require_once INSTALLDIR.'/extlib/libomb/service_provider.php'; require_once INSTALLDIR.'/lib/omb.php'; /** - * Access token class. + * Access token class * * @category Action * @package Laconica @@ -47,28 +48,23 @@ require_once INSTALLDIR.'/lib/omb.php'; class AccesstokenAction extends Action { /** - * Class handler. + * Class handler * * @param array $args query arguments * - * @return boolean false if user doesn't exist - */ + * @return nothing + * + **/ function handle($args) { parent::handle($args); try { - common_debug('getting request from env variables', __FILE__); - common_remove_magic_from_request(); - $req = OAuthRequest::from_request('POST', common_local_url('accesstoken')); - common_debug('getting a server', __FILE__); - $server = omb_oauth_server(); - common_debug('fetching the access token', __FILE__); - $token = $server->fetch_access_token($req); - common_debug('got this token: "'.print_r($token, true).'"', __FILE__); - common_debug('printing the access token', __FILE__); - print $token; - } catch (OAuthException $e) { + $srv = new OMB_Service_Provider(null, omb_oauth_datastore(), + omb_oauth_server()); + $srv->writeAccessToken(); + } catch (Exception $e) { $this->serverError($e->getMessage()); } } } +?> |