]> BookStack Code Mirror - bookstack/blobdiff - app/Services/LdapService.php
Trying to make the tests green.
[bookstack] / app / Services / LdapService.php
index 71dc9c0e1a57b731048445bcdd78fed57e98c6a2..598efc19dd68828fab45da38304509056f215189 100644 (file)
@@ -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;