ldap support

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rocks
Forum Newbie
Posts: 1
Joined: Sun Jun 29, 2003 7:00 pm

ldap support

Post by rocks »

I am looking for support of ldap in php. I would like to authenticate and identify users against a ldap directory. If this is simple, just point me to the right documentation.
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

Most improtantly, PHP must have been compiled with LDAP support..
There is a fairly good tutorial at devshed here, and make sure you go on to part 2 of it as well..
Then there is ofcourse the manual...
nefus
Forum Newbie
Posts: 16
Joined: Tue Mar 04, 2003 12:04 pm

Post by nefus »

A good question for us beginners.. thanks for asking it.
tridude
Forum Newbie
Posts: 8
Joined: Mon Jun 30, 2003 3:13 pm
Location: Boulder, CO

Post by tridude »

I just recently did what you are trying to do. I seond the devshed article(s) if you're new to LDAP or PHP. This article would've saved me some serious time -- instead I had to learn it all from scratch.

Anyhow, I'm using LDAP as authentication. Basically, a user supplies a userid/password via a login form. This information is used to attempt to bind to the LDAP directory. If the bind operation was successful (meaning the userid/password are valid), I set a session variable called LOGGED_IN to 1. At the beginning of all pages you can check this session variable for the login status and then proceed accordingly. I sort of modeled my approach after the login tutorial I found http://www.free2code.net/tutorials/prog ... plogin.php. It uses PHP/MySQL, but the logic is similar.

Let me know if you have any other questions. I'd be happy to share my code.
Post Reply