53 $this->ldap_handle = $a_ldap_connection;
54 $this->result = $a_result;
68 return $this->
data ? $this->
data : array();
79 return $this->all_rows ? $this->all_rows : array();
103 $this->
data = array();
104 $this->num_results = 0;
110 $this->num_results = $this->entries[
'count'];
111 if ($this->entries[
'count'] == 0) {
115 for ($row_counter = 0; $row_counter < $this->entries[
'count'];$row_counter++) {
117 foreach ($this->entries[$row_counter] as
$key => $value) {
124 $data[
'dn'] = $value;
127 if (is_array($value)) {
128 if ($value[
'count'] > 1) {
129 for (
$i = 0;
$i < $value[
'count'];
$i++) {
132 } elseif ($value[
'count'] == 1) {
139 $this->all_rows[] =
$data;
140 if ($row_counter == 0) {
149 @ldap_free_result($this->result);
160 return $this->entries = @ldap_get_entries($this->ldap_handle, $this->result);
165 $tmp_entries = array();
166 $entry = ldap_first_entry($this->ldap_handle, $this->result);
168 $attributes = @ldap_get_attributes($this->ldap_handle, $entry);
170 $values = ldap_get_values_len($this->ldap_handle, $entry, $attributes[$j]);
171 $tmp_entries[
$i][strtolower($attributes[$j])] =
$values;
174 }
while ($entry = @ldap_next_entry($this->ldap_handle, $entry));
177 $tmp_entries[
'count'] =
$i;
179 $this->entries = $tmp_entries;
numRows()
get number of rows
toSimpleArray()
Transform ldap result in simple array.
__construct($a_ldap_connection, $a_result)
Constructor.
if(array_key_exists('yes', $_REQUEST)) $attributes
getEntries()
Wrapper for ldap_get_entries.
getRows()
Get all result rows.