Skip to content

Commit 7493d49

Browse files
committed
Fix yml and MapbenderLdapBindAuthenticationProvider for Mapbender 3.2.x
1 parent 52e0f24 commit 7493d49

2 files changed

Lines changed: 22 additions & 17 deletions

File tree

Resources/config/services.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,34 @@ services:
22
ldapClient:
33
class: Symfony\Component\Ldap\LdapClient
44
arguments:
5-
- %ldap.host% #Address to LDAPServer
6-
- %ldap.port% #Port where LDAPServer is listening
7-
- %ldap.version% #LDAP Protocol version
8-
- %ldap.useSSL% # SSL #Use SSL
9-
- %ldap.useTLS% # TLS 'Use TLS
10-
ldapUserProvider:
5+
- '%ldap.host%' #Address to LDAPServer
6+
- '%ldap.port%' #Port where LDAPServer is listening
7+
- '%ldap.version%' #LDAP Protocol version
8+
- '%ldap.useSSL%' # SSL #Use SSL
9+
- '%ldap.useTLS%' # TLS 'Use TLS
10+
LDAPUserProvider:
1111
class: Mapbender\LDAPBundle\Security\Provider\LDAPUserProvider
1212
arguments:
13-
- @ldapClient
14-
- %ldap.bind.dn%
15-
- %ldap.bind.pwd%
16-
- %ldap.user.baseDN%
17-
- %ldap.user.query%
18-
- %ldap.group.baseDN%
19-
- %ldap.group.query%
13+
- '@ldapClient'
14+
- '%ldap.bind.dn%'
15+
- '%ldap.bind.pwd%'
16+
- '%ldap.user.baseDN%'
17+
- '%ldap.user.query%'
18+
- '%ldap.group.baseDN%'
19+
- '%ldap.group.query%'
2020
- [ROLE_USER]
21-
- %ldap.group.id%
21+
- '%ldap.group.id%'
2222
security.authentication.provider.mbldap:
2323
class: Mapbender\LDAPBundle\Security\Provider\MapbenderLdapBindAuthenticationProvider
2424
arguments:
25-
- @ldapClient
25+
- '@ldapClient'
2626
-
2727
-
2828
-
2929
-
30-
- %ldap.user.dn%
30+
- '%ldap.user.dn%'
3131
-
32+
- '%ldap.user.query%'
3233

3334

3435

Security/Provider/MapbenderLdapBindAuthenticationProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MapbenderLdapBindAuthenticationProvider extends LdapBindAuthenticationPro
2727
private $dnString;
2828
private $encoderFactory;
2929

30-
public function __construct(UserProviderInterface $userProvider, UserCheckerInterface $userChecker, $providerKey, LdapClientInterface $ldap, EncoderFactoryInterface $encoderFactory,$dnString = '{cn=username}', $hideUserNotFoundExceptions = true)
30+
public function __construct(UserProviderInterface $userProvider, UserCheckerInterface $userChecker, $providerKey, LdapClientInterface $ldap, EncoderFactoryInterface $encoderFactory,$dnString = '{cn=username}', $hideUserNotFoundExceptions = true, $userQuery)
3131
{
3232
parent::__construct( $userProvider, $userChecker, $providerKey, $ldap, $dnString, $hideUserNotFoundExceptions);
3333

@@ -36,6 +36,10 @@ public function __construct(UserProviderInterface $userProvider, UserCheckerInte
3636
$this->encoderFactory = $encoderFactory ;
3737
$this->dnString = $dnString;
3838

39+
// support Mapbender < 3.2.x (Symfony 2.8)
40+
if (method_exists(get_parent_class($this), 'setQueryString')) {
41+
$this->setQueryString($userQuery);
42+
}
3943
}
4044

4145

0 commit comments

Comments
 (0)