From 585b39e1b208f26bcaf32e307c8fd101e70ddc02 Mon Sep 17 00:00:00 2001 From: Thom Seddon Date: Thu, 29 Nov 2012 18:12:59 +0000 Subject: [PATCH] Clean up indentation > > Various text editor switches later I noticed that indentation had become slightly irregular in some places. > I have cleaned up all space based indentation in favour of tabs (Cake style) --- Controller/Component/OAuthComponent.php | 82 ++++++++++++------------- Controller/OAuthAppController.php | 2 +- Model/OAuthAppModel.php | 3 +- 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/Controller/Component/OAuthComponent.php b/Controller/Component/OAuthComponent.php index 0ebb1f2..b32f625 100644 --- a/Controller/Component/OAuthComponent.php +++ b/Controller/Component/OAuthComponent.php @@ -78,9 +78,9 @@ class OAuthComponent extends Component implements IOAuth2Storage, IOAuth2Refresh * @var array */ protected $_authDefaults = array( - 'userModel' => 'User', - 'fields' => array('username' => 'username', 'password' => 'password') - ); + 'userModel' => 'User', + 'fields' => array('username' => 'username', 'password' => 'password') + ); /** * AuthCode object. @@ -179,8 +179,8 @@ public function startup(Controller $controller) { $this->authenticate = Hash::merge($this->_authDefaults, $this->authenticate); $this->User = ClassRegistry::init(array( - 'class' => $this->authenticate['userModel'], - 'alias' => $this->authenticate['userModel'] + 'class' => $this->authenticate['userModel'], + 'alias' => $this->authenticate['userModel'] )); $isMissingAction = ( @@ -297,13 +297,13 @@ public function deny($action = null) { public function user($field = null, $token = null) { if (!$this->_user) { $this->AccessToken->bindModel(array( - 'belongsTo' => array( + 'belongsTo' => array( 'User' => array( - 'className' => $this->authenticate['userModel'], - 'foreignKey' => 'user_id' - ) + 'className' => $this->authenticate['userModel'], + 'foreignKey' => 'user_id' + ) ) - )); + )); $token = empty($token) ? $this->getBearerToken() : $token; $data = $this->AccessToken->find('first', array( 'conditions' => array('oauth_token' => self::hash($token)), @@ -403,8 +403,8 @@ public function checkClientCredentials($client_id, $client_secret = NULL) { $conditions['client_secret'] = self::hash($client_secret); } $client = $this->Client->find('first', array( - 'conditions' => $conditions, - 'recursive' => -1 + 'conditions' => $conditions, + 'recursive' => -1 )); if ($client){ return $client['Client']; @@ -423,9 +423,9 @@ public function checkClientCredentials($client_id, $client_secret = NULL) { */ public function getClientDetails($client_id) { $client = $this->Client->find('first', array( - 'conditions' => array('client_id' => $client_id), - 'fields' => array('client_id', 'redirect_uri'), - 'recursive' => -1 + 'conditions' => array('client_id' => $client_id), + 'fields' => array('client_id', 'redirect_uri'), + 'recursive' => -1 )); if ($client) { return $client['Client']; @@ -444,8 +444,8 @@ public function getClientDetails($client_id) { */ public function getAccessToken($oauth_token) { $accessToken = $this->AccessToken->find('first', array( - 'conditions' => array('oauth_token' => self::hash($oauth_token)), - 'recursive' => -1, + 'conditions' => array('oauth_token' => self::hash($oauth_token)), + 'recursive' => -1, )); if ($accessToken) { return $accessToken['AccessToken']; @@ -467,11 +467,11 @@ public function getAccessToken($oauth_token) { */ public function setAccessToken($oauth_token, $client_id, $user_id, $expires, $scope = NULL) { $data = array( - 'oauth_token' => $oauth_token, - 'client_id' => $client_id, - 'user_id' => $user_id, - 'expires' => $expires, - 'scope' => $scope + 'oauth_token' => $oauth_token, + 'client_id' => $client_id, + 'user_id' => $user_id, + 'expires' => $expires, + 'scope' => $scope ); $this->AccessToken->create(); return $this->AccessToken->save(array('AccessToken' => $data)); @@ -500,8 +500,8 @@ public function checkRestrictedGrantType($client_id, $grant_type) { */ public function getRefreshToken($refresh_token) { $refreshToken = $this->RefreshToken->find('first', array( - 'conditions' => array('refresh_token' => self::hash($refresh_token)), - 'recursive' => -1 + 'conditions' => array('refresh_token' => self::hash($refresh_token)), + 'recursive' => -1 )); if ($refreshToken) { return $refreshToken['RefreshToken']; @@ -524,11 +524,11 @@ public function getRefreshToken($refresh_token) { */ public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $scope = NULL) { $data = array( - 'refresh_token' => $refresh_token, - 'client_id' => $client_id, - 'user_id' => $user_id, - 'expires' => $expires, - 'scope' => $scope + 'refresh_token' => $refresh_token, + 'client_id' => $client_id, + 'user_id' => $user_id, + 'expires' => $expires, + 'scope' => $scope ); $this->RefreshToken->create(); return $this->RefreshToken->save(array('RefreshToken' => $data)); @@ -557,11 +557,11 @@ public function unsetRefreshToken($refresh_token) { */ public function checkUserCredentials($client_id, $username, $password) { $user = $this->User->find('first', array( - 'conditions' => array( - $this->authenticate['fields']['username'] => $username, - $this->authenticate['fields']['password'] => AuthComponent::password($password) + 'conditions' => array( + $this->authenticate['fields']['username'] => $username, + $this->authenticate['fields']['password'] => AuthComponent::password($password) ), - 'recursive' => -1 + 'recursive' => -1 )); if ($user) { return array('user_id' => $user['User'][$this->User->primaryKey]); @@ -579,8 +579,8 @@ public function checkUserCredentials($client_id, $username, $password) { */ public function getAuthCode($code) { $authCode = $this->AuthCode->find('first', array( - 'conditions' => array('code' => self::hash($code)), - 'recursive' => -1 + 'conditions' => array('code' => self::hash($code)), + 'recursive' => -1 )); if ($authCode) { return $authCode['AuthCode']; @@ -603,12 +603,12 @@ public function getAuthCode($code) { */ public function setAuthCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = NULL) { $data = array( - 'code' => $code, - 'client_id' => $client_id, - 'user_id' => $user_id, - 'redirect_uri' => $redirect_uri, - 'expires' => $expires, - 'scope' => $scope + 'code' => $code, + 'client_id' => $client_id, + 'user_id' => $user_id, + 'redirect_uri' => $redirect_uri, + 'expires' => $expires, + 'scope' => $scope ); $this->AuthCode->create(); return $this->AuthCode->save(array('AuthCode' => $data)); diff --git a/Controller/OAuthAppController.php b/Controller/OAuthAppController.php index 1e9b1d2..24136b9 100644 --- a/Controller/OAuthAppController.php +++ b/Controller/OAuthAppController.php @@ -11,7 +11,7 @@ * @author Thom */ class OAuthAppController extends AppController { - //put your code here + //put your code here } ?> diff --git a/Model/OAuthAppModel.php b/Model/OAuthAppModel.php index 1de60c6..f284630 100644 --- a/Model/OAuthAppModel.php +++ b/Model/OAuthAppModel.php @@ -1,13 +1,12 @@