Skip to content

Commit 228628f

Browse files
Merge pull request #51227 from nextcloud/backport/51218/stable31
[stable31] feat: Add bases and gidNumber attribute to ldap:test-user-settings output
2 parents aed2cc2 + f6ff808 commit 228628f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

apps/user_ldap/lib/Command/TestUserSettings.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
101101
$output->writeln('');
102102

103103
$attributeNames = [
104+
'ldapBase',
105+
'ldapBaseUsers',
104106
'ldapExpertUsernameAttr',
105107
'ldapUuidUserAttribute',
106108
'ldapExpertUUIDUserAttr',
@@ -120,11 +122,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
120122
'ldapAttributeBiography',
121123
'ldapAttributeBirthDate',
122124
'ldapAttributePronouns',
125+
'ldapGidNumber',
126+
'hasGidNumber',
123127
];
124128
$output->writeln('Attributes set in configuration:');
125129
foreach ($attributeNames as $attributeName) {
126-
if ($connection->$attributeName !== '') {
127-
$output->writeln("- $attributeName: <info>" . $connection->$attributeName . '</info>');
130+
if (($connection->$attributeName !== '') && ($connection->$attributeName !== [])) {
131+
if (\is_string($connection->$attributeName)) {
132+
$output->writeln("- $attributeName: <info>" . $connection->$attributeName . '</info>');
133+
} else {
134+
$output->writeln("- $attributeName: <info>" . \json_encode($connection->$attributeName) . '</info>');
135+
}
128136
}
129137
}
130138

@@ -134,6 +142,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
134142
if ($connection->ldapUuidUserAttribute !== 'auto') {
135143
$attrs[] = strtolower($connection->ldapUuidUserAttribute);
136144
}
145+
if ($connection->hasGidNumber) {
146+
$attrs[] = strtolower($connection->ldapGidNumber);
147+
}
137148
$attrs[] = 'memberof';
138149
$attrs = array_values(array_unique($attrs));
139150
$attributes = $access->readAttributes($knownDn, $attrs, $filter);
@@ -170,6 +181,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
170181
$output->writeln('Group information:');
171182

172183
$attributeNames = [
184+
'ldapBaseGroups',
173185
'ldapDynamicGroupMemberURL',
174186
'ldapGroupFilter',
175187
'ldapGroupMemberAssocAttr',

0 commit comments

Comments
 (0)