Long story short, I'm looking for a way to insert users into database, that are read from LDAP (that part is easy) automatically when a user accesses a page.
I want to automatically fetch the user's machine name, and then fetch user details from LDAP with that machine name.
And I'm stuck at the very first step - fetching user's machine name. Currently using PHP 5.4 and Apache.
In PHP, you can use $_SERVER['REMOTE_ADDR'] to get the IP address of the remote client. Using this use gethostbyaddr() to get the IP into a hostname (but that IPs should have a reverse mapping configured else it will not give desired result)