diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-06-10 18:15:07 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-06-18 12:53:19 +0200 |
commit | 2bf7e5c02fc668ad15eab54d5303ae45b616120b (patch) | |
tree | c35007645877a10bf865f02b762a2231163f85cf /lib/private/util.php | |
parent | 3c66a8c8ed7113754a8e7f449a1a51bb08192b1a (diff) | |
download | nextcloud-server-2bf7e5c02fc668ad15eab54d5303ae45b616120b.tar.gz nextcloud-server-2bf7e5c02fc668ad15eab54d5303ae45b616120b.zip |
make objectstore setup more robust, don't pass user to object store mounted as root
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-x | lib/private/util.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index 5e019bf90b6..bb76b423843 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -74,7 +74,7 @@ class OC_Util { //check if we are using an object storage $object_storage = OC_Config::getValue( 'object_storage' ); - if ( isset( $object_storage ) ) { + if ( isset( $object_storage ) && OC_App::isEnabled('objectstore') ) { self::initObjectStorageRootFS($object_storage); } else { self::initLocalStorageRootFS(); @@ -96,10 +96,12 @@ class OC_Util { if ($storage->instanceOfStorage('\OC\Files\Storage\Home') || $storage->instanceOfStorage('\OCA\ObjectStore\AbstractObjectStore') // FIXME introduce interface \OC\Files\Storage\HomeStorage? or add method? ) { - $user = $storage->getUser()->getUID(); - $quota = OC_Util::getUserQuota($user); - if ($quota !== \OC\Files\SPACE_UNLIMITED) { - return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files')); + if (is_object($storage->getUser())) { + $user = $storage->getUser()->getUID(); + $quota = OC_Util::getUserQuota($user); + if ($quota !== \OC\Files\SPACE_UNLIMITED) { + return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files')); + } } } |