Skip to content
Snippets Groups Projects
Commit 2bf7e5c0 authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

make objectstore setup more robust, don't pass user to object store mounted as root

parent 3c66a8c8
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ class OC_Util { ...@@ -74,7 +74,7 @@ class OC_Util {
//check if we are using an object storage //check if we are using an object storage
$object_storage = OC_Config::getValue( '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); self::initObjectStorageRootFS($object_storage);
} else { } else {
self::initLocalStorageRootFS(); self::initLocalStorageRootFS();
...@@ -96,10 +96,12 @@ class OC_Util { ...@@ -96,10 +96,12 @@ class OC_Util {
if ($storage->instanceOfStorage('\OC\Files\Storage\Home') if ($storage->instanceOfStorage('\OC\Files\Storage\Home')
|| $storage->instanceOfStorage('\OCA\ObjectStore\AbstractObjectStore') // FIXME introduce interface \OC\Files\Storage\HomeStorage? or add method? || $storage->instanceOfStorage('\OCA\ObjectStore\AbstractObjectStore') // FIXME introduce interface \OC\Files\Storage\HomeStorage? or add method?
) { ) {
$user = $storage->getUser()->getUID(); if (is_object($storage->getUser())) {
$quota = OC_Util::getUserQuota($user); $user = $storage->getUser()->getUID();
if ($quota !== \OC\Files\SPACE_UNLIMITED) { $quota = OC_Util::getUserQuota($user);
return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files')); if ($quota !== \OC\Files\SPACE_UNLIMITED) {
return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files'));
}
} }
} }
......
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