Stewart Posted August 18, 2006 Share Posted August 18, 2006 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 More sharing options...
reportingsjr Posted August 18, 2006 Share Posted August 18, 2006 Umm, this isnt really php, its more of one of the C languages.. Link to comment Share on other sites More sharing options...
aspnetguy Posted August 18, 2006 Share Posted August 18, 2006 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 More sharing options...
Stewart Posted August 18, 2006 Author Share Posted August 18, 2006 drat. ok, thanks anyway Link to comment Share on other sites More sharing options...
aspnetguy Posted August 18, 2006 Share Posted August 18, 2006 Umm, this isnt really php, its more of one of the C languages..there is only one language called C ...but I understand what you mean Link to comment Share on other sites More sharing options...
Stewart Posted August 26, 2006 Author Share Posted August 26, 2006 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 More sharing options...
murfitUK Posted August 27, 2006 Share Posted August 27, 2006 There's some suggestions here:http://www.thescripts.com/forum/thread2524.html Link to comment Share on other sites More sharing options...
Stewart Posted August 27, 2006 Author Share Posted August 27, 2006 i must have read that article like 20 times. i'm als gonna try the vbscript in the last article and see if that will get it Link to comment Share on other sites More sharing options...
justsomeguy Posted August 28, 2006 Share Posted August 28, 2006 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 More sharing options...
Stewart Posted August 28, 2006 Author Share Posted August 28, 2006 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 More sharing options...
justsomeguy Posted August 28, 2006 Share Posted August 28, 2006 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 More sharing options...
Stewart Posted August 28, 2006 Author Share Posted August 28, 2006 i figured that you can conect to an Active Directory server somewhere else, but if i have the username of the computer of someone accessing the website, can i ask the active directory server who is logged on to that machine? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 28, 2006 Share Posted August 28, 2006 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 More sharing options...
Stewart Posted August 28, 2006 Author Share Posted August 28, 2006 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 More sharing options...
Stewart Posted August 30, 2006 Author Share Posted August 30, 2006 :-( still cant get anything to work Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now