diff options
author | Zach Copley <zach@status.net> | 2010-01-14 02:38:01 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-01-25 00:51:56 +0000 |
commit | 4daf76212a6802863d20c6af7597eddded227ae8 (patch) | |
tree | 7a065690f11c3e9793b3c0b93e179448c30289b7 /lib | |
parent | 8b24b5ac7bea2098d3c85e342526c2102e2a6fb9 (diff) |
- Had to remove checking read vs. read-write in OAuth authenticated methods
- Will now pick up source attr from OAuth app
Diffstat (limited to 'lib')
-rw-r--r-- | lib/apiauth.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/apiauth.php b/lib/apiauth.php index f513ed2c9..37070d212 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -55,6 +55,7 @@ class ApiAuthAction extends ApiAction { var $access_token; var $oauth_access_type; + var $oauth_source; /** * Take arguments for running, and output basic auth header if needed @@ -90,13 +91,6 @@ class ApiAuthAction extends ApiAction function handle($args) { parent::handle($args); - - if ($this->isReadOnly($args) == false) { - if ($this->access == self::READ_ONLY) { - $this->clientError(_('API method requires write access.'), 401); - exit(); - } - } } function checkOAuthRequest() @@ -116,8 +110,6 @@ class ApiAuthAction extends ApiAction $req = OAuthRequest::from_request(); $server->verify_request($req); - common_debug("Good OAuth request!"); - $app = Oauth_application::getByConsumerKey($this->consumer_key); if (empty($app)) { @@ -129,6 +121,10 @@ class ApiAuthAction extends ApiAction throw new OAuthException('No application for that consumer key.'); } + // set the source attr + + $this->oauth_source = $app->name; + $appUser = Oauth_application_user::staticGet('token', $this->access_token); |