aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2025-03-04 10:05:50 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-03-04 14:16:21 +0000
commitf6ff808b28fe140c34bae8053797be4c9cdce312 (patch)
treebc800dd42f6a3371aedc7e080e6cb730c93d2760 /apps/user_ldap
parent72ee217bb4ae8a7942edd9101929120af185e28c (diff)
downloadnextcloud-server-backport/51218/stable31.tar.gz
nextcloud-server-backport/51218/stable31.zip
feat: Add bases and gidNumber attribute to ldap:test-user-settings outputbackport/51218/stable31
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/Command/TestUserSettings.php16
1 files 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: <info>" . $connection->$attributeName . '</info>');
+ if (($connection->$attributeName !== '') && ($connection->$attributeName !== [])) {
+ if (\is_string($connection->$attributeName)) {
+ $output->writeln("- $attributeName: <info>" . $connection->$attributeName . '</info>');
+ } else {
+ $output->writeln("- $attributeName: <info>" . \json_encode($connection->$attributeName) . '</info>');
+ }
}
}
@@ -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',