Does anyone know of a way of getting the username and password from the windows logon into a PHP session?
I am using this method for an Intranet which I am currently working on.
Retrieving Windows Logon Username and Password??
Moderator: General Moderators
If the permissions of the web are set such as to disallow ananymous access then the logged on username can be trapped and put in a session using:
It is impossible to get the windows password into a php session (unless you ask for it on a php page!) as to use the password in any way you would have to know the windows encryption algorythm (as passwords are stored encrypted)
If you are using the windows login as security for certain parts of your intranet, the AUTH_USER should be all that you need.
Code: Select all
<?php
$_SESSIONї'UserName'] = getenv("AUTH_USER")
?>If you are using the windows login as security for certain parts of your intranet, the AUTH_USER should be all that you need.
LDAP
I belive it is possible to authenticate using a windows server via LDAP:
http://www.php.net/manual/en/ref.ldap.php
I've never done it, but it's worth looking into.
greg
http://www.php.net/manual/en/ref.ldap.php
I've never done it, but it's worth looking into.
greg