diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-11-30 16:27:11 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-11-30 16:27:11 +0100 |
commit | 92df70b6e5c4cba373cf0b24af02c328881cdd2d (patch) | |
tree | caa914884d58cb9118330c3823c4525c7dfd65cf /apps/files_external/ajax/google.php | |
parent | df21ebeaf73bed10e972af6ef09f2bfb0df68e1c (diff) | |
download | nextcloud-server-92df70b6e5c4cba373cf0b24af02c328881cdd2d.tar.gz nextcloud-server-92df70b6e5c4cba373cf0b24af02c328881cdd2d.zip |
fix checkstyle for files_external app, add whitespace for readability
Diffstat (limited to 'apps/files_external/ajax/google.php')
-rw-r--r-- | apps/files_external/ajax/google.php | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/apps/files_external/ajax/google.php b/apps/files_external/ajax/google.php index 4cd01c06cc9..c76c7618e4d 100644 --- a/apps/files_external/ajax/google.php +++ b/apps/files_external/ajax/google.php @@ -14,7 +14,9 @@ if (isset($_POST['step'])) { } else { $callback = null; } - $scope = 'https://docs.google.com/feeds/ https://docs.googleusercontent.com/ https://spreadsheets.google.com/feeds/'; + $scope = 'https://docs.google.com/feeds/' + .' https://docs.googleusercontent.com/' + .' https://spreadsheets.google.com/feeds/'; $url = 'https://www.google.com/accounts/OAuthGetRequestToken?scope='.urlencode($scope); $params = array('scope' => $scope, 'oauth_callback' => $callback); $request = OAuthRequest::from_consumer_and_token($consumer, null, 'GET', $url, $params); @@ -24,24 +26,35 @@ if (isset($_POST['step'])) { parse_str($response, $token); if (isset($token['oauth_token']) && isset($token['oauth_token_secret'])) { $authUrl = 'https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token='.$token['oauth_token']; - OCP\JSON::success(array('data' => array('url' => $authUrl, 'request_token' => $token['oauth_token'], 'request_token_secret' => $token['oauth_token_secret']))); + OCP\JSON::success(array('data' => array('url' => $authUrl, + 'request_token' => $token['oauth_token'], + 'request_token_secret' => $token['oauth_token_secret']))); } else { - OCP\JSON::error(array('data' => array('message' => 'Fetching request tokens failed. Error: '.$response))); + OCP\JSON::error(array('data' => array( + 'message' => 'Fetching request tokens failed. Error: '.$response + ))); } break; case 2: - if (isset($_POST['oauth_verifier']) && isset($_POST['request_token']) && isset($_POST['request_token_secret'])) { + if (isset($_POST['oauth_verifier']) + && isset($_POST['request_token']) + && isset($_POST['request_token_secret']) + ) { $token = new OAuthToken($_POST['request_token'], $_POST['request_token_secret']); $url = 'https://www.google.com/accounts/OAuthGetAccessToken'; - $request = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $url, array('oauth_verifier' => $_POST['oauth_verifier'])); + $request = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $url, + array('oauth_verifier' => $_POST['oauth_verifier'])); $request->sign_request($sigMethod, $consumer, $token); $response = send_signed_request('GET', $url, array($request->to_header()), null, false); $token = array(); parse_str($response, $token); if (isset($token['oauth_token']) && isset($token['oauth_token_secret'])) { - OCP\JSON::success(array('access_token' => $token['oauth_token'], 'access_token_secret' => $token['oauth_token_secret'])); + OCP\JSON::success(array('access_token' => $token['oauth_token'], + 'access_token_secret' => $token['oauth_token_secret'])); } else { - OCP\JSON::error(array('data' => array('message' => 'Fetching access tokens failed. Error: '.$response))); + OCP\JSON::error(array('data' => array( + 'message' => 'Fetching access tokens failed. Error: '.$response + ))); } } break; |