diff options
author | Johannes Leuker <j.leuker@hosting.de> | 2021-02-09 14:50:38 +0100 |
---|---|---|
committer | Johannes Leuker <j.leuker@hosting.de> | 2021-03-01 16:02:08 +0100 |
commit | 2796ef80ff53684c6b276b054bb2d3b6039a4ef6 (patch) | |
tree | 29336019d1ad40fedae19f39ca67da5455ae2266 /lib/private | |
parent | 9fd72b0d3a4ebfad2291a18aefc51e999fbb0744 (diff) | |
download | nextcloud-server-2796ef80ff53684c6b276b054bb2d3b6039a4ef6.tar.gz nextcloud-server-2796ef80ff53684c6b276b054bb2d3b6039a4ef6.zip |
Show group backends in occ group:list --info and group:info
Signed-off-by: Johannes Leuker <j.leuker@hosting.de>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Group/Database.php | 13 | ||||
-rw-r--r-- | lib/private/Group/Group.php | 19 |
2 files changed, 31 insertions, 1 deletions
diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index c49f3bce596..29fcb503b10 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -55,6 +55,7 @@ use OCP\Group\Backend\IGetDisplayNameBackend; use OCP\Group\Backend\IGroupDetailsBackend; use OCP\Group\Backend\IRemoveFromGroupBackend; use OCP\Group\Backend\ISetDisplayNameBackend; +use OCP\Group\Backend\INamedBackend; use OCP\IDBConnection; /** @@ -69,7 +70,8 @@ class Database extends ABackend implements IGetDisplayNameBackend, IGroupDetailsBackend, IRemoveFromGroupBackend, - ISetDisplayNameBackend { + ISetDisplayNameBackend, + INamedBackend { /** @var string[] */ private $groupCache = []; @@ -502,4 +504,13 @@ class Database extends ABackend implements return true; } + + /** + * Backend name to be shown in group management + * @return string the name of the backend to be shown + * @since 21.0.0 + */ + public function getBackendName(): string { + return 'Database'; + } } diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index d3f8c603121..bb9a65de012 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -36,6 +36,7 @@ use OC\Hooks\PublicEmitter; use OCP\Group\Backend\ICountDisabledInGroup; use OCP\Group\Backend\IGetDisplayNameBackend; use OCP\Group\Backend\IHideFromCollaborationBackend; +use OCP\Group\Backend\INamedBackend; use OCP\Group\Backend\ISetDisplayNameBackend; use OCP\GroupInterface; use OCP\IGroup; @@ -318,6 +319,24 @@ class Group implements IGroup { } /** + * Get the names of the backend classes the group is connected to + * + * @return string[] + */ + public function getBackendNames() { + $backends = []; + foreach ($this->backends as $backend) { + if ($backend instanceof INamedBackend) { + $backends[] = $backend->getBackendName(); + } else { + $backends[] = get_class($backend); + } + } + + return $backends; + } + + /** * delete the group * * @return bool |