<?php
/**
* @author Bettina Schwarzer - Fritz-Haber-Institut
* @copyright 08/2013
*
* Suche UID aus LDAP
*/
error_reporting(E_ALL ^ E_NOTICE);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<!-- <meta http-equiv="content-type" content="text/html; charset=utf-8" /> -->
<link href="/fhiiqm/css/db.css" rel="STYLESHEET" type="TEXT/CSS" />
<title>LDAP + uid-Suche</title>
</head>
<body onload="document.flogin.user.focus();">
<div align="center">
<h3>Ermittlung userid zu Mitarbeiter FHI</h3>
</div>
<?php
$user = $_POST["user"];
if (!isset($user) && !$user)
{
?>
<div align="center">
<p>Bitte geben Sie Nachname und/oder Vorname des gesuchten Mitarbeiters ein.</p>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="flogin">
<table border="0" cellspacing="1" cellpadding="0" bgcolor="#000066"><tr><td bgcolor="#e0e0e0">
<table border="0" cellspacing="2" cellpadding="4">
<tr bgcolor="#DEDFE1"><td>Nachname</td>
<td valign="top"><input type="text" name="user[sn]" id="user" size="20" value="<?php echo $user['sn']; ?>"/>
</td>
</tr>
<tr bgcolor="#F8F8F8"><td>Vorname</td>
<td valign="top"><input type="text" name="user[gn]" size="20" value="<?php echo $user['gn']; ?>"/>
</td>
</tr>
<tr bgcolor="#DEDFE1"><td> </td>
<td><input class="button" type="submit" name="user[ok]" value=" suchen " />
</td>
</tr>
</table>
</td></tr></table>
</form>
</div>
<?php
}
else
{
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/conf.inc.php");
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
$sn = $user["sn"];
$gn = $user["gn"];
$info = ldap_search_uid($sn,$gn);
if (isset($info) && count($info))
{
for ($i=0; $i<count($info); $i++)
{
$uid[$i] = $info[$i][0];
$cn[$i] = $info[$i][1];
$mail[$i] = $info[$i][2];
echo "<p class='green'> '$gn $sn': $cn[$i] hat die userid <b>$uid[$i]</b> -> mail: <a href='mailto:$mail[$i]'>$mail[$i]</a></p>";
}
}
else
echo "<p class='red'> '$gn $sn' hat keine userid im FHI.</p>";
echo "<p><br /> <a href='".$_SERVER['PHP_SELF']."'>weitere userid ermitteln</a></p>";
}
?>
</body>
</html>