".gettext("Annuaire")."\n";
// Convertion en utf_8
$nom = utf8_encode($nom);
$fullname = utf8_encode($fullname);
// Construction du filtre de la branche people
if ($nom && !$fullname) {
// Recherche sur sn
if ($priority_name=="contient") {
$filter_people="(sn=*$nom*)";
} elseif($priority_name=="commence") {
$filter_people="(sn=$nom*)";
} else {
$filter_people="(sn=*$nom)";
}
} elseif ($fullname && !$nom) {
// Recherche sur cn
if ($priority_surname=="contient") {
$filter_people="(cn=*$fullname*)";
} elseif($priority_surname=="commence") {
$filter_people="(cn=$fullname*)";
} else {
$filter_people="(cn=*$fullname)";
}
} elseif ($fullname && $nom) {
// Recherche sur sn ET cn
if ($priority_name=="contient") {
if ($priority_surname=="contient") {
$filter_people="(&(sn=*$nom*)(cn=*$fullname*))";
} elseif($priority_surname=="commence") {
$filter_people="(&(sn=*$nom*)(cn=$fullname*))";
} else {
$filter_people="(&(sn=*$nom*)(cn=*$fullname))";
}
} elseif($priority_name=="commence") {
if ($priority_surname=="contient") {
$filter_people="(&(sn=$nom*)(cn=*$fullname*))";
} elseif($priority_surname=="commence") {
$filter_people="(&(sn=$nom*)(cn=$fullname*))";
} else {
$filter_people="(&(sn=$nom*)(cn=*$fullname))";
}
} else {
if ($priority_surname=="contient") {
$filter_people="(&(sn=*$nom)(cn=*$fullname*))";
} elseif($priority_surname=="commence") {
$filter_people="(&(sn=*$nom)(cn=$fullname*))";
} else {
$filter_people="(&(sn=*$nom)(cn=*$fullname))";
}
}
}
// Remplacement de *** ou ** par *
$filter_people = preg_replace("/\*\*\*/","*",$filter_people);
$filter_people = preg_replace("/\*\*/","*",$filter_people);
if ($filter_people && !$classe) {
// recherche dans la branche People
#$TimeStamp_0=microtime();
$users = search_people ($filter_people);
#$TimeStamp_1=microtime();
// Affichage menu haut de page
aff_trailer("3");
#############
# DEBUG #
#############
#echo "debug :Temps de recherche = ".duree($TimeStamp_0,$TimeStamp_1)." s
";
#############
# Fin DEBUG #
#############
if (count($users)) {
if (count($users)==1) {
echo "
".count($users)."".gettext(" utilisateur répond à ces critères de recherche")."
\n"; } else { echo "".count($users)."".gettext(" utilisateurs répondent à ces critères de recherche")."
\n"; } echo "".count($people)."".gettext(" utilisateur répond à ces critères de recherche.")."
\n"; } else { echo "".count($people)."".gettext(" utilisateurs répondent à ces critères de recherche.")."
\n"; } // affichage des resultats for ($loop=0; $loop < count($people); $loop++) { if ( $people[$loop]["group"] != $people[$loop-1]["group"]) { echo "Classe : ".$people[$loop]["group"]."