Query LDAP using PHP

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
User avatar
dashwood75
Forum Newbie
Posts: 13
Joined: Fri Nov 04, 2005 8:12 am
Location: UK

Query LDAP using PHP

Post by dashwood75 »

Hello, basically to sum it up,

I have written a web interface to our helpdesk application where users can see the calls that are currently open, along with their status etc.

What I want to do is query who is currently logged in to the OS to then filter the view specifically to that person to save them having to find their own calls.

I am not sure how to go about this, or even if LDAP is needed, so I am putting it to the experts to point me in the right direction..

any advice is appreciated as this is the first thing I have developed using php! :?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

http://php.net/ldap

As for getting the logged in user, if they log in to the web page it's far more reliable. On Windows networks you may get a REMOTE_USER entry in the $_SERVER array.. but that would depend on a lot of things..
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

LDAP isn't necessary here. You could use it for authentication, but it's not practical for seeing who's logged in. A database is better suited for that. A directory services (which LDAP is used to access) purpose is to store lots of information - not have it easily and quickly accessed.

When a person logs in, just capture what their username is and apply that to the filter.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply