diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-14 10:20:00 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-14 10:22:13 -0400 |
commit | 4c7fd8cd0191871e48704f693f48554d4ee7a726 (patch) | |
tree | a66a930783de938deaa3d2362dcf779e5c2b45af /apps/files_external/lib/google.php | |
parent | 64ef1e21819979d7fdc406d2628bc175b16fe554 (diff) | |
parent | 62e4f55f721971dacd06649cecefe0487626aa75 (diff) | |
download | nextcloud-server-4c7fd8cd0191871e48704f693f48554d4ee7a726.tar.gz nextcloud-server-4c7fd8cd0191871e48704f693f48554d4ee7a726.zip |
Merge branch 'master' into share_api
Conflicts:
lib/group.php
lib/group/backend.php
lib/group/database.php
lib/group/interface.php
lib/public/user.php
lib/user.php
lib/user/backend.php
lib/user/database.php
lib/user/interface.php
Diffstat (limited to 'apps/files_external/lib/google.php')
-rw-r--r-- | apps/files_external/lib/google.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index 02c52ffe04c..73317bbf714 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -31,13 +31,17 @@ class OC_Filestorage_Google extends OC_Filestorage_Common { private static $tempFiles = array(); - public function __construct($arguments) { - $consumer_key = isset($arguments['consumer_key']) ? $arguments['consumer_key'] : 'anonymous'; - $consumer_secret = isset($arguments['consumer_secret']) ? $arguments['consumer_secret'] : 'anonymous'; - $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); - $this->oauth_token = new OAuthToken($arguments['token'], $arguments['token_secret']); - $this->sig_method = new OAuthSignatureMethod_HMAC_SHA1(); - $this->entries = array(); + public function __construct($params) { + if (isset($params['configured']) && $params['configured'] == 'true' && isset($params['token']) && isset($params['token_secret'])) { + $consumer_key = isset($params['consumer_key']) ? $params['consumer_key'] : 'anonymous'; + $consumer_secret = isset($params['consumer_secret']) ? $params['consumer_secret'] : 'anonymous'; + $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); + $this->oauth_token = new OAuthToken($params['token'], $params['token_secret']); + $this->sig_method = new OAuthSignatureMethod_HMAC_SHA1(); + $this->entries = array(); + } else { + throw new Exception('Creating OC_Filestorage_Google storage failed'); + } } private function sendRequest($uri, $httpMethod, $postData = null, $extraHeaders = null, $isDownload = false, $returnHeaders = false, $isContentXML = true, $returnHTTPCode = false) { |