diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-02-12 17:14:38 +0400 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-02-12 17:14:38 +0400 |
commit | 85ae5b992b69b93f1bfd140d4208d531f221ca83 (patch) | |
tree | b1abdcab898bf4496cb1bb86711447a2ae4523c9 /lib/files | |
parent | 5e24e21493299a691f22916a3bd2200bd1142afc (diff) |
Remove the filecache for a users home storage when the user is deleted
Diffstat (limited to 'lib/files')
-rw-r--r-- | lib/files/cache/cache.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php index a2a7a996970..c8fa27e402b 100644 --- a/lib/files/cache/cache.php +++ b/lib/files/cache/cache.php @@ -85,6 +85,26 @@ class Cache { } /** + * remove a storage from the cache + * + * @param string $storageId + */ + public static function removeStorage($storageId) { + $storageCache = new Cache($storageId); + + \OC_DB::executeAudited(' + DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?', + array($storageCache->getNumericStorageId()) + ); + + \OC_DB::executeAudited(' + DELETE FROM `*PREFIX*storages` WHERE `numeric_id` = ?', + array($storageCache->getNumericStorageId()) + ); + } + + + /** * normalize mimetypes * * @param string $mime |