diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-09-28 11:36:35 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-10-19 11:43:58 +0200 |
commit | 0890012e72c594805406b95b39707db1acdf0d76 (patch) | |
tree | 23914bc85703c92304d7fc5a346ab7140937174f /apps/user_ldap | |
parent | c71e47f5c311836973c7ae22b174dfbbf8117304 (diff) | |
download | nextcloud-server-0890012e72c594805406b95b39707db1acdf0d76.tar.gz nextcloud-server-0890012e72c594805406b95b39707db1acdf0d76.zip |
Fix SetupChecks/LdapInvalidUuids.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php b/apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php index f8c8a5f1fc5..473fedc5c1d 100644 --- a/apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php +++ b/apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php @@ -6,6 +6,7 @@ declare(strict_types=1); * @copyright Copyright (c) 2022 Arthur Schiwon <blizzz@arthur-schiwon.de> * * @author Arthur Schiwon <blizzz@arthur-schiwon.de> + * @author Côme Chilliet <come.chilliet@nextcloud.com> * * @license GNU AGPL version 3 or any later version * @@ -28,14 +29,12 @@ namespace OCA\User_LDAP\SetupChecks; use OCA\User_LDAP\Mapping\GroupMapping; use OCA\User_LDAP\Mapping\UserMapping; -use OCP\App\IAppManager; use OCP\IL10N; -use OCP\IServerContainer; use OCP\SetupCheck\ISetupCheck; +use OCP\SetupCheck\SetupResult; class LdapInvalidUuids implements ISetupCheck { private IL10N $l10n; - private IServerContainer $server; private UserMapping $userMapping; private GroupMapping $groupMapping; @@ -49,16 +48,16 @@ class LdapInvalidUuids implements ISetupCheck { return 'ldap'; } - public function description(): string { - return $this->l10n->t('Invalid UUIDs of LDAP users or groups have been found. Please review your "Override UUID detection" settings in the Expert part of the LDAP configuration and use "occ ldap:update-uuid" to update them.'); + public function getName(): string { + return $this->l10n->t('Checking for invalid LDAP UUIDs'); } - public function severity(): string { - return 'warning'; - } - - public function run(): bool { - return count($this->userMapping->getList(0, 1, true)) === 0 - && count($this->groupMapping->getList(0, 1, true)) === 0; + public function run(): SetupResult { + if (count($this->userMapping->getList(0, 1, true)) === 0 + && count($this->groupMapping->getList(0, 1, true)) === 0) { + return new SetupResult(SetupResult::SUCCESS); + } else { + return new SetupResult(SetupResult::WARNING, $this->l10n->t('Invalid UUIDs of LDAP users or groups have been found. Please review your "Override UUID detection" settings in the Expert part of the LDAP configuration and use "occ ldap:update-uuid" to update them.')); + } } } |