mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-26 02:44:29 +00:00
Better handle when we can't talk to the server, log that
This commit is contained in:
parent
15e5a89675
commit
e73f2d73d4
@ -140,22 +140,38 @@ class ldapDriver
|
||||
$ret = array();
|
||||
|
||||
foreach($this->baseDNUsers as $baseDNUsers) {
|
||||
$entry = $query($this->connect,$baseDNUsers,$this->filterUsers,$attributes);
|
||||
$entry = $query($this->connect, $baseDNUsers, $this->filterUsers, $attributes);
|
||||
|
||||
if (!ldap_first_entry($this->connect,$entry)) {
|
||||
if (! $entry) {
|
||||
$c->messages[] = sprintf(translate('Error NoUserFound with filter >%s<, attributes >%s< , dn >%s<'),
|
||||
$this->filterUsers,
|
||||
join(', ', $attributes),
|
||||
$baseDNUsers);
|
||||
dbg_error_log('LDAP', 'Error NoUserFound with filter >%s<, attributes >%s< , dn >%s<',
|
||||
$this->filterUsers,
|
||||
join(', ', $attributes),
|
||||
$baseDNUsers);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (! ldap_first_entry($this->connect, $entry)) {
|
||||
$c->messages[] = sprintf(translate('Error NoUserFound with filter >%s<, attributes >%s< , dn >%s<'),
|
||||
$this->filterUsers,
|
||||
join(', ', $attributes),
|
||||
$baseDNUsers);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$row = array();
|
||||
for($i = ldap_first_entry($this->connect,$entry);
|
||||
$i && $arr = ldap_get_attributes($this->connect,$i);
|
||||
$i = ldap_next_entry($this->connect,$i) ) {
|
||||
for ($i = ldap_first_entry($this->connect,$entry);
|
||||
$i && $arr = ldap_get_attributes($this->connect,$i);
|
||||
$i = ldap_next_entry($this->connect,$i) ) {
|
||||
$row = array();
|
||||
|
||||
for ($j=0; $j < $arr['count']; $j++) {
|
||||
$row[$arr[$j]] = $arr[$arr[$j]][0];
|
||||
}
|
||||
|
||||
$ret[]=$row;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user