- Added new constants LDAP_NO_USER_DN and LDAP_TOO_MANY_USER_DN in constants.php

- LDAP_Model->getUserDN now returns errors with more information
- Login redirection is performed with HTTP code 302 instead of 301
- Fixed _checkHBALDAPAuthentication behavior
- AuthLib errors have more information
This commit is contained in:
Paolo
2019-03-12 16:14:58 +01:00
parent 13db712fa7
commit d1b4024b76
4 changed files with 35 additions and 15 deletions
+7 -3
View File
@@ -89,7 +89,7 @@ class LDAP_Model extends FHC_Model
*/
public function getUserDN($username)
{
$userDN = error('No user DN were found');
$userDN = error('No user DN were found', LDAP_NO_USER_DN);
// Tries to search for a user DN using the given username
$searchResultIdentifier = @ldap_search(
@@ -108,9 +108,13 @@ class LDAP_Model extends FHC_Model
{
$userDN = error(ldap_error($this->_connection));
}
elseif ($countEntries != 1) // 0 or > 1
elseif ($countEntries == 0)
{
$userDN = error('None or too many user DN were found');
$userDN = error('No user DN were found', LDAP_NO_USER_DN);
}
elseif ($countEntries > 1)
{
$userDN = error('Too many users DN were found', LDAP_TOO_MANY_USER_DN);
}
else // One entry was found
{