Skip to content
Merged
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions lib/Jobs/MigrateGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,31 @@ protected function getGroupsToMigrate(array $samlGroups, array $pool): array {

$group = $this->groupManager->get($gid);
if ($group === null) {
$this->logger->debug('Not migrating group "{gid}": not found by the group manager', [
'app' => 'user_saml',
'gid' => $gid,
]);
return false;
}

$backendNames = $group->getBackendNames();
if (!in_array('Database', $backendNames, true)) {
$this->logger->debug('Not migrating group "{gid}": not belonging to local database backend', [
'app' => 'user_saml',
'gid' => $gid,
'backends' => $backendNames,
]);
return false;
}

foreach ($group->getUsers() as $user) {
if ($user->getBackendClassName() !== 'user_saml') {
$this->logger->debug('Not migrating group "{gid}": user "{userId}" from a different backend "{userBackend}"', [
'app' => 'user_saml',
'gid' => $gid,
'userId' => $user->getUID(),
'userBackend' => $user->getBackendClassName(),
]);
return false;
}
}
Expand Down
Loading