trombino !

This commit is contained in:
Jérôme Bousquié 2018-11-23 15:37:52 +01:00
parent a97582e33c
commit a682e68eb9
6 changed files with 48 additions and 11 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
CAS/
jquery/
remote/
ldap_conf.php
password.php
winlog_admin_conf.php

View File

@ -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;
}
.pc.conn:hover {
width: 150px;
height: 230px;
z-index: 1;
}

View File

@ -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 = "<div>";
$fin_div = "</div>";
if ($trombino) {
$url_photo = $trombino_url."/".$username.$trombino_extension_fichier;
$div_trombi = "<div class='trombi'><img src='".$url_photo."' onerror=\"this.error=null;this.src='".$trombino_defaut_url."';\">";
}
if ($cpt[2]=="Enseignant") { $style = "<b>"; $fin_style="</b>"; }
echo "<tr>";
echo "<td>".$style.$con["machine"].$fin_style."</td>";
echo "<td>".$style.date("H:i:s",$con["stamp"]).$fin_style."</td>";
echo "<td>".$style.$con["ip"].$fin_style."</td>";
echo "<td>".$style.$username.$fin_style."</td>";
echo "<td>".$style.$cpt[1]." ".$cpt[0].$fin_style."</td>";
echo "<td>".$div_trombi.$style.$username.$fin_style.$fin_div."</td>";
echo "<td>".$div_trombi.$style.$cpt[1]." ".$cpt[0].$fin_style.$
echo "<td>".$style.$cpt[2].$fin_style."</td>";
echo "</tr>\n";
}

View File

@ -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 = "<div>";
$fin_div = "</div>";
if ($trombino) {
$div_trombi = "<div class='trombi'><img src='".$trombino_url."/".$username.".jpg'>";
$url_photo = $trombino_url."/".$username.$trombino_extension_fichier;
$div_trombi = "<div class='trombi'><img src='".$url_photo."' onerror=\"this.error=null;this.src='".$trombino_defaut_url."';\">";
}
if ($cpt[2] == $lib_personnel) {
$style = "<b>";

View File

@ -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('<div id="plan">');
// Affichage des machines
@ -84,7 +93,15 @@ function Affiche_plan_salle(&$machines_de_la_salle, &$portes) {
}
// <div> machine
$div = "<div id='".$machine."' class='pc".$class_connexion.$class_jour."'>".$link.$machine."</a><br/>".$style.$username.$fin_style."<br/><span class='ip'>".$ip."</span></div>";
$class_trombi = "";
$img_trombi = "";
if ($trombino && $username != '') {
$class_trombi = ' trombi';
$url_photo = $trombino_url."/".$username.$trombino_extension_fichier;
$img_trombi = "<img src='".$url_photo."' onerror=\"this.error=null;this.src='".$trombino_defaut_url."';\">";
}
//$user_affich = $username;
$div = "<div id='".$machine."' class='pc".$class_connexion.$class_jour.$class_trombi."'>".$link.$machine."</a><br/>".$username.$img_trombi."<br/><span class='ip'>".$ip."</span></div>";
echo $div;
}
@ -133,7 +150,7 @@ if ($profil > 0) {
echo $form;
}
echo("<p><span class='conn'>bleu</span> : connecté &nbsp;<span class='pc'>gris</span> : inactif &nbsp;<span class='j10'>jaune</span> : inactif 10j &nbsp;<span class='j20'>orange</span> : inactif 20j &nbsp;<span class='j30'>rouge</span> : inactif 30j</p>");
Affiche_plan_salle($machines_du_plan, $portes);
Affiche_plan_salle($machines_du_plan, $portes, $trombino);
}
else {
// sinon on affiche un message

View File

@ -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";
?>