Log a warning when a user or group is mapped with a suffix

Most of the time, this is the result of a misconfiguration by the admin
 and is not what is expected.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/37575/head
Côme Chilliet 2023-04-04 14:06:13 +07:00
parent 59d0e7711d
commit 51705da7a4
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with 9 additions and 0 deletions

@ -589,6 +589,15 @@ class Access extends LDAPUtility {
$altName = $this->createAltInternalOwnCloudName($intName, $isUser);
if (is_string($altName)) {
if ($this->mapAndAnnounceIfApplicable($mapper, $fdn, $altName, $uuid, $isUser)) {
$this->logger->warning(
'Mapped {fdn} as {altName} because of a name collision on {intName}.',
[
'fdn' => $fdn,
'altName' => $altName,
'intName' => $intName,
'app' => 'user_ldap',
]
);
$newlyMapped = true;
return $altName;
}