Using PHP to get computer name / login (active directory) name?
Hey, my manager suggested that he would like to be able to track certain key transactions by saving the computer name and active directory login name of whomever made said transactions.
I was able to get... something (computer name I think?) using this:
Code:
gethostbyaddr($_SERVER['REMOTE_ADDR'])
Not really sure to go from here, or if getting all of this information through PHP is even possible. I can totally see why it maybe wouldn't be for an Internet application for user privacy reasons, but this would be running on our intranet where we have the "right" to know who is doing what.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Unfortunately I don't totally understand much about networking / our network. I do know that all of the workstations that would be accessing the php scripts are Windows machines, and the server running the script is a Linux machine.
It's stuff I've never worked with, so can't really help much, but I suspect you're looking at doing something with the LDAP functions.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
If you want a seamless logon experience, you need to implement "Windows Authentication" (NTLM). For that, you might start by looking into this little library:
Bookmarks