From 598f798c048edfdb2841ae0f0452e90de8388d7d Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 22 Apr 2015 15:22:11 +0200 Subject: [PATCH] throw exception when LDAP Connection was lost --- apps/user_ldap/lib/ldap.php | 4 ++++ 1 file changed, 4 insertions(+) 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.' (' . -- 2.39.5