From: Arthur Schiwon Date: Wed, 22 Apr 2015 13:22:11 +0000 (+0200) Subject: throw exception when LDAP Connection was lost X-Git-Tag: v7.0.6RC1~10^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=598f798c048edfdb2841ae0f0452e90de8388d7d;p=nextcloud-server.git throw exception when LDAP Connection was lost --- diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/ldap.php index 4dad34f5b1e..9d5cf4fee0a 100644 --- a/apps/user_ldap/lib/ldap.php +++ b/apps/user_ldap/lib/ldap.php @@ -23,6 +23,8 @@ namespace OCA\user_ldap\lib; +use OC\ServerNotAvailableException; + class LDAP implements ILDAPWrapper { protected $curFunc = ''; protected $curArgs = array(); @@ -280,6 +282,8 @@ class LDAP implements ILDAPWrapper { //for now } else if ($errorCode === 10) { //referrals, we switch them off, but then there is AD :) + } else if ($errorCode === -1) { + throw new ServerNotAvailableException('Lost connection to LDAP server.'); } else { \OCP\Util::writeLog('user_ldap', 'LDAP error '.$errorMsg.' (' .