diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-02-05 21:49:22 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-02-21 20:48:48 +0100 |
commit | b3a974d8bbcd88602a54cf32cd472802583ab4aa (patch) | |
tree | 0cedf694730dc4be51015fb4906490e4cf92ea4d /lib/filesystemview.php | |
parent | 501678f981cf8e320d11cf1a780aefeae1537050 (diff) | |
download | nextcloud-server-b3a974d8bbcd88602a54cf32cd472802583ab4aa.tar.gz nextcloud-server-b3a974d8bbcd88602a54cf32cd472802583ab4aa.zip |
only trigger hooks for the default filesystem view
Diffstat (limited to 'lib/filesystemview.php')
-rw-r--r-- | lib/filesystemview.php | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php index a7003e84f19..0ce803be2b1 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -303,11 +303,13 @@ class OC_FilesystemView { if(OC_FileProxy::runPreProxies($operation,$path, $extraParam) and OC_Filesystem::isValidPath($path) and $storage=$this->getStorage($path)){ $interalPath=$this->getInternalPath($path); $run=true; - foreach($hooks as $hook){ - if($hook!='read'){ - OC_Hook::emit( OC_Filesystem::CLASSNAME, $hook, array( OC_Filesystem::signal_param_path => $path, OC_Filesystem::signal_param_run => &$run)); - }else{ - OC_Hook::emit( OC_Filesystem::CLASSNAME, $hook, array( OC_Filesystem::signal_param_path => $path)); + if(OC_Filesystem::$loaded and $this->fakeRoot==OC_Filesystem::getRoot()){ + foreach($hooks as $hook){ + if($hook!='read'){ + OC_Hook::emit( OC_Filesystem::CLASSNAME, $hook, array( OC_Filesystem::signal_param_path => $path, OC_Filesystem::signal_param_run => &$run)); + }else{ + OC_Hook::emit( OC_Filesystem::CLASSNAME, $hook, array( OC_Filesystem::signal_param_path => $path)); + } } } if($run){ @@ -317,10 +319,12 @@ class OC_FilesystemView { $result=$storage->$operation($interalPath); } $result=OC_FileProxy::runPostProxies($operation,$path,$result); - if($operation!='fopen'){//no post hooks for fopen, the file stream is still open - foreach($hooks as $hook){ - if($hook!='read'){ - OC_Hook::emit( OC_Filesystem::CLASSNAME, 'post_'.$hook, array( OC_Filesystem::signal_param_path => $path)); + if(OC_Filesystem::$loaded and $this->fakeRoot==OC_Filesystem::getRoot()){ + if($operation!='fopen'){//no post hooks for fopen, the file stream is still open + foreach($hooks as $hook){ + if($hook!='read'){ + OC_Hook::emit( OC_Filesystem::CLASSNAME, 'post_'.$hook, array( OC_Filesystem::signal_param_path => $path)); + } } } } |