mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Handle ad/ldap authorizer search error (#16139)
* Handle ldap authorizer search error * Update LdapAuthorizationAuthorizer.php * More ldap failure checks
This commit is contained in:
@@ -78,6 +78,9 @@ class ADAuthorizationAuthorizer extends MysqlAuthorizer
|
||||
$this->userFilter($username),
|
||||
['samaccountname']
|
||||
);
|
||||
if ($search === false) {
|
||||
throw new AuthenticationException('User search failed: ' . ldap_error($this->ldap_connection));
|
||||
}
|
||||
$entries = ldap_get_entries($this->ldap_connection, $search);
|
||||
|
||||
if ($entries['count']) {
|
||||
@@ -151,6 +154,9 @@ class ADAuthorizationAuthorizer extends MysqlAuthorizer
|
||||
$this->userFilter($username),
|
||||
$attributes
|
||||
);
|
||||
if ($search === false) {
|
||||
throw new AuthenticationException('Role search failed: ' . ldap_error($this->ldap_connection));
|
||||
}
|
||||
$entries = ldap_get_entries($this->ldap_connection, $search);
|
||||
|
||||
if ($entries['count']) {
|
||||
|
Reference in New Issue
Block a user