Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete fscache on deleting user #36

Merged
merged 1 commit into from
Oct 16, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]);
}
}