diff options
Diffstat (limited to 'lib/private/user/user.php')
-rw-r--r-- | lib/private/user/user.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/private/user/user.php b/lib/private/user/user.php index 9ad2f5f0d3a..ad85337f628 100644 --- a/lib/private/user/user.php +++ b/lib/private/user/user.php @@ -153,6 +153,24 @@ class User implements IUser { $this->emitter->emit('\OC\User', 'preDelete', array($this)); } $result = $this->backend->deleteUser($this->uid); + if ($result) { + + // FIXME: Feels like an hack - suggestions? + + // We have to delete the user from all groups + foreach (\OC_Group::getUserGroups($this->uid) as $i) { + \OC_Group::removeFromGroup($this->uid, $i); + } + // Delete the user's keys in preferences + \OC_Preferences::deleteUser($this->uid); + + // Delete user files in /data/ + \OC_Helper::rmdirr(\OC_User::getHome($this->uid)); + + // Delete the users entry in the storage table + \OC\Files\Cache\Storage::remove('home::' . $this->uid); + } + if ($this->emitter) { $this->emitter->emit('\OC\User', 'postDelete', array($this)); } |