/** * Fix a bug, ex. CN=Alice Baker,CN=Users,DC=example,DC=com * * @param string $acctname * @return string - Account DN */ protected function getAccountDn($acctname) { $baseDn = $this->getBaseDn(); if ($this->getBindRequiresDn() && isset($baseDn)) { try { return parent::getAccountDn($acctname); } catch (\Zend\Ldap\Exception\LdapException $zle) { if ($zle->getCode() != \Zend\Ldap\Exception\LdapException::LDAP_NO_SUCH_OBJECT) { throw $zle; } } $acctname = $this->usernameAttribute . '=' . \Zend\Ldap\Filter\AbstractFilter::escapeValue($acctname) . ',' . $baseDn; } return parent::getAccountDn($acctname); }