summaryrefslogtreecommitdiffstats
path: root/lib/private/User
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-03-03 01:24:27 -0600
committerMorris Jobke <hey@morrisjobke.de>2017-03-09 17:35:09 -0600
commita5ba1f78033b3ebe69c771fb33c1217a60494728 (patch)
treeb4bdf0ec562db9e91071eeef39f82586ce48eef4 /lib/private/User
parent6fd0e7e93995facfe75b26699ea462bb94fd03b9 (diff)
downloadnextcloud-server-a5ba1f78033b3ebe69c771fb33c1217a60494728.tar.gz
nextcloud-server-a5ba1f78033b3ebe69c771fb33c1217a60494728.zip
Remove legacy class OC_Group and OC_User
* basically a straight replacement of the wrapped code at the calling code parts Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/User')
-rw-r--r--lib/private/User/User.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index 961f70f8a8e..bca9c46bfd0 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -204,9 +204,15 @@ class User implements IUser {
// FIXME: Feels like an hack - suggestions?
+ $groupManager = \OC::$server->getGroupManager();
// We have to delete the user from all groups
- foreach (\OC::$server->getGroupManager()->getUserGroupIds($this) as $groupId) {
- \OC_Group::removeFromGroup($this->uid, $groupId);
+ foreach ($groupManager->getUserGroupIds($this) as $groupId) {
+ $group = $groupManager->get($groupId);
+ if ($group) {
+ \OC_Hook::emit("OC_Group", "pre_removeFromGroup", ["run" => true, "uid" => $this->uid, "gid" => $groupId]);
+ $group->removeUser($this);
+ \OC_Hook::emit("OC_User", "post_removeFromGroup", ["uid" => $this->uid, "gid" => $groupId]);
+ }
}
// Delete the user's keys in preferences
\OC::$server->getConfig()->deleteAllUserValues($this->uid);