aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-02-05 21:49:22 +0100
committerRobin Appelman <icewind@owncloud.com>2012-02-21 20:48:48 +0100
commitb3a974d8bbcd88602a54cf32cd472802583ab4aa (patch)
tree0cedf694730dc4be51015fb4906490e4cf92ea4d /lib
parent501678f981cf8e320d11cf1a780aefeae1537050 (diff)
downloadnextcloud-server-b3a974d8bbcd88602a54cf32cd472802583ab4aa.tar.gz
nextcloud-server-b3a974d8bbcd88602a54cf32cd472802583ab4aa.zip
only trigger hooks for the default filesystem view
Diffstat (limited to 'lib')
-rw-r--r--lib/filesystemview.php22
-rw-r--r--lib/user.php3
2 files changed, 15 insertions, 10 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));
+ }
}
}
}
diff --git a/lib/user.php b/lib/user.php
index aa828de52f5..826215b2289 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -195,8 +195,9 @@ class OC_User {
if( $run ){
$uid=self::checkPassword( $uid, $password );
if($uid){
- return self::setUserId($uid);
+ self::setUserId($uid);
OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid, 'password'=>$password ));
+ return true;
}
}
return false;