From a682e68eb9e1bde3e688595eff736090ab08f07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Bousqui=C3=A9?= Date: Fri, 23 Nov 2018 15:37:52 +0100 Subject: [PATCH] trombino ! --- .gitignore | 1 + admin/default.css | 13 ++++++++++--- admin/reload_ma_salle.php | 14 ++++++++++++-- admin/reload_salles.php | 6 ++---- admin/salles/index.php | 21 +++++++++++++++++++-- admin/winlog_admin_conf.php.example | 4 ++++ 6 files changed, 48 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index eb9e9ec..213f348 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ CAS/ jquery/ +remote/ ldap_conf.php password.php winlog_admin_conf.php diff --git a/admin/default.css b/admin/default.css index ff8701c..0f37aa7 100644 --- a/admin/default.css +++ b/admin/default.css @@ -164,8 +164,6 @@ a.anchor { .trombi img { display: none; - width: 200px; - height: 200px; } .trombi:hover { @@ -174,8 +172,17 @@ a.anchor { .trombi:hover img{ display: block; + width: 150px; + height: 150px; } .connexion:hover { background-color: khaki; -} \ No newline at end of file +} + + +.pc.conn:hover { + width: 150px; + height: 230px; + z-index: 1; +} diff --git a/admin/reload_ma_salle.php b/admin/reload_ma_salle.php index a6873e4..1aaa01e 100644 --- a/admin/reload_ma_salle.php +++ b/admin/reload_ma_salle.php @@ -2,6 +2,10 @@ include_once("winlog_admin_conf.php"); include_once("connexions.php"); include_once("client_http.php"); +$trombino = false; +if ($trombino_url != "") { + $trombino = true; +} // Fonction de récupération de la liste des salles bloquées sur SquidGuard Function Get_salles_bloquees($url) { @@ -64,13 +68,19 @@ foreach($connexions_de_ma_salle as $con) { $cpt = Compte($username); $style = ""; $fin_style = ""; + $div_trombi = "
"; + $fin_div = "
"; + if ($trombino) { + $url_photo = $trombino_url."/".$username.$trombino_extension_fichier; + $div_trombi = "
"; + } if ($cpt[2]=="Enseignant") { $style = ""; $fin_style=""; } echo ""; echo "".$style.$con["machine"].$fin_style.""; echo "".$style.date("H:i:s",$con["stamp"]).$fin_style.""; echo "".$style.$con["ip"].$fin_style.""; - echo "".$style.$username.$fin_style.""; - echo "".$style.$cpt[1]." ".$cpt[0].$fin_style.""; + echo "".$div_trombi.$style.$username.$fin_style.$fin_div.""; + echo "".$div_trombi.$style.$cpt[1]." ".$cpt[0].$fin_style.$ echo "".$style.$cpt[2].$fin_style.""; echo "\n"; } diff --git a/admin/reload_salles.php b/admin/reload_salles.php index 8711cff..037c9ea 100644 --- a/admin/reload_salles.php +++ b/admin/reload_salles.php @@ -9,9 +9,6 @@ $trombino = false; if ($trombino_url != "") { $trombino = true; } -if ($trombino) { - include_once('trombino.php'); -} $username = Username(); @@ -96,7 +93,8 @@ while ($mdc = current($machines_de_salle)) { $div_trombi = "
"; $fin_div = "
"; if ($trombino) { - $div_trombi = "
"; + $url_photo = $trombino_url."/".$username.$trombino_extension_fichier; + $div_trombi = "
"; } if ($cpt[2] == $lib_personnel) { $style = ""; diff --git a/admin/salles/index.php b/admin/salles/index.php index db7d733..df12570 100644 --- a/admin/salles/index.php +++ b/admin/salles/index.php @@ -4,6 +4,10 @@ header ('Content-Type: text/html; charset=utf-8'); include_once('../connexions.php'); include_once('../winlog_admin_conf.php'); include_once('../session.php'); +$trombino = false; +if ($trombino_url != "") { + $trombino = true; +} // récupération du user CAS pour autorisation $username = Username(); @@ -44,6 +48,11 @@ function Affiche_plan_salle(&$machines_de_la_salle, &$portes) { $date_now = time(); $machines_connectees = Connexion_machine(); + global $trombino; + global $trombino_url; + global $trombino_defaut_url; + global $trombino_extension_fichier; + echo('
'); // Affichage des machines @@ -84,7 +93,15 @@ function Affiche_plan_salle(&$machines_de_la_salle, &$portes) { } //
machine - $div = "
".$link.$machine."
".$style.$username.$fin_style."
".$ip."
"; + $class_trombi = ""; + $img_trombi = ""; + if ($trombino && $username != '') { + $class_trombi = ' trombi'; + $url_photo = $trombino_url."/".$username.$trombino_extension_fichier; + $img_trombi = ""; + } + //$user_affich = $username; + $div = "
".$link.$machine."
".$username.$img_trombi."
".$ip."
"; echo $div; } @@ -133,7 +150,7 @@ if ($profil > 0) { echo $form; } echo("

bleu : connecté  gris : inactif  jaune : inactif 10j  orange : inactif 20j  rouge : inactif 30j

"); - Affiche_plan_salle($machines_du_plan, $portes); + Affiche_plan_salle($machines_du_plan, $portes, $trombino); } else { // sinon on affiche un message diff --git a/admin/winlog_admin_conf.php.example b/admin/winlog_admin_conf.php.example index a486325..bf8f0bd 100644 --- a/admin/winlog_admin_conf.php.example +++ b/admin/winlog_admin_conf.php.example @@ -132,4 +132,8 @@ $wake_url = "http://10.5.0.15:81/wake.php"; // Laisser une chaîne vide si pas de trombinoscope disponible : // $trombino_url = ""; $trombino_url = "http://lamp.iut.rdz/trombi/photos/2019/"; +// image par défaut si pas de photo de l'utilisateur +$trombino_defaut_url = "http://lamp.iut.rdz/trombi/vr_tn_IUT_Rodez.jpg"; +// extension fichier image : le fichier image est de la forme username.extension +$trombino_extension_fichier = ".jpg"; ?>