| | |
| | | * Get a specific LDAP entry, identified by its DN |
| | | * |
| | | * @param string $dn Record identifier |
| | | * @param array $attributes Attributes to return |
| | | * |
| | | * @return array Hash array |
| | | */ |
| | | function get_entry($dn) |
| | | function get_entry($dn, $attributes = array()) |
| | | { |
| | | return parent::get_entry($dn, $this->attributes); |
| | | return parent::get_entry($dn, !empty($attributes) ? $attributes : $this->attributes); |
| | | } |
| | | |
| | | /** |
| | |
| | | * Turn an LDAP entry into a regular PHP array with attributes as keys. |
| | | * |
| | | * @param array $entry Attributes array as retrieved from ldap_get_attributes() or ldap_get_entries() |
| | | * @param bool $flat Convert one-element-array values into strings (not implemented) |
| | | * |
| | | * @return array Hash array with attributes as keys |
| | | */ |
| | | public static function normalize_entry($entry) |
| | | public static function normalize_entry($entry, $flat = false) |
| | | { |
| | | if (!isset($entry['count'])) { |
| | | return $entry; |