diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-10-08 18:05:13 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-11-25 14:01:20 +0100 |
commit | 7b1eedb11e5f55d563831d8e58c44e615267669c (patch) | |
tree | 8d0b83f503186aa4cfff396ae327c05b0478fe5b /lib/private/Group/Manager.php | |
parent | 20ec763337428f3a0e7c9e34e0246c1f5fb3a838 (diff) | |
download | nextcloud-server-7b1eedb11e5f55d563831d8e58c44e615267669c.tar.gz nextcloud-server-7b1eedb11e5f55d563831d8e58c44e615267669c.zip |
take group creation result into consideration
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/private/Group/Manager.php')
-rw-r--r-- | lib/private/Group/Manager.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 7567f719b0a..b372eb1786e 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -180,7 +180,7 @@ class Manager extends PublicEmitter implements IGroupManager { protected function getGroupObject($gid, $displayName = null) { $backends = []; foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC\Group\Backend::GROUP_DETAILS)) { + if ($backend->implementsActions(Backend::GROUP_DETAILS)) { $groupData = $backend->getGroupDetails($gid); if (is_array($groupData) && !empty($groupData)) { // take the display name from the first backend that has a non-null one @@ -210,7 +210,7 @@ class Manager extends PublicEmitter implements IGroupManager { /** * @param string $gid - * @return \OC\Group\Group + * @return IGroup|bool|null */ public function createGroup($gid) { if ($gid === '' || $gid === null) { @@ -218,13 +218,14 @@ class Manager extends PublicEmitter implements IGroupManager { } else if ($group = $this->get($gid)) { return $group; } else { - $this->emit('\OC\Group', 'preCreate', array($gid)); + $this->emit('\OC\Group', 'preCreate', [$gid]); foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC\Group\Backend::CREATE_GROUP)) { - $backend->createGroup($gid); - $group = $this->getGroupObject($gid); - $this->emit('\OC\Group', 'postCreate', array($group)); - return $group; + if ($backend->implementsActions(Backend::CREATE_GROUP)) { + if($backend->createGroup($gid)) { + $group = $this->getGroupObject($gid); + $this->emit('\OC\Group', 'postCreate', [$group]); + return $group; + } } } return null; @@ -300,7 +301,7 @@ class Manager extends PublicEmitter implements IGroupManager { */ public function isAdmin($userId) { foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC\Group\Backend::IS_ADMIN) && $backend->isAdmin($userId)) { + if ($backend->implementsActions(Backend::IS_ADMIN) && $backend->isAdmin($userId)) { return true; } } |