Skip to content

Commit

Permalink
Add Server Name To LDAP Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmr authored and cedric-anne committed Feb 1, 2024
1 parent 97d3223 commit cb39520
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Console/Ldap/SynchronizeUsersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
continue;
}

$name = $server->fields['name'] ?? $server_id;
$output->writeln(
'<info>' . sprintf(__('Processing LDAP server "%s"...'), $server_id) . '</info>',
'<info>' . sprintf(__('Processing LDAP server "%s"...'), $name) . '</info>',
OutputInterface::VERBOSITY_NORMAL
);

Expand Down Expand Up @@ -305,12 +306,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($limitexceeded) {
$message = sprintf(
__('LDAP server "%s" size limit exceeded.'),
$server_id
$name
);
} else {
$message = sprintf(
__('Error while contacting the LDAP server "%s".'),
$server_id
$name
);
}
$output->writeln(
Expand All @@ -334,7 +335,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$output->writeln(
'<info>' . sprintf($action_message, $server_id) . '</info>',
'<info>' . sprintf($action_message, $name) . '</info>',
OutputInterface::VERBOSITY_NORMAL
);

Expand Down Expand Up @@ -421,7 +422,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
$result_output->addRow(
[
$server_id,
$name,
$results[AuthLDAP::USER_IMPORTED],
$results[AuthLDAP::USER_SYNCHRONIZED],
$results[AuthLDAP::USER_DELETED_LDAP],
Expand Down

0 comments on commit cb39520

Please sign in to comment.