summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-02-25 15:27:47 +0100
committerVincent Petry <pvince81@owncloud.com>2014-02-25 15:27:47 +0100
commit7f7d674c2af4d4b9202cb55d5edf4965f92d3ab8 (patch)
treefe355a2267897e4d4abe2dc38e76551ae620aa4a
parent9b4af31bac977cb788a6f4a013d32ba0a21437f0 (diff)
parent539ea0882bb8e0ee02d7adaf72109dcbda608d36 (diff)
downloadnextcloud-server-7f7d674c2af4d4b9202cb55d5edf4965f92d3ab8.tar.gz
nextcloud-server-7f7d674c2af4d4b9202cb55d5edf4965f92d3ab8.zip
Merge pull request #7335 from owncloud/fix-7333
Fix code to search for mount.json in custom data folders
-rwxr-xr-xapps/files_external/lib/config.php6
-rw-r--r--lib/private/files/filesystem.php3
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 9a8b95c14c9..43275d36c06 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -359,7 +359,8 @@ class OC_Mount_Config {
$jsonFile = OC_User::getHome(OCP\User::getUser()).'/mount.json';
} else {
$phpFile = OC::$SERVERROOT.'/config/mount.php';
- $jsonFile = \OC_Config::getValue("mount_file", \OC::$SERVERROOT . "/data/mount.json");
+ $datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
+ $jsonFile = \OC_Config::getValue('mount_file', $datadir . '/mount.json');
}
if (is_file($jsonFile)) {
$mountPoints = json_decode(file_get_contents($jsonFile), true);
@@ -385,7 +386,8 @@ class OC_Mount_Config {
if ($isPersonal) {
$file = OC_User::getHome(OCP\User::getUser()).'/mount.json';
} else {
- $file = \OC_Config::getValue("mount_file", \OC::$SERVERROOT . "/data/mount.json");
+ $datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
+ $file = \OC_Config::getValue('mount_file', $datadir . '/mount.json');
}
$content = json_encode($data);
@file_put_contents($file, $content);
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php
index 952f9f9febf..7f7b6f7f468 100644
--- a/lib/private/files/filesystem.php
+++ b/lib/private/files/filesystem.php
@@ -320,7 +320,8 @@ class Filesystem {
else {
self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);
}
- $mount_file = \OC_Config::getValue("mount_file", \OC::$SERVERROOT . "/data/mount.json");
+ $datadir = \OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data");
+ $mount_file = \OC_Config::getValue("mount_file", $datadir . "/mount.json");
//move config file to it's new position
if (is_file(\OC::$SERVERROOT . '/config/mount.json')) {