From 71759bf856f5b419ee248729bbbba0b5fb80dc87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 4 Mar 2025 10:05:50 +0100 Subject: [PATCH] feat: Add bases and gidNumber attribute to ldap:test-user-settings output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/Command/TestUserSettings.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/Command/TestUserSettings.php b/apps/user_ldap/lib/Command/TestUserSettings.php index 88524eded02..51cf7c06473 100644 --- a/apps/user_ldap/lib/Command/TestUserSettings.php +++ b/apps/user_ldap/lib/Command/TestUserSettings.php @@ -101,6 +101,8 @@ class TestUserSettings extends Command { $output->writeln(''); $attributeNames = [ + 'ldapBase', + 'ldapBaseUsers', 'ldapExpertUsernameAttr', 'ldapUuidUserAttribute', 'ldapExpertUUIDUserAttr', @@ -120,11 +122,17 @@ class TestUserSettings extends Command { 'ldapAttributeBiography', 'ldapAttributeBirthDate', 'ldapAttributePronouns', + 'ldapGidNumber', + 'hasGidNumber', ]; $output->writeln('Attributes set in configuration:'); foreach ($attributeNames as $attributeName) { - if ($connection->$attributeName !== '') { - $output->writeln("- $attributeName: " . $connection->$attributeName . ''); + if (($connection->$attributeName !== '') && ($connection->$attributeName !== [])) { + if (\is_string($connection->$attributeName)) { + $output->writeln("- $attributeName: " . $connection->$attributeName . ''); + } else { + $output->writeln("- $attributeName: " . \json_encode($connection->$attributeName) . ''); + } } } @@ -134,6 +142,9 @@ class TestUserSettings extends Command { if ($connection->ldapUuidUserAttribute !== 'auto') { $attrs[] = strtolower($connection->ldapUuidUserAttribute); } + if ($connection->hasGidNumber) { + $attrs[] = strtolower($connection->ldapGidNumber); + } $attrs[] = 'memberof'; $attrs = array_values(array_unique($attrs)); $attributes = $access->readAttributes($knownDn, $attrs, $filter); @@ -170,6 +181,7 @@ class TestUserSettings extends Command { $output->writeln('Group information:'); $attributeNames = [ + 'ldapBaseGroups', 'ldapDynamicGroupMemberURL', 'ldapGroupFilter', 'ldapGroupMemberAssocAttr',