Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
eb1d612
Add api to register setup checks
CarlSchwan May 23, 2022
c71e47f
Progress
CarlSchwan May 30, 2022
0890012
Fix SetupChecks/LdapInvalidUuids.php
come-nc Sep 28, 2023
a3ec716
Fix UI and add PhpOutdated check
come-nc Sep 28, 2023
1202171
Fix docblock and types for new public API
come-nc Sep 28, 2023
b41b9cf
Small cleanups in SetupCheck classes
come-nc Sep 28, 2023
a56d40c
Fix lint problems in vue files
come-nc Sep 28, 2023
a4618cf
Move existing setup checks to new API
come-nc Oct 2, 2023
67e7a26
Fix PHPDoc in OCP for new SetupResult class
come-nc Oct 2, 2023
8bfa093
Migrate NeedsSystemAddressBookSync to new ISetupCheck API
come-nc Oct 2, 2023
bec6c0a
Migrate ReadOnlyConfig and DefaultPhoneRegionSet to new API
come-nc Oct 2, 2023
fa3c0e4
Fix description for SetupChecks/NeedsSystemAddressBookSync
come-nc Oct 9, 2023
05cb141
Merge setupchecks from new API into old UI
come-nc Oct 9, 2023
5503c4c
Add missing licences and copyright in SetupCheck
come-nc Oct 9, 2023
bd37067
Migrate InternetConnectivity check to new API
come-nc Oct 9, 2023
efa2dfa
Add OCP interface for SetupCheckManager
come-nc Oct 9, 2023
6bc3e00
Fix tests for setup checks
come-nc Oct 9, 2023
968b82c
Remove UI draft
come-nc Oct 12, 2023
be11ffd
Add debug logging when running setup checks to help with debugging sl…
come-nc Oct 16, 2023
6aa6f26
Move NeedsSystemAddressBookSync to dav application where it’s registered
come-nc Oct 16, 2023
11ebf46
Remove useless var in apps/settings/lib/SetupChecks/CheckUserCertific…
come-nc Oct 16, 2023
2e4d154
Change SetupResult API to named constructors
come-nc Oct 16, 2023
a3cc3b1
Small code style fix in SetupCheckManager
come-nc Oct 19, 2023
789ff3f
Fix jsunit tests for SetupChecks
come-nc Oct 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix SetupChecks/LdapInvalidUuids.php
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Oct 19, 2023
commit 0890012e72c594805406b95b39707db1acdf0d76
23 changes: 11 additions & 12 deletions apps/user_ldap/lib/SetupChecks/LdapInvalidUuids.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @copyright Copyright (c) 2022 Arthur Schiwon <[email protected]>
*
* @author Arthur Schiwon <[email protected]>
* @author Côme Chilliet <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -28,14 +29,12 @@

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;

Expand All @@ -49,16 +48,16 @@ public function getCategory(): string {
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.'));
}
}
}