throw exception when LDAP Connection was lost

This commit is contained in:
Arthur Schiwon 2015-04-22 15:22:11 +02:00
parent 42d9ba0f83
commit b96b0063f6
1 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,8 @@
namespace OCA\user_ldap\lib;
use OC\ServerNotAvailableException;
class LDAP implements ILDAPWrapper {
protected $curFunc = '';
protected $curArgs = array();
@ -283,6 +285,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.' (' .