Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorblizzz <blizzz@owncloud.com>2014-02-10 14:27:31 +0400
committerblizzz <blizzz@owncloud.com>2014-02-10 14:27:31 +0400
commitfd32501fe05bfecbdb2d5db4f95c4c828dbe474f (patch)
tree3979b0b4c3bcffd557b857b1ee255dcc6d360591 /apps
parent5e315495c20a789fb94398668316b251b4ff5500 (diff)
parenta967acee4c0983c8e81d227d9817fd92eb9bca1a (diff)
Merge pull request #7081 from owncloud/fix_6670
LDAP: Wizard cannot determine Base DN in some cases, fixes #6670
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/js/settings.js1
-rw-r--r--apps/user_ldap/lib/access.php2
-rw-r--r--apps/user_ldap/lib/ildapwrapper.php4
-rw-r--r--apps/user_ldap/lib/ldap.php6
-rw-r--r--apps/user_ldap/lib/wizard.php5
5 files changed, 13 insertions, 5 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index acf88ef58a4..792638f2b58 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -240,6 +240,7 @@ var LdapWizard = {
LdapWizard.hideSpinner('#ldap_base');
LdapWizard.showInfoBox('Please specify a Base DN');
LdapWizard.showInfoBox('Could not determine Base DN');
+ $('#ldap_base').prop('disabled', false);
}
);
}
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 72f9c740921..b619f62f296 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -729,7 +729,7 @@ class Access extends LDAPUtility {
}
} else {
if(!is_null($limit)) {
- \OCP\Util::writeLog('user_ldap', 'Paged search failed :(', \OCP\Util::INFO);
+ \OCP\Util::writeLog('user_ldap', 'Paged search was not available', \OCP\Util::INFO);
}
}
}
diff --git a/apps/user_ldap/lib/ildapwrapper.php b/apps/user_ldap/lib/ildapwrapper.php
index 20587cba7db..e60cf5ec63f 100644
--- a/apps/user_ldap/lib/ildapwrapper.php
+++ b/apps/user_ldap/lib/ildapwrapper.php
@@ -145,9 +145,11 @@ interface ILDAPWrapper {
* @param $baseDN The DN of the entry to read from
* @param $filter An LDAP filter
* @param $attr array of the attributes to read
+ * @param $attrsonly optional, 1 if only attribute types shall be returned
+ * @param $limit optional, limits the result entries
* @return an LDAP search result resource, false on error
*/
- public function search($link, $baseDN, $filter, $attr);
+ public function search($link, $baseDN, $filter, $attr, $attrsonly = 0, $limit = 0);
/**
* @brief Sets the value of the specified option to be $value
diff --git a/apps/user_ldap/lib/ldap.php b/apps/user_ldap/lib/ldap.php
index dda8533c41f..a99c6480121 100644
--- a/apps/user_ldap/lib/ldap.php
+++ b/apps/user_ldap/lib/ldap.php
@@ -85,9 +85,9 @@ class LDAP implements ILDAPWrapper {
return $this->invokeLDAPMethod('read', $link, $baseDN, $filter, $attr);
}
- public function search($link, $baseDN, $filter, $attr) {
- return $this->invokeLDAPMethod('search', $link, $baseDN,
- $filter, $attr);
+ public function search($link, $baseDN, $filter, $attr, $attrsonly = 0, $limit = 0) {
+ return $this->invokeLDAPMethod('search', $link, $baseDN, $filter,
+ $attr, $attrsonly, $limit);
}
public function setOption($link, $option, $value) {
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index b70ede8599c..00623b74fb1 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -567,6 +567,10 @@ class Wizard extends LDAPUtility {
//get a result set > 0 on a proper base
$rr = $this->ldap->search($cr, $base, 'objectClass=*', array('dn'), 0, 1);
if(!$this->ldap->isResource($rr)) {
+ $errorNo = $this->ldap->errno($cr);
+ $errorMsg = $this->ldap->error($cr);
+ \OCP\Util::writeLog('user_ldap', 'Wiz: Could not search base '.$base.
+ ' Error '.$errorNo.': '.$errorMsg, \OCP\Util::INFO);
return false;
}
$entries = $this->ldap->countEntries($cr, $rr);
@@ -1010,6 +1014,7 @@ class Wizard extends LDAPUtility {
$this->configuration->ldapPort);
$this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
+ $this->ldap->setOption($cr, LDAP_OPT_REFERRALS, 0);
$this->ldap->setOption($cr, LDAP_OPT_NETWORK_TIMEOUT, self::LDAP_NW_TIMEOUT);
if($this->configuration->ldapTLS === 1) {
$this->ldap->startTls($cr);