From 6cb64a4fced31906938159eb237159cac815ca26 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Thu, 20 Feb 2014 18:34:27 +0100 Subject: [PATCH 1/3] Fix code to search for mount.json in custom data folders --- apps/files_external/lib/config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index b2109e5eac..ed9a0126dd 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -353,7 +353,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); From f11658698d48e0fdd2065466651c4c86c22a80f2 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Thu, 20 Feb 2014 18:53:37 +0100 Subject: [PATCH 2/3] Fix path to the mount file --- lib/private/files/filesystem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index 952f9f9feb..7f7b6f7f46 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')) { From 539ea0882bb8e0ee02d7adaf72109dcbda608d36 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 24 Feb 2014 10:35:24 +0100 Subject: [PATCH 3/3] Fixed mount config path --- apps/files_external/lib/config.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index ed9a0126dd..1a17e0139d 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -353,8 +353,8 @@ class OC_Mount_Config { $jsonFile = OC_User::getHome(OCP\User::getUser()).'/mount.json'; } else { $phpFile = OC::$SERVERROOT.'/config/mount.php'; - $datadir = \OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data/"); - $jsonFile = \OC_Config::getValue("mount_file", $datadir . "/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); @@ -380,7 +380,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);