I was given a task to develop a php login page. But my boss wants me to make it more "user friendly" in a manner that they won't have to write in or remember their usernames and passwords, which they
already have too many. So he suggested to use windows login on my php login page. i.e. all the Windows User accounts that have been created & stored in the Windows can be able access it whether they have logged in or not.
I'm developing under Apache 2.2 & PHP 5.2.
And i know it can be done through either NTML or LDAP operations of php/apache.
But i have no clue how to do it. I have done all the searching for hours & hours. but couldnt find what i need.
It would be really gr8 if some please help me here with some exact coding that i need.
so far i have achieved this.
<html>
<head> </head>
<body>
<!--When the submit button is NOT pushed-->
<!--this will show the form-->
<?php
if(!isset($_POST['Submit']))
{
?>
<form name="form1" method="post" action="">
Username<input type="text" name="username" id="username" >
Password<input type="password" name="password" id="password" >
<input type="submit" name="Submit" id="Submit" value="Submit">
</form>
<!--When the submit button is pushed-->
<!--this will do the validation and processing-->
<?php
}
else
{
// using ldap bind
$ldaprdn = $_POST['username']; // ldap rdn or dn
$ldappass = $_POST['password']; // associated password
// connect to ldap server
$ldapconn = ldap_connect("ldap.example.com")
or die("Could not connect to LDAP server.");
if ($ldapconn)
{
// binding to ldap server
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
// verify binding
if ($ldapbind)
{echo "LDAP bind successful...";}
else
{echo "LDAP bind failed...";}
}
}
?>
</body> </html>
please help me if u know atleast anything about it.
Thanks
already have too many. So he suggested to use windows login on my php login page. i.e. all the Windows User accounts that have been created & stored in the Windows can be able access it whether they have logged in or not.
I'm developing under Apache 2.2 & PHP 5.2.
And i know it can be done through either NTML or LDAP operations of php/apache.
But i have no clue how to do it. I have done all the searching for hours & hours. but couldnt find what i need.
It would be really gr8 if some please help me here with some exact coding that i need.
so far i have achieved this.
<html>
<head> </head>
<body>
<!--When the submit button is NOT pushed-->
<!--this will show the form-->
<?php
if(!isset($_POST['Submit']))
{
?>
<form name="form1" method="post" action="">
Username<input type="text" name="username" id="username" >
Password<input type="password" name="password" id="password" >
<input type="submit" name="Submit" id="Submit" value="Submit">
</form>
<!--When the submit button is pushed-->
<!--this will do the validation and processing-->
<?php
}
else
{
// using ldap bind
$ldaprdn = $_POST['username']; // ldap rdn or dn
$ldappass = $_POST['password']; // associated password
// connect to ldap server
$ldapconn = ldap_connect("ldap.example.com")
or die("Could not connect to LDAP server.");
if ($ldapconn)
{
// binding to ldap server
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
// verify binding
if ($ldapbind)
{echo "LDAP bind successful...";}
else
{echo "LDAP bind failed...";}
}
}
?>
</body> </html>
please help me if u know atleast anything about it.
Thanks