Bonjour

Je transmet mes recherches pour savoir d'où vient le problème :

J'utilise cette fonction qui me crée un fichier texte pour essayer de rendre GEPI un peu plus verbeux :
file_put_contents('ztoto.txt', "nom_photo:$nom_photo\n", FILE_APPEND | LOCK_EX); => me crée un fichier ztoto.txt avec les valeur saisit entre double cote.

Dans mod_trombinoscope/trombinosopes.php :

$nom_photo = nom_photo($id_photo_trombinoscope[$i],$repertoire);

file_put_contents('ztoto.txt', "nom_photo:$nom_photo\n", FILE_APPEND | LOCK_EX);

                                $photo = $nom_photo;

if (($nom_photo) and (file_exists($photo))) {
$valeur=redimensionne_image($photo);
                                } else {
$valeur[0]=getSettingValue("l_max_aff_trombinoscopes");
$valeur[1]=getSettingValue("h_max_aff_trombinoscopes");
                                }

                                $lien_upload_propose="n";
if(($action_affiche=='classe')||($action_affiche=='groupe')) {
if(($_SESSION['statut']=='administrateur')||($_SESSION['statut']=='scolarite')||
(($_SESSION['statut']=='cpe')&&(getSettingAOui('CpeAccesUploadPhotosEleves')))) { echo "<a href=\"#\" onclick=\"afficher_div_upload_photo('".$login_trombinoscope[$i]."','".addslashes($nom_es." ".$prenom_es)."');afficher_div('div_upload_photo','y',-20,20);return false;\" title=\"Téléverser une (nouvelle) photo pour $alt_nom_prenom_aff\">";
$lien_upload_propose="y";
                                        }
                                }
                                echo "<img src='";
file_put_contents('ztoto.txt', "id_photo_trombiniscope:$id_photo_trombinoscope[$i],repertoire:$repertoire,nom_photo:$nom_photo et photo:$photo\n\n", FILE_APPEND | LOCK_EX); if (($nom_photo) and (file_exists($photo))) {
                                        echo $photo;
                                }
                                else {
echo "images/trombivide.jpg";
=> il m'affiche à chaque fois le point d'interrogation car $nom_photo est vide.

Dans /lib/share.inc.php, la fonction nom_photo :

function nom_photo($_elenoet_ou_login,$repertoire="eleves",$arbo=1) {
    global $mysqli;
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', " Err00 : function nom_photo elenoet_ou_login: $_elenoet_ou_login,repertoire : $repertoire, arbo : $arbo\n", FILE_APPEND | LOCK_EX);

        if ($arbo==2) {$chemin = "../";} else {$chemin = "";}
        if (($repertoire != "eleves") and ($repertoire != "personnels")) {
                return NULL;
                die();
        }
        if (getSettingValue("active_module_trombinoscopes")!='y') {
                return NULL;
                die();
        }
                $photo=NULL;

        // En multisite, on ajoute le répertoire RNE
if (isset($GLOBALS['multisite']) AND $GLOBALS['multisite'] == 'y') {
                  // On récupère le RNE de l'établissement
      $repertoire2=$_COOKIE['RNE']."/";
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', " Err01 : multisite repertoire 2 : $repertoire2 \n", FILE_APPEND | LOCK_EX);

        }else{
          $repertoire2="";
        }


        // Cas des élèves
        if ($repertoire == "eleves") {

                if($_elenoet_ou_login!='') {

                        // on vérifie si la photo existe

if (isset($GLOBALS['multisite']) AND $GLOBALS['multisite'] == 'y') { // En multisite, on recherche aussi avec les logins if (isset($GLOBALS['multisite']) AND $GLOBALS['multisite'] == 'y') {
                                        // On récupère le login de l'élève
$sql = 'SELECT login FROM eleves WHERE elenoet = "'.$_elenoet_ou_login.'"'; $query = mysqli_query($mysqli, $sql);
                                        $obj = $query->fetch_object();
                                        $_elenoet_ou_login = $obj->login;
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err02 : elenoet_ou_login: $_elenoet_ou_login\n", FILE_APPEND | LOCK_EX);
                                }
                        }

if(file_exists($chemin."../photos/".$repertoire2."eleves/".encode_nom_photo($_elenoet_ou_login).".jpg")) {
$photo=$chemin."../photos/".$repertoire2."eleves/".encode_nom_photo($_elenoet_ou_login).".jpg";
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err03 : encode_nom_photo : $photo\n", FILE_APPEND | LOCK_EX);

                        }
                        else {
if(file_exists($chemin."../photos/".$repertoire2."eleves/".sprintf("%05d",encode_nom_photo($_elenoet_ou_login)).".jpg")) {
$photo=$chemin."../photos/".$repertoire2."eleves/".sprintf("%05d",encode_nom_photo($_elenoet_ou_login)).".jpg";
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err04 : encode_nom_photo%05d : $photo\n", FILE_APPEND | LOCK_EX);
                                } else {
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err0 : Je passe ici \n", FILE_APPEND | LOCK_EX);
                                        for($i=0;$i<5;$i++){
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err0 : Je passe dans la boucle elenoet_ou_login : $_elenoet_ou_login i: $i\n", FILE_APPEND | LOCK_EX);
if(mb_substr(encode_nom_photo($_elenoet_ou_login),$i,1)=="0"){
$test_photo=mb_substr($_elenoet_ou_login,$i+1);
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "ErrTestPhoto : $test_photo \n", FILE_APPEND | LOCK_EX); if(($test_photo!='')&&(file_exists($chemin."../photos/".$repertoire2."eleves/".$test_photo.".jpg"))) {
$photo=$chemin."../photos/".$repertoire2."eleves/".$test_photo.".jpg";
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err05 : photoSinon : $photo\n", FILE_APPEND | LOCK_EX);
break;
                                                        }
                                                }
                                        }
                                }
                        }

                }
        }
        // Cas des non-élèves
        else {

$_elenoet_ou_login = md5(mb_strtolower($_elenoet_ou_login));
if(file_exists($chemin."../photos/".$repertoire2."personnels/$_elenoet_ou_login.jpg")){
$photo=$chemin."../photos/".$repertoire2."personnels/$_elenoet_ou_login.jpg";
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err06 : photo non eleve ??? : $photo\n", FILE_APPEND | LOCK_EX);
                        } else {
                                $photo = NULL;
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err07 : photo NULL ?? : $photo\n", FILE_APPEND | LOCK_EX);
                }
        }
file_put_contents('monSite/gepi/mod_trombinoscopes/ztoto.txt', "Err08 : valeur de retour : $photo\n", FILE_APPEND | LOCK_EX);
        return $photo;
}

Dans mon fichier ztoto.txt j'obtiens :

Err00 : function nom_photo elenoet_ou_login: 2034,repertoire : eleves, arbo : 2
 Err01 : multisite repertoire 2 : 0141420T/
Err02 : elenoet_ou_login: pommier_m
Err0 : Je passe ici
Err0 : Je passe dans la boucle elenoet_ou_login : pommier_m i: 0
Err0 : Je passe dans la boucle elenoet_ou_login : pommier_m i: 1
Err0 : Je passe dans la boucle elenoet_ou_login : pommier_m i: 2
Err0 : Je passe dans la boucle elenoet_ou_login : pommier_m i: 3
Err0 : Je passe dans la boucle elenoet_ou_login : pommier_m i: 4
Err08 : valeur de retour :

J'ai de plus essayé en activant l'encodage des fichiers dans :
- Modules / paramétrage /trombinoscopes

Sans succès.

Actuellement les photos téléversées on bien le nom correspondant à elenoet_ou_login de l'élève.

Par contre quand on souhaite les afficher, GEPI ne peut les afficher encodage activé ou non.

Quel est la démarche pour utiliser correctement le trombinoscope?

Est-ce un bug ou une mauvaise configuration?

cordialement,


--
        *Bertrand LODS*
DSI4 / Pole Web
Division des systèmes d'information
Tél : 02 31 30 15 94
bertrand.l...@ac-caen.fr <mailto:bertrand.l...@ac-caen.fr> | www.ac-caen.fr <http://www.ac-caen.fr>
*Rectorat de l'académie de Caen*
168, rue Caponière - BP 46184 - 14061 Caen cedex | Accès et horaires <http://www.ac-caen.fr/acceshoraires/>


_________________________________________________________________________________
Documentation Gepi en ligne : http://www.sylogix.org/projects/gepi/wiki
Pour modifier ou r�silier votre abonnement � cette liste :
https://lists.sylogix.net/mailman/listinfo/gepi-users

Répondre à