From 2bf7e5c02fc668ad15eab54d5303ae45b616120b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 10 Jun 2014 18:15:07 +0200 Subject: [PATCH] make objectstore setup more robust, don't pass user to object store mounted as root --- lib/private/util.php | 12 +++++++----- 1 file 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')); + } } } -- 2.39.5