$this->lat = $this->trimmed('lat');
$this->lon = $this->trimmed('long');
+ // try to set the source attr from OAuth app
+ if (empty($this->source)) {
+ $this->source = $this->oauth_source;
+ }
+
if (empty($this->source) || in_array($this->source, self::$reserved_sources)) {
$this->source = 'api';
}
{
var $access_token;
var $oauth_access_type;
+ var $oauth_source;
/**
* Take arguments for running, and output basic auth header if needed
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()
$req = OAuthRequest::from_request();
$server->verify_request($req);
- common_debug("Good OAuth request!");
-
$app = Oauth_application::getByConsumerKey($this->consumer_key);
if (empty($app)) {
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);