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:
parent
d2bc636a79
commit
fffba1c6af
2 changed files with 5 additions and 4 deletions
apps/user_ldap
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue