Skip to content

Commit 68d2ac4

Browse files
author
robin.kluth
committed
Stop throwing an exception, when a domain is not available during search. It gets skipped now.
1 parent 2c73771 commit 68d2ac4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/LdapAuth.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,11 @@ public function searchUser($searchFor, $attributes = "", $searchFilter = "", $do
355355
Yii::debug($domain, __METHOD__);
356356
if (!$this->login($domain['publicSearchUser'], $domain['publicSearchUserPassword'], $i)) {
357357
if (empty($this->_l)) {
358-
throw new ErrorException('LDAP Connect or Bind error on ' . $domain['hostname']);
358+
Yii::error('LDAP Connect or Bind error on ' . $domain['hostname'] . ', skipping...', __METHOD__);
359359
} else {
360-
throw new ErrorException('LDAP Connect or Bind error (' . ldap_errno($this->_l) . ' - ' . ldap_error($this->_l) . ') on ' . $domain['hostname']);
360+
Yii::error('LDAP Connect or Bind error (' . ldap_errno($this->_l) . ' - ' . ldap_error($this->_l) . ') on ' . $domain['hostname'] . ', skipping...');
361361
}
362+
continue; // Skip the whole domain
362363
}
363364

364365
$searchFilter = str_replace("%searchFor%", addslashes($searchFor), $searchFilter);

0 commit comments

Comments
 (0)