summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-08-06 11:47:03 +0200
committerAleksander Machniak <alec@alec.pl>2014-08-06 11:47:03 +0200
commitb9d3e607bbc0e7430e99a5b0a5431a78f57d6680 (patch)
tree8c8ccd3737ca83ef35cd28c524d9f854ad30cd01
parentd8b26e40f93c59482a5d65e1456c5ccbd57551be (diff)
parentb17a507941b469912ec457a1f7e2c8dd75ece48d (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
-rw-r--r--program/lib/Net/LDAP3/Result.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/program/lib/Net/LDAP3/Result.php b/program/lib/Net/LDAP3/Result.php
index 728b30442..0759df087 100644
--- a/program/lib/Net/LDAP3/Result.php
+++ b/program/lib/Net/LDAP3/Result.php
@@ -71,7 +71,7 @@ class Net_LDAP3_Result implements Iterator
}
/**
- *
+ * Wrapper for ldap_sort()
*/
public function sort($attr)
{
@@ -79,18 +79,23 @@ class Net_LDAP3_Result implements Iterator
}
/**
- *
+ * Get entries count
*/
public function count()
{
- if (!isset($this->count))
+ if (!isset($this->count)) {
$this->count = ldap_count_entries($this->conn, $this->result);
+ }
return $this->count;
}
/**
+ * Wrapper for ldap_get_entries()
*
+ * @param bool $normalize Optionally normalize the entries to a list of hash arrays
+ *
+ * @return array List of LDAP entries
*/
public function entries($normalize = false)
{
@@ -103,6 +108,14 @@ class Net_LDAP3_Result implements Iterator
return $entries;
}
+ /**
+ * Wrapper for ldap_get_dn() using the current entry pointer
+ */
+ public function get_dn()
+ {
+ return $this->current ? ldap_get_dn($this->conn, $this->current) : null;
+ }
+
/*** Implement PHP 5 Iterator interface to make foreach work ***/