| Current Path : /var/www/html/mmishra/profile1/ |
| Current File : /var/www/html/mmishra/profile1/index.php.old1 |
<?php
//require("webanalyse/include/stats_main.inc");
//$stats = new init(true, 'webanalyse/'); // 2 params. true/false for activate or not, and the path
//of webanalyse.
?>
<HTML>
<HEAD>
<TITLE>IIIT Allahabad Web Profiles </TITLE>
<meta name=keywords content="IIIT Allahabad Student Profile Profiles Home Pages
Web Sites IT">
<meta name=description content="This Site contains the personal web pages of the
IIIT Allahabad Community. All IIITians are indexed.">
<meta name="author" content="Pankaj Trivedi" />
<link href="style.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY style="margin:0pt 0pt 0pt 0pt">
<center>
<img src="profile.jpg" alt="Profiles" width="70%" height="100"><img src="iiita.jpg" alt="IIITA" width="10%" height="100">
<table cellspacing="0" cellpadding="2" width='80%'>
<tr><td><font color=#FFFFFF>
The Institute provides webspace to each student of UG and PG programmes to host their profiles on the Internet. Most of the students take this facility to show their talent in web designing and web programming. Though its an official platform but the students are solely responsible for the content they have hosted on their homepage.
<div align='right'>
Visit <a href='http://www.iiita.ac.in/inner.php?conf=fac'>Faculty Profiles</a> on <a href='http://www.iiita.ac.in'>www.iiita.ac.in</a><br>
Students' profiles are managed programme wise in order of their batches. Please select batch year to list student profiles.<br>
</div></font></td></tr>
<tr><th>
Students Profiles Registered with LDAP
</th></tr>
<tr><td>
<table align='right'><tr><td>
<!-- SiteSearch Google -->
<form method="get" action="http://www.google.co.in/custom" target="google_window">
<table border="0" cellpadding='5' bgcolor="#ffffff" width="300">
<tr><td nowrap>
<input type="hidden" name="domains" value="www.iiita.ac.in"></input>
<input type="text" name="q" size="25" maxlength="255" value=""></input>
<input type="submit" name="sa" value="Google Search"></input>
<br>
<input type="radio" name="sitesearch" value="" checked="checked"></input>
<font size="-1" color="#000000">Web</font>
<input type="radio" name="sitesearch" value="www.iiita.ac.in"></input>
<font size="-1" color="#000000">www.iiita.ac.in</font>
<input type="hidden" name="client" value="pub-3425939762404892"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="5166621911"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="safe" value="active"></input>
<input type="hidden" name="flav" value="0000"></input>
<input type="hidden" name="sig" value="TVNWvQGVUaS9XRwO"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
<!-- SiteSearch Google -->
<!-- Profile Search -->
<form method="post" action="/#list">
<table border="0" cellpadding='5' bgcolor="#ffffff" width="300">
<tr><td nowrap>
<input type="text" name="myname" size="25" maxlength="255" value="<?=$myname?>"></input>
<input type="submit" name="submit" value="Profile Search"></input>
<br>
<input type="radio" name="filter" value="name" checked="checked"></input>
<font size="-1" color="#000000">Name</font>
<input type="radio" name="filter" value="mail"<?if ($_POST['filter']=='mail') echo " checked";?>></input>
<font size="-1" color="#000000">mail@iiita.ac.in</font>
</td></tr></table></form>
<!-- SiteSearch Google -->
</td></tr></table>
<?php
$ds = ldap_connect("ldap.iiita.ac.in");
$justthese = array('ou','sn','cn','labeledURI','description','mail','homeDirectory','uid','gecos');
$filter = "(|(ou=Students)(objectClass=organizationalUnit))";
$dn = "ou=Students,dc=iiita,dc=ac,dc=in";
$ldapsearch = ldap_search($ds, $dn, $filter, $justthese);
ldap_sort($ds, $ldapsearch, "ou");
$programs = ldap_get_entries($ds, $ldapsearch);
foreach($programs as $program){
if ($program['description'][0]){
$pg .= "<b>" . $program['description'][0] . '</b><br>';
$dn = "ou=" . $program['ou'][0] . ",ou=Students,dc=iiita,dc=ac,dc=in";
$ldapsearch = ldap_search($ds, $dn, $filter, $justthese);
ldap_sort($ds, $ldapsearch, "ou");
$batches = ldap_get_entries($ds, $ldapsearch);
$pg .= "Base DN: $dn<br>";
$pg .= "<dir>";
foreach($batches as $batch){
if ($batch['ou'][0]){
$dn1 = "ou=" . $batch['ou'][0] . "," . $dn;
$dn1 = str_replace("=", "*", $dn1, $i);
if ($batch['ou'][0] <> $program['ou'][0]) $lnk = "[ <a href='" . $_SERVER['PHP_SELF'] . "?program=" . encrypt($program['description'][0]) . "&mydn=$dn1#list'>" . strtoupper($batch['ou'][0]) . "</a> ]" . $lnk;
}
}
$pg .= $lnk . "</dir>";
}
$lnk = "";
}
echo "<a name='list'></a>";
if (isset($_REQUEST['mydn'])){
$mydn = $_REQUEST['mydn'];
$program = $_REQUEST['program'];
$dn = str_replace("*","=",$mydn,$i);
$filter = "objectClass=person";
$pg .= my_ldap_search($ds, $dn, $filter, $justthese, decrypt($program));
}elseif (isset($_POST['myname'])){
$myname = $_POST['myname'];
$searchon = $_POST['filter'];
//$dn = "ou=Students,dc=iiita,dc=ac,dc=in";
$dn = "dc=iiita,dc=ac,dc=in";
if ($searchon == 'name'){
//$filter = "(|(cn={$myname}*)(objectClass=person))";
$filter = "gecos={$myname}*";
}else{
//$filter = "(|(mail={$myname}*)(objectClass=person))";
$filter = "mail={$myname}*";
}
$pg .= my_ldap_search($ds, $dn, $filter, $justthese, $searchon . " Like " . $myname . "*");
}
echo $pg;
//===============================================================
function my_ldap_search($ds, $dn, $filter, $justthese, $title){
$ldapsearch = ldap_search($ds, $dn, $filter, $justthese);
ldap_sort($ds, $ldapsearch, "cn");
$students = ldap_get_entries($ds, $ldapsearch);
$pg = "<tr><th>$title<br>PROFILES LIST</th></tr>";
$pg .= "<tr><td>Click on the names below to visit student's profile page. For missing profiles server raises 'Forbidden' error. Thanks.</td></tr>";
$pg .= "<tr><td align='center'><table width='60%'>";
foreach($students as $student){
if ($student['cn'][0]){
$no++;
$name = $student['gecos'][0];
$roll_tok = strtok($student['cn'][0],"-");
while ($roll_tok !== false) {
$roll = $roll_tok;
$roll_tok = strtok(" \n\t");
}
if ($name == '') $name = ucfirst(str_replace("-"," ",$student['cn'][0],$i));
$pg .= "<tr><td>$no</td><td nowrap><a href='" . $student['uid'][0] . "'>" . $name . "</a></td><td>" . $roll . "</td><td>" . $student['mail'][0] . "</td><td>" . $student['labeledURI'][0] . "</td></tr>";
}
}
$pg .= "</table>";
return $pg;
}
function encrypt($str){
$str = str_replace(" ","@",$str,$i);
$str = str_replace("&",",",$str,$i);
$str = str_replace(".",";",$str,$i);
$str = str_replace("-","_",$str,$i);
$str = str_replace("=","*",$str,$i);
return $str;
}
function decrypt($str){
$str = str_replace("@"," ",$str,$i);
$str = str_replace(",","&",$str,$i);
$str = str_replace(";",".",$str,$i);
$str = str_replace("_","-",$str,$i);
$str = str_replace("*","=",$str,$i);
return $str;
}
?>
<!--
| <a href="index.php?batch=phd#list">Research Scholar</a> |
| <a href="index.php?batch=all#list">Everyone</a> |
-->
</td></tr>
</td></tr></table>
</center>
</BODY>
</HTML>