note 68439 added to function.ldap-get-attributes
| From: | SnezkoSnezak at osu1 dot php dot net | Date: | Thu, 27 Jul 2006 08:06:13 +0000 |
| Subject: | note 68439 added to function.ldap-get-attributes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115236@lists.php.net to get a copy of this message | ||
Code and function to extract all attributes from all entryes in a certain DN. Maybe not the most
timewise efficient but it works.
$entry = ldap_first_entry($ds, $sr);
write_attr($entry,$ds);
for ($i = 0; $i < $n_entries; $i++){
$entry = ldap_next_entry($ds, $entry);
write_attr($entry,$ds);
}
function write_attr($entry,$ds){
$attrs = ldap_get_attributes ($ds, $entry);
for ($j = 0; $j < $attrs["count"]; $j++){
$attr_name = $attrs[$j];
$attrs["$attr_name"]["count"] . "\n";
for ($k = 0; $k < $attrs["$attr_name"]["count"]; $k++) {
echo ">>>>>>";
echo $attr_name.": ".$attrs["$attr_name"][$k]."\n";
}
}
}
----
Server IP: 66.163.161.117
Probable Submitter: 212.13.247.100 (proxied: 10.1.40.195, 127.0.0.1)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.ldap-get-attributes.php
Edit -- http://master.php.net/note/edit/68439
Del: integrated -- http://master.php.net/note/delete/68439/integrated
Del: useless -- http://master.php.net/note/delete/68439/useless
Del: bad code -- http://master.php.net/note/delete/68439/bad+code
Del: spam -- http://master.php.net/note/delete/68439/spam
Del: non-english -- http://master.php.net/note/delete/68439/non-english
Del: in docs -- http://master.php.net/note/delete/68439/in+docs
Del: other reasons-- http://master.php.net/note/delete/68439
Reject -- http://master.php.net/note/reject/68439
Search -- http://master.php.net/manage/user-notes.php