diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-01-21 23:58:48 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-02-12 14:03:30 +0100 |
commit | b0ba69ff31fd4776ef6896a527077bfbe17d2697 (patch) | |
tree | ecddbe1cc1c18b3ad0b9a5150824a38e78b38692 /lib | |
parent | c1241b169115e64c639513a1015607739a4e3e7b (diff) | |
download | nextcloud-server-b0ba69ff31fd4776ef6896a527077bfbe17d2697.tar.gz nextcloud-server-b0ba69ff31fd4776ef6896a527077bfbe17d2697.zip |
Also remove the user's home storage from the storage table when deleting a user
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/cache/storage.php | 13 | ||||
-rw-r--r-- | lib/private/user.php | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php index 5657cf06e12..6d7a1002c1b 100644 --- a/lib/private/files/cache/storage.php +++ b/lib/private/files/cache/storage.php @@ -70,4 +70,17 @@ class Storage { return false; } } + + /** + * remove the entry for the storage + * + * @param string $storageId + */ + public static function remove($storageId) { + if (strlen($storageId) > 64) { + $storageId = md5($storageId); + } + $sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?'; + \OC_DB::executeAudited($sql, array($storageId)); + } } diff --git a/lib/private/user.php b/lib/private/user.php index 98ebebbe5c1..2519200d0f0 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -205,6 +205,9 @@ class OC_User { // Delete user files in /data/ OC_Helper::rmdirr(\OC_User::getHome($uid)); + // Delete the users entry in the storage table + \OC\Files\Cache\Storage::remove('home::' . $uid); + // Remove it from the Cache self::getManager()->delete($uid); } |