diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-05-23 21:03:25 +0200 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-05-23 21:57:41 +0200 |
commit | abe338f4335ad4a4f0b6211b032e48f80962292f (patch) | |
tree | 6f7fea30995d1bb02e9f677b0dd7d480aa2b96dd /lib/private/Files/Mount | |
parent | e03e4921a01cd2b01e10db7b5d7bd39dd0224b0b (diff) | |
download | nextcloud-server-abe338f4335ad4a4f0b6211b032e48f80962292f.tar.gz nextcloud-server-abe338f4335ad4a4f0b6211b032e48f80962292f.zip |
Store user bucket in preferences
Diffstat (limited to 'lib/private/Files/Mount')
-rw-r--r-- | lib/private/Files/Mount/ObjectHomeMountProvider.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/private/Files/Mount/ObjectHomeMountProvider.php b/lib/private/Files/Mount/ObjectHomeMountProvider.php index 6903a5fd101..f82313879dc 100644 --- a/lib/private/Files/Mount/ObjectHomeMountProvider.php +++ b/lib/private/Files/Mount/ObjectHomeMountProvider.php @@ -108,15 +108,23 @@ class ObjectHomeMountProvider implements IHomeMountProvider { } $config['arguments']['user'] = $user; - /* - * Use any provided bucket argument as prefix - * and add the mapping from username => bucket - */ - if (!isset($config['arguments']['bucket'])) { - $config['arguments']['bucket'] = ''; + $bucket = $this->config->getUserValue($user->getUID(), 'homeobjectstore', 'bucket', null); + + if ($bucket === null) { + /* + * Use any provided bucket argument as prefix + * and add the mapping from username => bucket + */ + if (!isset($config['arguments']['bucket'])) { + $config['arguments']['bucket'] = ''; + } + $mapper = new \OC\Files\ObjectStore\Mapper($user); + $config['arguments']['bucket'] .= $mapper->getBucket(); + + $this->config->setUserValue($user->getUID(), 'homeobjectstore', 'bucket', $config['arguments']['bucket']); + } else { + $config['arguments']['bucket'] = $bucket; } - $mapper = new \OC\Files\ObjectStore\Mapper($user); - $config['arguments']['bucket'] .= $mapper->getBucket(); // instantiate object store implementation $config['arguments']['objectstore'] = new $config['class']($config['arguments']); |