eludlow Posted January 22, 2007 Share Posted January 22, 2007 Chaps,Is there a simple way that PHP can retrieve (guessing with LDAP??) the username of a user viewing a page?Basically, am running a network, and AD pops up a php file when users log on, prompting them to download a file, which is locally hosted. I simply want to get the username of the domain user, and then append it to the end of a file, so I have a list of all users who have downloaded the file.LDAP is something I've been meaning to read up on for a while - but realised I'm supposed to have this script implemented by tomorrow morning - I see a fun evening VPNing onto the work network :(Many thanks in advance,Ed Ludlow Quote Link to comment https://forums.phpfreaks.com/topic/35246-ldap-get-active-directory-username/ Share on other sites More sharing options...
Orio Posted January 22, 2007 Share Posted January 22, 2007 I am not sure what you mean, but I think you should look into PHP's [url=http://il.php.net/features.http-auth]http authentication[/url].Orio. Quote Link to comment https://forums.phpfreaks.com/topic/35246-ldap-get-active-directory-username/#findComment-166499 Share on other sites More sharing options...
eludlow Posted January 22, 2007 Author Share Posted January 22, 2007 Thanks. I've just realised that wasn't a very clear account of what I'm trying to do, sorry!What happens is...A user logs onto an active directory domain. When they log on, a PHP file opens in a browser window (all done through group policies) which then asks users to download a certain file. What I am wondering is if PHP can get the user's AD username, and then with that I can write it to a log file so I know which domain users have downloaded the file.Hope that makes more sense!Thanks,Ed Ludlow Quote Link to comment https://forums.phpfreaks.com/topic/35246-ldap-get-active-directory-username/#findComment-166577 Share on other sites More sharing options...
redbullmarky Posted January 22, 2007 Share Posted January 22, 2007 i'm still lost. at which point in your process do you collect the username/password from the user to sign in in the first place? Quote Link to comment https://forums.phpfreaks.com/topic/35246-ldap-get-active-directory-username/#findComment-166583 Share on other sites More sharing options...
marcus Posted January 22, 2007 Share Posted January 22, 2007 If you're collecting a username by login, you're probably using cookies or sessions. Just store the username in either of those and do a mysql query when they download the file. Quote Link to comment https://forums.phpfreaks.com/topic/35246-ldap-get-active-directory-username/#findComment-166586 Share on other sites More sharing options...
redbullmarky Posted January 22, 2007 Share Posted January 22, 2007 UNLESS you mean (when you refer to running a network) the login page that you'd get if you set a password on Windows itself, not just a general web-based login screen or HTTP auth? If that's the case, I'm really not sure it's possible due to permissions looking at/reading the local filesystem.am i missing the point totally? Quote Link to comment https://forums.phpfreaks.com/topic/35246-ldap-get-active-directory-username/#findComment-166588 Share on other sites More sharing options...
eludlow Posted January 22, 2007 Author Share Posted January 22, 2007 The user logs onto the PC workstation via active directory, and then the PHP page opens automatically. It's the username they've logged onto AD with that I wish to have, either to tail on a file, or put in mySQL DB.E Quote Link to comment https://forums.phpfreaks.com/topic/35246-ldap-get-active-directory-username/#findComment-166590 Share on other sites More sharing options...
ShogunWarrior Posted January 22, 2007 Share Posted January 22, 2007 PHP mightn't have access to the login information at all. Quote Link to comment https://forums.phpfreaks.com/topic/35246-ldap-get-active-directory-username/#findComment-166597 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.