mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-27 02:33:43 +08:00
Set ldap to not follow referrals by default
Added LDAP_FOLLOW_REFERRALS .env option to override. Fixes #317
This commit is contained in:
parent
e7f8188ee5
commit
2ea7e10923
|
@ -42,6 +42,8 @@ class LdapService
|
|||
$userFilter = $this->buildFilter($this->config['user_filter'], ['user' => $userName]);
|
||||
$baseDn = $this->config['base_dn'];
|
||||
$emailAttr = $this->config['email_attribute'];
|
||||
$followReferrals = $this->config['follow_referrals'] ? 1 : 0;
|
||||
$this->ldap->setOption($ldapConnection, LDAP_OPT_REFERRALS, $followReferrals);
|
||||
$users = $this->ldap->searchAndGetEntries($ldapConnection, $baseDn, $userFilter, ['cn', 'uid', 'dn', $emailAttr]);
|
||||
if ($users['count'] === 0) return null;
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ return [
|
|||
'user_filter' => env('LDAP_USER_FILTER', '(&(uid=${user}))'),
|
||||
'version' => env('LDAP_VERSION', false),
|
||||
'email_attribute' => env('LDAP_EMAIL_ATTRIBUTE', 'mail'),
|
||||
'follow_referrals' => env('LDAP_FOLLOW_REFERRALS', false),
|
||||
]
|
||||
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue
Block a user