mr.web_developer Posted April 5, 2011 Share Posted April 5, 2011 Hi all Good morning I did connect to the Active Dirctroy using PHP $ldapHost = "ldap://XXX.com"; $ldapPort = "389"; $ldapUser ="[email protected]"; $ldapPswd ="XXX"; $ldapLink =ldap_connect($ldapHost, $ldapPort) or die("Can't establish LDAP connection"); ldap_bind($ldapLink,$ldapUser,$ldapPswd) or die("Can't bind to server."); it's working well but how can I print the username I mean since I'm connected with Active Dirctory I want any user who enter the webpage it will print his name that stored in Active Dirctory thank you Quote Link to comment https://forums.phpfreaks.com/topic/232730-problem-with-getting-the-username-in-active-dirctory/ Share on other sites More sharing options...
gizmola Posted April 5, 2011 Share Posted April 5, 2011 That is not possible. You can pull information from AD via ldap but there is no magical association that will occur that tells you a particular user who is browsing a page is even logged in. There is no intrinsic connection between the OS user and browser instance. Quote Link to comment https://forums.phpfreaks.com/topic/232730-problem-with-getting-the-username-in-active-dirctory/#findComment-1197049 Share on other sites More sharing options...
mr.web_developer Posted April 5, 2011 Author Share Posted April 5, 2011 Thank you for your replay but in the institustion I'm working on some developers did ASP websites and when you enter it, it will show your Active Dirctory name just by using one command so I think it's possible but with PHP it's diffrent story waiting if somebody know how to do it Quote Link to comment https://forums.phpfreaks.com/topic/232730-problem-with-getting-the-username-in-active-dirctory/#findComment-1197064 Share on other sites More sharing options...
gizmola Posted April 5, 2011 Share Posted April 5, 2011 If they used an activex control that might be possible. It is not part of ldap. Quote Link to comment https://forums.phpfreaks.com/topic/232730-problem-with-getting-the-username-in-active-dirctory/#findComment-1197067 Share on other sites More sharing options...
mr.web_developer Posted April 5, 2011 Author Share Posted April 5, 2011 thank you for the information so is there any sloution even out of ldap ? Quote Link to comment https://forums.phpfreaks.com/topic/232730-problem-with-getting-the-username-in-active-dirctory/#findComment-1197070 Share on other sites More sharing options...
gizmola Posted April 5, 2011 Share Posted April 5, 2011 No. An active directory user is a microsoft operating system specific function that exists at an entirely different network layer and protocol from the WWW. There's a couple of techniques that *might* work for you in this thread: http://stackoverflow.com/questions/168610/can-you-get-a-windows-ad-username-in-php Quote Link to comment https://forums.phpfreaks.com/topic/232730-problem-with-getting-the-username-in-active-dirctory/#findComment-1197084 Share on other sites More sharing options...
mr.web_developer Posted April 5, 2011 Author Share Posted April 5, 2011 Thank you nothing helped me in the url which you gave me I think this is the end of it I have ti give up Quote Link to comment https://forums.phpfreaks.com/topic/232730-problem-with-getting-the-username-in-active-dirctory/#findComment-1197152 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.