summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-07-23 10:50:14 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2013-07-23 10:50:14 -0400
commitc904504365b6faa3113c19205e5216dcb81ebb68 (patch)
tree92e708db3511bf395d4c1e2ed910d26007122dea
parent00e2b46017dc7bb83937e2d21a3bf5bcdb91b4e0 (diff)
downloadnextcloud-server-c904504365b6faa3113c19205e5216dcb81ebb68.tar.gz
nextcloud-server-c904504365b6faa3113c19205e5216dcb81ebb68.zip
Remove root option from Google Drive storage, because it is only used for testing and we have our own empty Google account for testing
-rw-r--r--apps/files_external/lib/google.php7
-rw-r--r--apps/files_external/tests/config.php11
2 files changed, 8 insertions, 10 deletions
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 00b3f3c32b6..ef8dd6d8cad 100644
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -53,7 +53,6 @@ class Google extends \OC\Files\Storage\Common {
$client->setUseObjects(true);
$client->setAccessToken($params['token']);
$this->service = new \Google_DriveService($client);
- $this->root = isset($params['root']) ? $params['root'] : '';
$token = json_decode($params['token'], true);
$this->id = 'google::'.substr($params['client_id'], 0, 30).$token['created'];
} else {
@@ -72,7 +71,7 @@ class Google extends \OC\Files\Storage\Common {
*/
private function getDriveFile($path) {
// Remove leading and trailing slashes
- $path = trim($this->root.$path, '/');
+ $path = trim($path, '/');
if (isset($this->driveFiles[$path])) {
return $this->driveFiles[$path];
} else if ($path === '') {
@@ -138,7 +137,7 @@ class Google extends \OC\Files\Storage\Common {
* @param Google_DriveFile|false $file
*/
private function setDriveFile($path, $file) {
- $path = trim($this->root.$path, '/');
+ $path = trim($path, '/');
$this->driveFiles[$path] = $file;
if ($file === false) {
// Set all child paths as false
@@ -205,7 +204,7 @@ class Google extends \OC\Files\Storage\Common {
}
public function rmdir($path) {
- if (trim($this->root.$path, '/') === '') {
+ if (trim($path, '/') === '') {
$dir = $this->opendir($path);
while ($file = readdir($dir)) {
if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php
index bac594b485f..642806f32d7 100644
--- a/apps/files_external/tests/config.php
+++ b/apps/files_external/tests/config.php
@@ -24,12 +24,11 @@ return array(
'root'=>'/owncloud/files/webdav.php',
),
'google'=>array(
- 'run'=>false,
- 'consumer_key'=>'anonymous',
- 'consumer_secret'=>'anonymous',
- 'token'=>'test',
- 'token_secret'=>'test',
- 'root'=>'/google',
+ 'run'=> false,
+ 'configured' => 'true',
+ 'client_id' => '',
+ 'client_secret' => '',
+ 'token' => '',
),
'swift'=>array(
'run'=>false,