X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Frequesttoken.php;h=e095161a7d01bf988604faba3ab9356f053bf191;hb=fe5f55cc24d23848644af2ff212292e96545b940;hp=731d260ffd2b36ca5d7314373f409bb931eecd1b;hpb=2fe978e1bb044a2ba8920156184dee7bb57c728b;p=quix0rs-gnu-social.git diff --git a/actions/requesttoken.php b/actions/requesttoken.php index 731d260ffd..e095161a7d 100644 --- a/actions/requesttoken.php +++ b/actions/requesttoken.php @@ -1,7 +1,19 @@ + * @author Robin Millette + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,11 +29,52 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} + +require_once INSTALLDIR.'/lib/omb.php'; +require_once INSTALLDIR.'/extlib/libomb/service_provider.php'; + +/** + * Request token action class. + * + * @category Action + * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + */ +class RequesttokenAction extends Action +{ + /** + * Is read only? + * + * @return boolean false + */ + function isReadOnly() + { + return false; + } -class RequesttokenAction extends Action { - function handle($args) { - parent::handle($args); - common_server_error(_t('Not yet implemented.')); - } + /** + * Class handler. + * + * @param array $args array of arguments + * + * @return void + */ + function handle($args) + { + parent::handle($args); + try { + $srv = new OMB_Service_Provider(null, omb_oauth_datastore(), + omb_oauth_server()); + $srv->writeRequestToken(); + } catch (Exception $e) { + $this->serverError($e->getMessage()); + } + } } +?>