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;
111 $this->num_results = $this->entries[
'count'];
112 if($this->entries[
'count'] == 0)
117 for($row_counter = 0; $row_counter < $this->entries[
'count'];$row_counter++)
120 foreach($this->entries[$row_counter] as $key => $value)
122 $key = strtolower($key);
130 $data[
'dn'] = $value;
135 if($value[
'count'] > 1)
137 for($i = 0; $i < $value[
'count']; $i++)
139 $data[$key][] = $value[$i];
142 elseif($value[
'count'] == 1)
144 $data[$key] = $value[0];
149 $data[$key] = $value;
152 $this->all_rows[] =
$data;
153 if($row_counter == 0)
163 @ldap_free_result($this->result);
174 return $this->entries = @ldap_get_entries($this->ldap_handle,$this->result);
179 $tmp_entries = array();
180 $entry = ldap_first_entry($this->ldap_handle,$this->result);
182 $attributes = @ldap_get_attributes($this->ldap_handle, $entry);
183 for($j=0; $j<$attributes[
'count']; $j++)
185 $values = ldap_get_values_len($this->ldap_handle, $entry,$attributes[$j]);
186 $tmp_entries[$i][strtolower($attributes[$j])] = $values;
189 }
while ($entry = @ldap_next_entry($this->ldap_handle,$entry));
193 $tmp_entries[
'count'] = $i;
195 $this->entries = $tmp_entries;