summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-03-10 02:25:03 +0100
committerRobin Appelman <icewind@owncloud.com>2013-03-10 02:25:03 +0100
commitbe4806d0314e9b6a4e2487456e4c80b8fac3377b (patch)
tree02220fc51e50adebe0f17ec09ff96b9faeccf980 /lib
parent4763c4616fdbb25fd862bf6e3c03e7f606467eeb (diff)
downloadnextcloud-server-be4806d0314e9b6a4e2487456e4c80b8fac3377b.tar.gz
nextcloud-server-be4806d0314e9b6a4e2487456e4c80b8fac3377b.zip
Store the global mount configuration file in the datadir
Diffstat (limited to 'lib')
-rw-r--r--lib/files/filesystem.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 0bbd7550d74..40fef674a00 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -221,11 +221,16 @@ class Filesystem {
$root = \OC_User::getHome($user);
self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);
+ $datadir = \OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data");
+ //move config file to it's new position
+ if (is_file(\OC::$SERVERROOT . '/config/mount.json')) {
+ rename(\OC::$SERVERROOT . '/config/mount.json', $datadir . '/mount.json');
+ }
// Load system mount points
- if (is_file(\OC::$SERVERROOT . '/config/mount.php') or is_file(\OC::$SERVERROOT . '/config/mount.json')) {
- if (is_file(\OC::$SERVERROOT . '/config/mount.json')) {
- $mountConfig = json_decode(file_get_contents(\OC::$SERVERROOT . '/config/mount.json'), true);
+ if (is_file(\OC::$SERVERROOT . '/config/mount.php') or is_file($datadir . '/mount.json')) {
+ if (is_file($datadir . '/mount.json')) {
+ $mountConfig = json_decode(file_get_contents($datadir . '/mount.json'), true);
} elseif (is_file(\OC::$SERVERROOT . '/config/mount.php')) {
$mountConfig = $parser->parsePHP(file_get_contents(\OC::$SERVERROOT . '/config/mount.php'));
}