summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-09-28 16:32:27 +0200
committerVincent Petry <pvince81@owncloud.com>2014-10-08 14:22:17 +0200
commit9a5d0f6084c7ecb491e4a1c971b125ac57eeb5da (patch)
treed5a90c1d3632ce73e7383d75dfb2be0534dd15af /apps/files_external
parent12ac3a800df10cada530c57659bd9fdbc770079b (diff)
downloadnextcloud-server-9a5d0f6084c7ecb491e4a1c971b125ac57eeb5da.tar.gz
nextcloud-server-9a5d0f6084c7ecb491e4a1c971b125ac57eeb5da.zip
Fix add/remove mountpoint hooks
Diffstat (limited to 'apps/files_external')
-rwxr-xr-xapps/files_external/lib/config.php6
-rw-r--r--apps/files_external/tests/mountconfig.php8
2 files changed, 8 insertions, 6 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 0b5e833a704..604700ccf57 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -463,6 +463,7 @@ class OC_Mount_Config {
$priority = null) {
$backends = self::getBackends();
$mountPoint = OC\Files\Filesystem::normalizePath($mountPoint);
+ $relMountPoint = $mountPoint;
if ($mountPoint === '' || $mountPoint === '/') {
// can't mount at root folder
return false;
@@ -520,7 +521,7 @@ class OC_Mount_Config {
\OC\Files\Filesystem::CLASSNAME,
\OC\Files\Filesystem::signal_create_mount,
array(
- \OC\Files\Filesystem::signal_param_path => $mountPoint,
+ \OC\Files\Filesystem::signal_param_path => $relMountPoint,
\OC\Files\Filesystem::signal_param_mount_type => $mountType,
\OC\Files\Filesystem::signal_param_users => $applicable,
)
@@ -539,6 +540,7 @@ class OC_Mount_Config {
*/
public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) {
// Verify that the mount point applies for the current user
+ $relMountPoints = $mountPoint;
if ($isPersonal) {
if ($applicable != OCP\User::getUser()) {
return false;
@@ -563,7 +565,7 @@ class OC_Mount_Config {
\OC\Files\Filesystem::CLASSNAME,
\OC\Files\Filesystem::signal_delete_mount,
array(
- \OC\Files\Filesystem::signal_param_path => $mountPoint,
+ \OC\Files\Filesystem::signal_param_path => $relMountPoints,
\OC\Files\Filesystem::signal_param_mount_type => $mountType,
\OC\Files\Filesystem::signal_param_users => $applicable,
)
diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php
index 0fa1e4e46e7..c11e48b82f3 100644
--- a/apps/files_external/tests/mountconfig.php
+++ b/apps/files_external/tests/mountconfig.php
@@ -53,7 +53,7 @@ class Test_Mount_Config_Hook_Test {
}
public static function deleteHookCallback($params) {
- self::$signal = \OC\Files\Filesystem::signal_create_mount;
+ self::$signal = \OC\Files\Filesystem::signal_delete_mount;
self::$params = $params;
}
@@ -416,7 +416,7 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
);
$this->assertEquals(
$applicable,
- $params[\OC\Files\Filesystem::signal_param_mount_users]
+ $params[\OC\Files\Filesystem::signal_param_users]
);
Test_Mount_Config_Hook_Test::clear();
@@ -445,7 +445,7 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
$this->assertTrue(
OC_Mount_Config::removeMountPoint(
- '/ext',
+ $mountPoint,
$mountType,
$applicable,
$isPersonal
@@ -467,7 +467,7 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
);
$this->assertEquals(
$applicable,
- $params[\OC\Files\Filesystem::signal_param_mount_users]
+ $params[\OC\Files\Filesystem::signal_param_users]
);
}