Permalink
Browse files

Some user-specific node meta must not be cached, use "node.info.nocac…

…he" hook.
  • Loading branch information...
1 parent 7004362 commit 204c1a9d394ed6c0fe358125b75368a477732bd6 @cdujeu cdujeu committed May 23, 2016
@@ -361,7 +361,7 @@
</component_config>
</client_configs>
<hooks>
- <serverCallback hookName="node.info" methodName="nodeSharedMetadata"/>
+ <serverCallback hookName="node.info.nocache" methodName="nodeSharedMetadata"/>
<serverCallback hookName="node.change" methodName="updateNodeSharedData"/>
<serverCallback hookName="user.after_delete" methodName="cleanUserShares" defer="true"/>
<serverCallback methodName="forwardEventToShares" hookName="node.change" defer="true"/>
@@ -425,10 +425,12 @@ public function loadNodeInfo($forceRefresh = false, $contextNode = false, $detai
}
Controller::applyHook("node.info.start", array(&$this, $contextNode, $details, $forceRefresh));
if($this->nodeInfoLoaded && !$forceRefresh){
+ Controller::applyHook("node.info.nocache", array(&$this, $contextNode, $details, $forceRefresh));
return;
}
Controller::applyHook("node.info", array(&$this, $contextNode, $details, $forceRefresh));
Controller::applyHook("node.info.end", array(&$this, $contextNode, $details, $forceRefresh));
+ Controller::applyHook("node.info.nocache", array(&$this, $contextNode, $details, $forceRefresh));
$this->nodeInfoLoaded = true;
$this->nodeInfoLevel = $details;
}
@@ -66,6 +66,9 @@ public function route(ServerRequestInterface &$request, ResponseInterface &$resp
$action = $request->getAttribute("action");
$taskService = TaskService::getInstance();
+ if(AuthService::getLoggedUser() == null){
+ return;
+ }
switch ($action){
case "tasks_list":
$tasks = $taskService->getCurrentRunningTasks(AuthService::getLoggedUser(), ConfService::getRepository());
@@ -139,6 +142,9 @@ public function attachTasksToNode(AJXP_Node &$node, $isContextNode = false, $det
*/
public function enrichConsumeChannel(ServerRequestInterface &$requestInterface, ResponseInterface &$responseInterface){
+ if(AuthService::getLoggedUser() == null || ConfService::getRepository() == null){
+ return [];
+ }
$respType = &$responseInterface->getBody();
if(!$respType instanceof \Pydio\Core\Http\Response\SerializableResponseStream && !$respType->getSize()){
$respType = new \Pydio\Core\Http\Response\SerializableResponseStream();
@@ -196,7 +196,7 @@
</action>
</actions>
<hooks>
- <serverCallback hookName="node.info" methodName="nodeBookmarkMetadata"/>
+ <serverCallback hookName="node.info.nocache" methodName="nodeBookmarkMetadata"/>
<serverCallback hookName="node.change" methodName="nodeChangeBookmarkMetadata"/>
</hooks>
<external_file filename="plugins/gui.ajax/ajxpclient_actions.xml" include="actions/*" exclude=""/>
@@ -10,9 +10,9 @@
</client_settings>
<registry_contributions>
<hooks>
- <serverCallback hookName="node.info" methodName="processLockMeta"></serverCallback>
- <serverCallback hookName="node.before_change" methodName="checkFileLock"></serverCallback>
- <serverCallback hookName="node.before_path_change" methodName="checkFileLock"></serverCallback>
+ <serverCallback hookName="node.info.nocache" methodName="processLockMeta"/>
+ <serverCallback hookName="node.before_change" methodName="checkFileLock"/>
+ <serverCallback hookName="node.before_path_change" methodName="checkFileLock"/>
</hooks>
<actions>
<action name="sl_lock">
@@ -104,7 +104,7 @@
<hooks>
<serverCallback hookName="node.read" methodName="processReadHook" defer="true"/>
<serverCallback hookName="node.change" methodName="processChangeHook" defer="true"/>
- <serverCallback hookName="node.info" methodName="enrichNode" />
+ <serverCallback hookName="node.info.nocache" methodName="enrichNode" />
</hooks>
</registry_contributions>
</meta>

0 comments on commit 204c1a9

Please sign in to comment.