aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/ldap.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib/ldap.php')
-rw-r--r--apps/user_ldap/lib/ldap.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/ldap.php
index b4ca3499f49..4d45db2e155 100644
--- a/apps/user_ldap/lib/ldap.php
+++ b/apps/user_ldap/lib/ldap.php
@@ -26,6 +26,8 @@
namespace OCA\user_ldap\lib;
+use OC\ServerNotAvailableException;
+
class LDAP implements ILDAPWrapper {
protected $curFunc = '';
protected $curArgs = array();
@@ -283,6 +285,12 @@ 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 if ($errorCode === 48) {
+ throw new \Exception('LDAP authentication method rejected', $errorCode);
+ } else if ($errorCode === 1) {
+ throw new \Exception('LDAP Operations error', $errorCode);
} else {
\OCP\Util::writeLog('user_ldap',
'LDAP error '.$errorMsg.' (' .