Skip to content

Commit

Permalink
Merge pull request #36 from scambra/filecache-fixes
Browse files Browse the repository at this point in the history
delete fscache on deleting user
  • Loading branch information
icewind1991 committed Oct 16, 2012
2 parents de7b46c + e8441be commit 247626b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/filecache.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public static function delete($path,$root=false) {

OC_Cache::remove('fileid/'.$root.$path);
}

/**
* return array of filenames matching the querty
* @param string $query
Expand Down Expand Up @@ -509,3 +509,4 @@ public static function triggerUpdate($user=''){
OC_Hook::connect('OC_Filesystem','post_write','OC_FileCache_Update','fileSystemWatcherWrite');
OC_Hook::connect('OC_Filesystem','post_delete','OC_FileCache_Update','fileSystemWatcherDelete');
OC_Hook::connect('OC_Filesystem','post_rename','OC_FileCache_Update','fileSystemWatcherRename');
OC_Hook::connect('OC_User','post_deleteUser','OC_FileCache_Update','deleteFromUser');
8 changes: 8 additions & 0 deletions lib/filecache/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,12 @@ public static function rename($oldPath,$newPath,$root=false) {
OC_FileCache::increaseSize(dirname($newPath), $oldSize, $root);
OC_FileCache::move($oldPath, $newPath);
}

/**
* delete files owned by user from the cache
* @param string $parameters$parameters["uid"])
*/
public static function deleteFromUser($parameters) {
OC_FileCache::clear($parameters["uid"]);
}
}

0 comments on commit 247626b

Please sign in to comment.