1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| <?php
include ('param_cas.php');
include ('param_ldap.php');
//---------------------------- Connexion a LDAP pour récupération du group_unix -----------------------------------------------------//
$connect = ldap_connect($ldap_host, $ldap_port)
or die( "Impossible de se connecter au serveur LDAP $ldap_host" );
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
if ($connect){
$bind = ldap_bind($connect, $ldap_user, $ldap_pass)
or die(">>Impossible de se connecter sur $ldap_host<<");
$filtre = "uid=$utilisateur";
$restriction = array( "groupeunix");
$search = ldap_search($connect,"ou=annuaire,dc=entreprise,dc=fr" ,$filtre,$restriction);
$resultat = ldap_get_entries($connect, $search);
echo "<select name='liste_groupe'>";
for ($i=0; $i<$resultat["count"]; $i++){
for ($j=0; $j<10; $j++){
$group_unix[$j] = $resultat[$i]["groupeunix"][$j]."</br>";
echo "<option value=$group_unix[$j]>$group_unix[$j]</option>";
}
}
echo "</select>";
// Fermeture de la connexion
ldap_close($connect);
}
?>
<html>
<!--Une fois la connexion effectuée, on arrive à la page d'insertion de nouvelles fiches d'adresse -->
<head>
<title>Import de carnets d'adresses</title>
</head>
<a href ="index.php">Retour à l'index</a>
<body>
<table border="0" valign="center" cellpadding="0" cellspacing="0" height="100%" width="100%">
<form enctype="multipart/form-data" action="./scripts_perl/thunderbird_to_ldif.cgi" method="post">
<tr>
<td align="center">
<tr>
<td nowrap>
<font face="Arial,Helvetica">
<b>Liste des groupes unix disponibles :</b>
</font>
</td>
<td>ENDROIT OU JE VEUX AFFICHER LA LISTE
</td>
</tr>
...
</html> |
Partager