Allow use of the user's DN as the group filter substitution

This commit is contained in:
mildis
2020-05-22 05:57:30 +02:00
committed by GitHub
parent a0a7a1eb31
commit 9e1e4ea381
6 changed files with 45 additions and 25 deletions

View File

@@ -37,7 +37,7 @@ class LdapGroupTest extends Base
->setConstructorArgs(array($this->query))
->setMethods(array(
'getAttributeName',
'getBasDn',
'getBaseDn',
))
->getMock();
}
@@ -96,7 +96,7 @@ class LdapGroupTest extends Base
$this->group
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('CN=Users,DC=kanboard,DC=local'));
$groups = $this->group->find('(&(objectClass=group)(sAMAccountName=Kanboard*))');
@@ -142,7 +142,7 @@ class LdapGroupTest extends Base
$this->group
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('CN=Users,DC=kanboard,DC=local'));
$groups = $this->group->find('(&(objectClass=group)(sAMAccountName=Kanboard*))');
@@ -154,6 +154,6 @@ class LdapGroupTest extends Base
$this->expectException('\LogicException');
$group = new Group($this->query);
$group->getBasDn();
$group->getBaseDn();
}
}

View File

@@ -56,7 +56,7 @@ class LdapUserTest extends Base
'getGroupUserFilter',
'getGroupAdminDn',
'getGroupManagerDn',
'getBasDn',
'getBaseDn',
))
->getMock();
}
@@ -127,7 +127,7 @@ class LdapUserTest extends Base
$this->user
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('ou=People,dc=kanboard,dc=local'));
$user = $this->user->find('(uid=my_ldap_user)');
@@ -202,7 +202,7 @@ class LdapUserTest extends Base
$this->user
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('ou=People,dc=kanboard,dc=local'));
$user = $this->user->find('(uid=my_ldap_user)');
@@ -293,7 +293,7 @@ class LdapUserTest extends Base
$this->user
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('ou=People,dc=kanboard,dc=local'));
$user = $this->user->find('(uid=my_ldap_user)');
@@ -396,7 +396,7 @@ class LdapUserTest extends Base
$this->user
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('ou=People,dc=kanboard,dc=local'));
$user = $this->user->find('(uid=my_ldap_user)');
@@ -451,7 +451,7 @@ class LdapUserTest extends Base
$this->user
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('ou=People,dc=kanboard,dc=local'));
$user = $this->user->find('(uid=my_ldap_user)');
@@ -543,7 +543,7 @@ class LdapUserTest extends Base
$this->user
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('OU=Users,DC=kanboard,DC=local'));
$this->group
@@ -649,7 +649,7 @@ class LdapUserTest extends Base
$this->user
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('OU=Users,DC=kanboard,DC=local'));
$this->group
@@ -760,7 +760,7 @@ class LdapUserTest extends Base
$this->user
->expects($this->any())
->method('getBasDn')
->method('getBaseDn')
->will($this->returnValue('OU=Users,DC=kanboard,DC=local'));
$this->group
@@ -790,7 +790,7 @@ class LdapUserTest extends Base
$this->expectException('\LogicException');
$user = new User($this->query);
$user->getBasDn();
$user->getBaseDn();
}
public function testGetLdapUserPatternNotConfigured()