Skip to content
Snippets Groups Projects
Commit c9045043 authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Remove root option from Google Drive storage, because it is only used for...

Remove root option from Google Drive storage, because it is only used for testing and we have our own empty Google account for testing
parent 00e2b460
No related branches found
No related tags found
No related merge requests found
......@@ -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)) {
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment