| Current Path : /var/www/html/mmishra/indem/rgiit/rgiit/x/ |
| Current File : /var/www/html/mmishra/indem/rgiit/rgiit/x/qp.php |
<html>
<head>
<title>
User Information Look Up
</title>
</head>
<body>
<h1>
</h1>
<?
//$userid = $_POST["cn"];
$userid = "pchaturvedi_rb05";
//$project = $_POST["Projects"];
//$attr["Projects"] = $_POST["projects"];;
//$attr["cn"] = "punit";
print "<h1>LDAP Authentication for " . $userid. " </h1><p>";
$ldapserver = ldap_connect("172.16.1.5");
if(!$ldapserver)
{
print "<br>connection error";
exit(0);
}
$bind = ldap_bind($ldapserver,"dc=rgiita,dc=ac,dc=in","94507718240");
if(!$bind)
{
print "<br>bind error";
exit(0);
}
$base_dn = "DC=rgiita,DC=ac,DC=in";
$filter = "uid=" . $userid;
$inforequired = array(
"nickname",
"description",
"PermanentAddress",
"uid",
"mail",
"givenName",
"sn",
"cn", "mobile","userPassword","DateOfBirth","BloodGroup","CurrentAddress",
"WebPages","FatherName","LanguagesKnown","Hobbies","PlatformsUsed","Projects","SoftwaresUsed","Achievements");
$result = ldap_search($ldapserver,$user_dn,$filter,$inforequired);
$info = ldap_get_entries($ldapserver,$result);
//echo $info[0][0];
echo $info[0]["GivenName"][0]; echo "</br>";echo "</br>";
//echo $info[0]["cn"][0];
$user_dn=$info[0]["dn"];
//$bind = ldap_bind($ldapserver,$user_dn,$_POST['passwd']);
//if($bind){echo "</br>hi</br>";
//$s=ldap_mod_replace($ldapserver,$user_dn,$attr);
// //ldap_modify($ldapserver,$user_dn,$attr);
//}
//echo $info[0][1];echo "=";
//print_r($info); echo "</br>";echo "</br>";echo "</br>";
//echo $user_dn=$info[0]["dn"]; echo "</br>";
// if (TRUE == $s) {
// echo "The entry was successfully modified.";
//} else {
// echo "The entry could not be modified.";
//}
if($info["count"] == 0)
{
print "<p>No information available";
}
else
{
print "<table border=2><tr>"
. "<th>Name:"
. "<th>Nickname:"
. "<th>Father's Name:"
. "<th>E-Mail:"
. "<th>Date Of Birth"
. "<th>Web Page:"
. "<th>Telephone No.:"
. "<th>Blood Group:
. <th>Current Address:"
. "<th>Permanent Address:"
. "<th>Hobbies:"
. "<th>Projects:"
. "<th>Langues Known:"
. "<th>Platform Used:"
. "<th>Achievements:";
for($i=0;$i<$info["count"];$i++)
{
$row[$i] = "<tr>"
. "<td>" . $info[$i]["cn"][0]
. "<td>" . $info[$i]["nickname"][0]
. "<td>" . $info[$i]["fathername"][0]
. "<td>" . $info[$i]["mail"][0]
. "<td>" . $info[$i]["dateofbirth"][0]
. "<td>" . $info[$i]["webpages"][0]
. "<td>" . $info[$i]["mobile"][0]
. "<td>" . $info[$i]["bloodgroup"][0]
. "<td>" . $info[0]["currentaddress"][0]
. "<td>" . $info[0]["permanentaddress"][0]
. "<td>" . $info[0]["hobbies"][0]
. "<td>" . $info[0]["projects"][0]
. "<td>" . $info[0]["platformsused"][0]
. "<td>" . $info[0]["languagesknown"][0]
. "<td>" . $info[0]["achievements"][0];
}
sort($row);
for($i=0;$i<$info["count"];$i++) print $row[$i] . "\n";
print "</table>";
}
print "</body></html>";
echo $info[0]["sn"][1];
?>