Permalink
Browse files

changed param names for oauth provider calls

  • Loading branch information...
1 parent 596808f commit 9a5a2c351ee3e5826201771566f2d24a20012ef7 @dominikgehl dominikgehl committed Jul 27, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 class.contextio.php
View
@@ -97,23 +97,23 @@ public function listOAuthProviders() {
*/
public function getOAuthProvider($params) {
if (is_string($params)) {
- $params = array('consumer_key' => $params);
+ $params = array('provider_consumer_key' => $params);
}
else {
- $params = $this->_filterParams($params, array('consumer_key'), array('consumer_key'));
+ $params = $this->_filterParams($params, array('provider_consumer_key'), array('provider_consumer_key'));
if ($params === false) {
throw new InvalidArgumentException("params array contains invalid parameters or misses required parameters");
}
}
- return $this->get(null, 'oauth_providers/' . $params['consumer_key']);
+ return $this->get(null, 'oauth_providers/' . $params['provider_consumer_key']);
}
/**
*
* @link http://context.io/docs/2.0/oauthproviders
*/
public function addOAuthProvider($params=array()) {
- $params = $this->_filterParams($params, array('type','consumer_key','consumer_secret'), array('type','consumer_key','consumer_secret'));
+ $params = $this->_filterParams($params, array('type','provider_consumer_key','provider_consumer_secret'), array('type','provider_consumer_key','provider_consumer_secret'));
if ($params === false) {
throw new InvalidArgumentException("params array contains invalid parameters or misses required parameters");
}
@@ -126,15 +126,15 @@ public function addOAuthProvider($params=array()) {
*/
public function deleteOAuthProvider($params) {
if (is_string($params)) {
- $params = array('consumer_key' => $params);
+ $params = array('provider_consumer_key' => $params);
}
else {
- $params = $this->_filterParams($params, array('consumer_key'), array('consumer_key'));
+ $params = $this->_filterParams($params, array('provider_consumer_key'), array('provider_consumer_key'));
if ($params === false) {
throw new InvalidArgumentException("params array contains invalid parameters or misses required parameters");
}
}
- return $this->delete(null, 'oauth_providers/' . $params['consumer_key']);
+ return $this->delete(null, 'oauth_providers/' . $params['provider_consumer_key']);
}
/**

0 comments on commit 9a5a2c3

Please sign in to comment.