[Pkg-owncloud-commits] [owncloud] 06/273: make objectstore setup more robust, don't pass user to object store mounted as root

David Prévot taffit at moszumanska.debian.org
Fri Jul 4 03:12:51 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 2bf7e5c02fc668ad15eab54d5303ae45b616120b
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date:   Tue Jun 10 18:15:07 2014 +0200

    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 5e019bf..bb76b42 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'));
+						}
 					}
 				}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list