summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-10-03 00:35:24 +0200
committerArthur Schiwon <blizzz@owncloud.com>2015-10-03 00:35:24 +0200
commit6d06d1c5a4525696997c4d1d7d1d225895630fdb (patch)
tree0754ceee3d79815508fd6838cf85b57827fd53a3 /apps
parent94013ffb82575b625334bdb57e6a7b9d2b9634bd (diff)
downloadnextcloud-server-6d06d1c5a4525696997c4d1d7d1d225895630fdb.tar.gz
nextcloud-server-6d06d1c5a4525696997c4d1d7d1d225895630fdb.zip
LDAP Wizard: do not be picky about credentials when only looking for the port
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/lib/wizard.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index 13ccf805b69..8d96e7de91d 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -661,12 +661,13 @@ class Wizard extends LDAPUtility {
//connectAndBind may throw Exception, it needs to be catched by the
//callee of this method
- // unallowed anonymous bind throws 48. But if it throws 48, we
- // detected port and TLS, i.e. it is successful.
try {
$settingsFound = $this->connectAndBind($p, $t);
} catch (\Exception $e) {
- if($e->getCode() === 48) {
+ // any reply other than -1 (= cannot connect) is already okay,
+ // because then we found the server
+ // unavailable startTLS returns -11
+ if($e->getCode() > 0) {
$settingsFound = true;
} else {
throw $e;
@@ -1084,7 +1085,7 @@ class Wizard extends LDAPUtility {
} else if ($errNo === 2) {
return $this->connectAndBind($port, $tls, true);
}
- throw new \Exception($error);
+ throw new \Exception($error, $errNo);
}
/**