From a2c38148e7b7390884e89b8fee252a1914b6ccf9 Mon Sep 17 00:00:00 2001 From: Vinicius Cubas Brand Date: Mon, 4 Mar 2019 14:09:27 -0300 Subject: [PATCH] Cache cleaning when subadmin adds user to group This commit fix an error happening when the subadmin tries to create an user, adding him/her to the group s/he is subadmin of, using a LDAP User/Group plugin. This just forces the cache to be reset after an user is added to a group. Signed-off-by: Vinicius Cubas Brand --- apps/user_ldap/lib/Group_LDAP.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index 1658807c0d..cd4bd18cb4 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -1171,6 +1171,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD if ($this->groupPluginManager->implementsActions(GroupInterface::ADD_TO_GROUP)) { if ($ret = $this->groupPluginManager->addToGroup($uid, $gid)) { $this->access->connection->clearCache(); + unset($this->cachedGroupMembers[$gid]); } return $ret; } @@ -1188,6 +1189,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD if ($this->groupPluginManager->implementsActions(GroupInterface::REMOVE_FROM_GROUP)) { if ($ret = $this->groupPluginManager->removeFromGroup($uid, $gid)) { $this->access->connection->clearCache(); + unset($this->cachedGroupMembers[$gid]); } return $ret; }