author | Bettina Schwarzer |
Fri, 05 Feb 2016 14:03:40 +0100 | |
changeset 44 | d652bbba2d43 |
parent 41 | 9c668cd391fa |
permissions | -rw-r--r-- |
40 | 1 |
<?php |
2 |
||
3 |
/** |
|
4 |
* @author Bettina Schwarzer - Fritz-Haber-Institut |
|
5 |
* @copyright 08/2013 |
|
6 |
* |
|
7 |
* Suche UID aus LDAP |
|
8 |
*/ |
|
9 |
||
10 |
error_reporting(E_ALL ^ E_NOTICE); |
|
11 |
||
12 |
?> |
|
13 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
14 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
15 |
||
16 |
<head> |
|
17 |
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> |
|
18 |
<!-- <meta http-equiv="content-type" content="text/html; charset=utf-8" /> --> |
|
19 |
<link href="/fhiiqm/css/db.css" rel="STYLESHEET" type="TEXT/CSS" /> |
|
20 |
||
21 |
<title>LDAP + uid-Suche</title> |
|
22 |
</head> |
|
23 |
<body onload="document.flogin.user.focus();"> |
|
24 |
<div align="center"> |
|
25 |
<h3>Ermittlung userid zu Mitarbeiter FHI</h3> |
|
26 |
</div> |
|
27 |
<?php |
|
28 |
$user = $_POST["user"]; |
|
29 |
if (!isset($user) && !$user) |
|
30 |
{ |
|
31 |
?> |
|
32 |
<div align="center"> |
|
41
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
33 |
<p>Bitte geben Sie Nachname und/oder Vorname des gesuchten Mitarbeiters ein.</p> |
40 | 34 |
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="flogin"> |
35 |
<table border="0" cellspacing="1" cellpadding="0" bgcolor="#000066"><tr><td bgcolor="#e0e0e0"> |
|
36 |
<table border="0" cellspacing="2" cellpadding="4"> |
|
37 |
<tr bgcolor="#DEDFE1"><td>Nachname</td> |
|
38 |
<td valign="top"><input type="text" name="user[sn]" id="user" size="20" value="<?php echo $user['sn']; ?>"/> |
|
39 |
</td> |
|
40 |
</tr> |
|
41 |
<tr bgcolor="#F8F8F8"><td>Vorname</td> |
|
42 |
<td valign="top"><input type="text" name="user[gn]" size="20" value="<?php echo $user['gn']; ?>"/> |
|
43 |
</td> |
|
44 |
</tr> |
|
45 |
<tr bgcolor="#DEDFE1"><td> </td> |
|
46 |
<td><input class="button" type="submit" name="user[ok]" value=" suchen " /> |
|
47 |
</td> |
|
48 |
</tr> |
|
49 |
</table> |
|
50 |
</td></tr></table> |
|
51 |
</form> |
|
52 |
</div> |
|
53 |
<?php |
|
54 |
} |
|
55 |
else |
|
56 |
{ |
|
57 |
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/conf.inc.php"); |
|
58 |
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php"); |
|
59 |
$sn = $user["sn"]; |
|
60 |
$gn = $user["gn"]; |
|
41
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
61 |
$info = ldap_search_uid($sn,$gn); |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
62 |
if (isset($info) && count($info)) |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
63 |
{ |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
64 |
for ($i=0; $i<count($info); $i++) |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
65 |
{ |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
66 |
$uid[$i] = $info[$i][0]; |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
67 |
$cn[$i] = $info[$i][1]; |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
68 |
$mail[$i] = $info[$i][2]; |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
69 |
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>"; |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
70 |
} |
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
71 |
} |
40 | 72 |
else |
73 |
echo "<p class='red'> '$gn $sn' hat keine userid im FHI.</p>"; |
|
74 |
||
41
9c668cd391fa
+ Gast als MA-Typ, Erweiterungen Projekt, Key, Telefonliste
Bettina Schwarzer
parents:
40
diff
changeset
|
75 |
echo "<p><br /> <a href='".$_SERVER['PHP_SELF']."'>weitere userid ermitteln</a></p>"; |
40 | 76 |
} |
77 |
||
78 |
?> |
|
79 |
</body> |
|
80 |
</html> |