]> source.dussan.org Git - nextcloud-server.git/commitdiff
throw exception when LDAP Connection was lost
authorArthur Schiwon <blizzz@owncloud.com>
Wed, 22 Apr 2015 13:22:11 +0000 (15:22 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Wed, 22 Apr 2015 13:22:11 +0000 (15:22 +0200)
apps/user_ldap/lib/ldap.php

index 4dad34f5b1ee226f95e5f6a4c16e4b75a4cc0c86..9d5cf4fee0ac58a346565d45acbcaf1bec30e901 100644 (file)
@@ -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.' (' .