Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
9a5d0f60
Commit
9a5d0f60
authored
Sep 28, 2014
by
Robin Appelman
Committed by
Vincent Petry
Oct 08, 2014
Browse files
Fix add/remove mountpoint hooks
parent
12ac3a80
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/files_external/lib/config.php
View file @
9a5d0f60
...
...
@@ -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
=>
$
m
ountPoint
,
\
OC\Files\Filesystem
::
signal_param_path
=>
$
relM
ountPoint
,
\
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
=>
$
m
ountPoint
,
\
OC\Files\Filesystem
::
signal_param_path
=>
$
relM
ountPoint
s
,
\
OC\Files\Filesystem
::
signal_param_mount_type
=>
$mountType
,
\
OC\Files\Filesystem
::
signal_param_users
=>
$applicable
,
)
...
...
apps/files_external/tests/mountconfig.php
View file @
9a5d0f60
...
...
@@ -53,7 +53,7 @@ class Test_Mount_Config_Hook_Test {
}
public
static
function
deleteHookCallback
(
$params
)
{
self
::
$signal
=
\
OC\Files\Filesystem
::
signal_
crea
te_mount
;
self
::
$signal
=
\
OC\Files\Filesystem
::
signal_
dele
te_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
]
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment