summaryrefslogtreecommitdiffstats
path: root/lib/Auth
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-12-11 09:47:43 -0500
committerAleksander Machniak <machniak@kolabsys.com>2014-12-11 09:47:43 -0500
commit34e98d3ce6434d5f533913493ce4ec0797881d65 (patch)
tree69000ce32e28ba3cd409671894f3bcf20074aedb /lib/Auth
parentc95f7399d89b9d599adeb3a04d77da3bfc98eb02 (diff)
downloadwebadmin-34e98d3ce6434d5f533913493ce4ec0797881d65.tar.gz
Fix bug where OU select field lists only 10 records when vlv index is in use (#4075)
Diffstat (limited to 'lib/Auth')
-rw-r--r--lib/Auth/LDAP.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 7a61524..a17263d 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -656,7 +656,7 @@ class LDAP extends Net_LDAP3 {
{
$this->_log(LOG_DEBUG, "Auth::LDAP::list_organizationalunits(" . var_export($attributes, true) . ", " . var_export($search, true) . ", " . var_export($params, true));
- $base_dn = $this->_subject_base_dn('ou');
+ $base_dn = $this->_subject_base_dn($params['type'] ? $params['type'] . '_ou' : 'ou');
$filter = $this->conf->get('ou_filter');
if (!$filter) {
@@ -1233,6 +1233,16 @@ class LDAP extends Net_LDAP3 {
$subject_base_dn = $this->conf->get_raw("ldap", $subject . "_base_dn");
}
+ // This could be "<object_type>_<object_name>", if so we'll try the name only now
+ if (empty($subject_base_dn) && ($pos = strrpos($subject, '_'))) {
+ $subject = substr($subject, $pos + 1);
+ $subject_base_dn = $this->conf->get_raw($domain, $subject . "_base_dn");
+
+ if (empty($subject_base_dn)) {
+ $subject_base_dn = $this->conf->get_raw("ldap", $subject . "_base_dn");
+ }
+ }
+
if (empty($subject_base_dn) && $strict) {
$this->_log(LOG_DEBUG, "subject_base_dn for subject $subject not found");
return null;