Jump to content

windows username


Stewart

Recommended Posts

i'm trying to design a php powered intranet site for a network. in order to complete part if this site, i need to find the network usernames of all the users who browse this site. all the computers run windows, including the server. (so no neat NDLM authentication module for apache/unix) if it is possible, i would be very grateful if someone could tell me how

Link to comment
Share on other sites

PHP can't do that. You would have to write a ActiveX or COM+ component then load it with javascript (not sure you might be able to load these in PHP).Note: ActiveX components only work in Internet Explorer...not sure about COM+

Link to comment
Share on other sites

  • 2 weeks later...

i dont suppose it would be possible to query the Active directory server with the local ip of the computer to get this information would it?EDIT:something i havent tried out yet - cant get at the server until monday. but i discovered this site: http://twiki.org/cgi-bin/view/Codev.WindowsInstallModNTLM i'm not sure if it will do what i am after or not

Link to comment
Share on other sites

You can use Active Directory. Active Directory includes Microsoft's implementation of a technology called LDAP. You can use LDAP to authenticate against an Active Directory server, although the syntax is a little confusing. I have some code to do this with ASP, but I haven't done it with PHP. Check this reference, especially the example and the user notes at the bottom:http://www.php.net/manual/en/ref.ldap.php

Link to comment
Share on other sites

i tried using the sspi module in apache, but because the webserver isnt teh same as the active directory server it would only auth the accounts that existed on the webserver and i couldnt get it to do otherwiseis it possible to query the server for teh username if i have the ip address they are currently logged onto using LDAP OR is it possible to configure SSPI to point to a different server to authenticate the user?

Link to comment
Share on other sites

With LDAP, you can specify which server to connect to, so you can even have one PHP server somewhere authenticate against an Active Directory server somewhere else. But, specifying the server is a little weird:$domain = "DC=www,DC=domain,DC=com";something like that.

Link to comment
Share on other sites

Well, you can't get the computer name with PHP unless you ask the user for it (in which case, you might as well just ask them for their username instead). You can get the IP address, but I don't think that Active Directory stores a list of IP address/user relationships. Maybe that information would exist if the Active Directory server was also both the domain controller and the DHCP server, but even then I think at most it would store IP address/computer information, not necessarily IP address/user information.You might do some testing and print out the value of $_SERVER['REMOTE_HOST'] and see what is says for different clients. If the remote host includes the computer name, and you can guarantee that the same user will always use the same computer (and no other users using that computer), then you could have your own database of computer/user relationships that you can check with the remote host.Actually, also check in $_SERVER['REMOTE_USER'], and see what is going on there.

Link to comment
Share on other sites

sorry - i meant can you query active directory with the ip rather than computer name$_SERVER['remote_host'] and remote user are empty unless sspi actually authenticates. what i'm trying to do at the moment is configure sspi to request the user's logon data, but accept it even if it can't validate it, but thats not working very well either.The internet security software on this network uses active directory to get the username somehow, although i dont have access to it so i can't find out how it does that

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...