summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoricewind1991 <icewind1991@gmail.com>2012-10-16 11:46:50 -0700
committericewind1991 <icewind1991@gmail.com>2012-10-16 11:46:50 -0700
commit247626b5c2b0e383aaffb5d75845d5fb18742547 (patch)
tree38521a9f0b0535d3a2fc652e0dbe616315e1a780
parentde7b46c66a77dd207929c222ec71d0b238da5f50 (diff)
parente8441becdba97ce46585043a071d01b5c74526a6 (diff)
downloadnextcloud-server-247626b5c2b0e383aaffb5d75845d5fb18742547.tar.gz
nextcloud-server-247626b5c2b0e383aaffb5d75845d5fb18742547.zip
Merge pull request #36 from scambra/filecache-fixes
delete fscache on deleting user
-rw-r--r--lib/filecache.php3
-rw-r--r--lib/filecache/update.php8
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/filecache.php b/lib/filecache.php
index 8fcb6fd9404..a36cfef6759 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -203,7 +203,7 @@ class OC_FileCache{
OC_Cache::remove('fileid/'.$root.$path);
}
-
+
/**
* return array of filenames matching the querty
* @param string $query
@@ -509,3 +509,4 @@ class OC_FileCache{
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');
diff --git a/lib/filecache/update.php b/lib/filecache/update.php
index 4a5ea873b17..f9d64d0ae99 100644
--- a/lib/filecache/update.php
+++ b/lib/filecache/update.php
@@ -216,4 +216,12 @@ class OC_FileCache_Update{
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"]);
+ }
}