0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-15 00:43:23 +00:00

fix(ldap): Fix user_ldap attribute casing to fix tests

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2024-07-29 15:32:43 +02:00
parent d2bc636a79
commit fffba1c6af
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A
2 changed files with 5 additions and 4 deletions
apps/user_ldap

View file

@ -502,15 +502,15 @@ class Access extends LDAPUtility {
}
if ($isUser) {
$nameAttribute = $this->connection->ldapUserDisplayName;
$nameAttribute = strtolower($this->connection->ldapUserDisplayName);
$filter = $this->connection->ldapUserFilter;
$uuidAttr = 'ldapUuidUserAttribute';
$uuidOverride = $this->connection->ldapExpertUUIDUserAttr;
$usernameAttribute = (string)$this->connection->ldapExpertUsernameAttr;
$usernameAttribute = strtolower($this->connection->ldapExpertUsernameAttr);
$attributesToRead = [$nameAttribute,$usernameAttribute];
// TODO fetch also display name attributes and cache them if the user is mapped
} else {
$nameAttribute = $this->connection->ldapGroupDisplayName;
$nameAttribute = strtolower($this->connection->ldapGroupDisplayName);
$filter = $this->connection->ldapGroupFilter;
$uuidAttr = 'ldapUuidGroupAttribute';
$uuidOverride = $this->connection->ldapExpertUUIDGroupAttr;

View file

@ -612,7 +612,8 @@ class AccessTest extends TestCase {
$this->prepareMocksForSearchTests($base, $fakeConnection, $fakeSearchResultResource, $fakeLdapEntries);
$this->connection->expects($this->exactly($fakeLdapEntries['count']))
// Called twice per user, for userExists and userExistsOnLdap
$this->connection->expects($this->exactly(2 * $fakeLdapEntries['count']))
->method('writeToCache')
->with($this->stringStartsWith('userExists'), true);