Skip to content
Snippets Groups Projects
Commit 374e3475 authored by Robin Appelman's avatar Robin Appelman
Browse files

Also remove the user's home storage from the storage table when deleting a user

parent 9851727b
No related branches found
No related tags found
No related merge requests found
...@@ -70,4 +70,17 @@ class Storage { ...@@ -70,4 +70,17 @@ class Storage {
return false; 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));
}
} }
...@@ -205,6 +205,9 @@ class OC_User { ...@@ -205,6 +205,9 @@ class OC_User {
// Delete user files in /data/ // Delete user files in /data/
OC_Helper::rmdirr(\OC_User::getHome($uid)); 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 // Remove it from the Cache
self::getManager()->delete($uid); self::getManager()->delete($uid);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment