!What is LDAP?
From [http://en.wikipedia.org/wiki/LDAP] - Lightweight Directory Access Protocol (LDAP) is a protocol for accessing on-line directory services.
Essentially, LDAP directories are online address books, which corporates often use to centralise their contact information. LDAP has been used to perform other functions such as serving DNS, automount directories, authenticating users and many other roles where centralised information is useful.
!How does it work?
LDAP stores contacts (people, organisations, departments, etc) using a unique identified called a Distinguished Name (__DN__). A DN could look like this - ''cn=Stephan Borg,ou=people,o=bitweaver''. DN's must be unique within the directory and are used to segregate contact information on a per department, organisation or any kind of grouping level.
With each DN, an unlimited number of attributes can be associated. This allows pieces of information to be added to a contact in a flexible manner. These ''attributes'' are determined by a read-only schema, which is controlled through the LDAP server. Some example attributes are:
||Address Book Attribute|LDAP Attribute
Common Name|cn
Given name|givenName
Job Title|title
Web Page|labelURI
Calendar Free/Busy URL|calFBURL
User ID|uid
Phone number|telephoneNumber
Fax number|facsimileTelephoneNumber
Home Phone|homePhone
Home Address|homePostalAddress||

!Talking to LDAP
When you retrieve information from an LDAP server, you submit the DN and optionally, what attributes you want to retrieve. The output is usually presented in the following format:
{CODE()}dn: cn=Stephan Borg,ou=people,o=bitweaver
givenName: Stephan
mobile: 1234 567 890
sn: Borg
uid: wolff_borg
cn: Stephan Borg
o: Bitweaver
mail: me@home.com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
objectClass: calEntry
calFBURL: http://bitweaver.org/fb/wolff_borg.ifb{CODE}
PHP comes with all the functions to talk to and decipher LDAP queries, presenting the information in arrays. One of the goals of the ContactsPackage will be to sub-class LibertyStorage class to communicate with LDAP.
Page History
10 Jul 2005 (06:49 UTC)
Added second mail attribute to example
Stephan Borg218.214.1.1135
Current • Source
Stephan Borg218.214.1.1134
View • Compare • Difference • Source
Stephan Borg218.214.1.1133
View • Compare • Difference • Source