summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-05 09:01:08 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-05 09:02:05 +0100
commite0ad3543b135342cbf15da350683cb3813aa8b0e (patch)
treee0eee9141a609a198cb8cbe6b44ad82a65fc97f1
parente7a5de02a6bf4b04fc2ab740e4c1206df68e15de (diff)
downloadwebadmin-e0ad3543b135342cbf15da350683cb3813aa8b0e.tar.gz
Do not log the $result unless indeed we have a result (#986)
-rw-r--r--lib/Auth/LDAP.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 14059c6..2afd737 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -502,7 +502,7 @@ class LDAP extends Net_LDAP3 {
}
$base_dn = $this->_subject_base_dn("role");
-
+ Log::trace("Auth::LDAP::list_roles() using \$base_dn: " . var_export($base_dn, TRUE));
// TODO: From config
$filter = "(&(objectclass=ldapsubentry)(objectclass=nsroledefinition))";
@@ -904,7 +904,9 @@ class LDAP extends Net_LDAP3 {
if (empty($subject_base_dn)) {
$subject_base_dn = $this->conf->get_raw("ldap", $subject . "_base_dn");
}
- $base_dn = $this->conf->expand($subject_base_dn, array("base_dn" => $base_dn));
+ if (!empty($subject_base_dn)) {
+ $base_dn = $this->conf->expand($subject_base_dn, array("base_dn" => $base_dn));
+ }
}
$this->_log(LOG_DEBUG, "subject_base_dn for subject $subject results in $base_dn");
@@ -1384,9 +1386,12 @@ class LDAP extends Net_LDAP3 {
$result = $this->search($entry_dn, '(objectclass=*)', 'base');
- $this->_log(LOG_DEBUG, "Auth::LDAP::_read() result: " . var_export($result->entries(TRUE), TRUE));
-
- return $result ? $result->entries(TRUE) : FALSE;
+ if ($result) {
+ $this->_log(LOG_DEBUG, "Auth::LDAP::_read() result: " . var_export($result->entries(TRUE), TRUE));
+ return $result->entries(TRUE);
+ } else {
+ return FALSE;
+ }
}
private function _search($base_dn, $filter = '(objectclass=*)', $attributes = Array('*')) {