[Pkg-owncloud-commits] [owncloud] 07/273: change 'object_storage' config param to 'root_storage' copy skeleton only for local filesystems
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 85ccfad37c6e46e6b1f80b618fb0dc5ea6c6977e
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date: Wed Jun 11 13:55:11 2014 +0200
change 'object_storage' config param to 'root_storage'
copy skeleton only for local filesystems
---
lib/private/util.php | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/lib/private/util.php b/lib/private/util.php
index bb76b42..c2db9e5 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -29,7 +29,7 @@ class OC_Util {
* TODO make home storage aware of this and use the object storage instead of local disk access
* @param array $config containing 'class' and optional 'arguments'
*/
- private static function initObjectStorageRootFS($config) {
+ private static function initObjectStoreRootFS($config) {
// check misconfiguration
if (empty($config['class'])) {
//FIXME log error?
@@ -73,9 +73,9 @@ class OC_Util {
}
//check if we are using an object storage
- $object_storage = OC_Config::getValue( 'object_storage' );
- if ( isset( $object_storage ) && OC_App::isEnabled('objectstore') ) {
- self::initObjectStorageRootFS($object_storage);
+ $root_storage = OC_Config::getValue( 'root_storage' );
+ if ( isset( $root_storage ) ) {
+ self::initObjectStoreRootFS($root_storage);
} else {
self::initLocalStorageRootFS();
}
@@ -94,7 +94,7 @@ class OC_Util {
* @var \OC\Files\Storage\Storage $storage
*/
if ($storage->instanceOfStorage('\OC\Files\Storage\Home')
- || $storage->instanceOfStorage('\OCA\ObjectStore\AbstractObjectStore') // FIXME introduce interface \OC\Files\Storage\HomeStorage? or add method?
+ || $storage->instanceOfStorage('\OC\Files\ObjectStore\AbstractObjectStore')
) {
if (is_object($storage->getUser())) {
$user = $storage->getUser()->getUID();
@@ -109,12 +109,17 @@ class OC_Util {
});
$userDir = '/'.$user.'/files';
- $userRoot = OC_User::getHome($user);
- $userDirectory = $userRoot . '/files';
- if( !is_dir( $userDirectory )) {
- mkdir( $userDirectory, 0755, true );
- OC_Util::copySkeleton($userDirectory);
+
+ //autocreate users "home" directory for local storage only
+ if ( ! isset( $root_storage ) ) {
+ $userRoot = OC_User::getHome($user);
+ $userDirectory = $userRoot . '/files';
+ if( !is_dir( $userDirectory )) {
+ mkdir( $userDirectory, 0755, true );
+ OC_Util::copySkeleton($userDirectory);
+ }
}
+
//jail the user into his "home" directory
\OC\Files\Filesystem::init($user, $userDir);
--
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