Ash_EP3
Member
Registered: 15th May 07
Location: Melksham, Wiltshire
User status: Offline
|
Hi people,
Me and the IT Officer need help in terms of getting the windows client username, to display on the .php page!?
We are using:
- Apache 2.2
- MySQL5
- PHP5
We have tried coding used by others on the net (I have tried PHP freaks) and still no luck
HEEEEEEEEEEEEEEEEEEEEEEELP!
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
Try _SERVER["REMOTE_USER"] - but i think it requires the client to authenticate with the apache server. Although when it does work, it returns a windows 2k style login ie: Domain\Username rather than username@domain etc.
However, i would use javascript to grab the username and then parse it to php using php parameters - ie: index.php?usr=bob etc then just to a phpget/post on the url and grab the username. Could run a basic encrypt on the username string if you worried about people seeing it.
Below is javascript that grabs the windows username. Just use a javascript refresh and construct the url with the username variable!
code:
var wshshell = new ActiveXObject("wscript.shell");
var username = wshshell.ExpandEnvironmentStrings("%username%");
|
Ash_EP3
Member
Registered: 15th May 07
Location: Melksham, Wiltshire
User status: Offline
|
Thanks Dom, however I am not sure this would work, we are not allowed to use ActiveX
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
If that doesnt work then you're limited to using the remote_user, but ideally you'll have to run client side script to get the username.
Is it not possible for the client to enter their login details? Would mean checking it again AD records but once you do that you can store the username as a cookie/session etc for further use!
|
Tim
Site Administrator
Registered: 21st Apr 00
User status: Offline
|
Use mod_auth_sspi for Windows transparent authentication. The Windows username would then be available as getenv(LOGON_USER)...
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
And reply to your other thread about databases which we masterfully fixed for you
|
xa0s
Banned
Registered: 4th Mar 08
Location: Dartford, Kent Car: Turbo'd Fabia vRS
User status: Offline
|
quote: Originally posted by Tim
Use mod_auth_sspi for Windows transparent authentication. The Windows username would then be available as getenv(LOGON_USER)...
You know your shit!
|
Ash_EP3
Member
Registered: 15th May 07
Location: Melksham, Wiltshire
User status: Offline
|
quote: Originally posted by Ian
And reply to your other thread about databases which we masterfully fixed for you
thanks Ian, Tim, Luke & Dom - Me and the IT Officer have both been looking around at other "geeky" forums and on Google etc but haven't had a lot of luck
Are we right in thinking that we just copy the module (mod_auth_sspi) over into the modules folder on Apache? and then tell the config file to load up the module correctly??? (just a tad unsure )
[Edited on 26-06-2008 by S214_UPP]
|