Notes on Java, Solaris, PHP, LDAP…

November 17, 2007

PHP and LDAP

Filed under: Uncategorized — negev @ 9:30 pm
Tags: ,

10 July 07

PHP ldap_next_entry(link, res)
— res is a resource result from previous call of ldap_first_entry(..) or ldap_next_entry(..)!

10 July 07
PHP ldap_next_entry(link, res)
— res is a resource result from previous call of ldap_first_entry(..) or ldap_next_entry(..)!

LDAP searches – based on scope:
ldap_read, ldap_list, ldap_search

http://uk.php.net/manual/en/function.ldap-read.php:
Clarification of the ldap_read command syntax:

If you just want to pull certain attributes from an object and you already know it's dn, the ldap_read command can do this as illustrated below.  It will be less overhead than ldap_search.

  $dn = "cn=username,o=My Company, c=US"; //the object itself instead of the top search level as in ldap_search
$filter="(objectclass=*)"; // this command requires some filter
$justthese = array("ou", "sn", "givenname", "mail"); //the attributes to pull, which is much more efficient than pulling all attributes if you don't do this
$sr=ldap_read($ds, $dn, $filter, $justthese);

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: