fusion de Remote v1.4

This commit is contained in:
Jérôme Bousquié 2018-11-21 09:11:34 +01:00
parent 1c32685ce9
commit e71efc6638
23 changed files with 221 additions and 137 deletions

View File

@ -16,7 +16,7 @@ include_once('ldap_conf.php');
<link rel="stylesheet" media="screen" type="text/css" title="default" href="default.css">
</head>
<body>
<p class="header">WINLOG</p>
<p class="header">WINLOG-R</p>
<p style="text-align: center"><?php echo($auth_ldap_message); ?>
<form id="login" name="login" action="login_ldap.php" method="POST">
<div class="login"><label for="username">Compte : </label><input type="text" id⁼"username" name="username" /></div>

View File

@ -242,7 +242,7 @@ function Connexions_wifi() {
$db = db_connect();
$req_close = "UPDATE wifi SET close = 1 WHERE DATE(wifi_deb_conn) < CURDATE()";
$req = "SELECT wifi_id, wifi_username, wifi_ip, wifi_browser, wifi_deb_conn, prenom, nom FROM wifi, comptes WHERE close = 0 AND username = wifi_username ORDER BY wifi_deb_conn DESC";
$req = "SELECT wifi_id, wifi_username, wifi_ip, wifi_browser, wifi_deb_conn, prenom, nom, groupe FROM wifi, comptes WHERE close = 0 AND username = wifi_username ORDER BY wifi_deb_conn DESC";
db_query($db, $req_close);
$res = db_query($db, $req);
@ -255,6 +255,7 @@ function Connexions_wifi() {
$connexions_wifi[$i]["debut"] = $con[4];
$connexions_wifi[$i]["prenom"] = $con[5];
$connexions_wifi[$i]["nom"] = $con[6];
$connexions_wifi[$i]["groupe"] = $con[7];
$i++;
}

View File

@ -1,7 +1,7 @@
body {
margin: 0;
padding: 20px 20px 20px ;
background-color: transparent;
background-color: aliceblue;
color: #505050;
font-family: arial, helvetica, sans-serif ;
font-size: 12pt ;
@ -9,7 +9,7 @@ body {
td { padding-left: 30px; }
a{ text-decoration: none; color: cadetBlue;}
a{ text-decoration: none; color: royalblue;}
#menu_salles {
position: fixed;
@ -17,7 +17,7 @@ a{ text-decoration: none; color: cadetBlue;}
top: 0;
padding: 5px 20px;
width: 70%;
background-color: Beige;
background-color: palegoldenrod;
z-index: 1;
}

View File

@ -22,6 +22,15 @@ switch ($auth_mode) {
$username = phpCAS::getUser();
break;
case "LDAP":
session_start();
if (!isset($_SESSION['username'])) {
header('Location: authentification_ldap.php');
exit();
}
$username = $_SESSION['username'];
break;
default:
header('Location: interdit.php');
exit();
@ -50,7 +59,7 @@ if ($nb_archives > 0) {
<link rel="stylesheet" media="screen" type="text/css" title="default" href="default.css">
</head>
<body>
<p class="header">WINLOG</p>
<p class="header">WINLOG-R</p>
<p>compte : <i><?php echo($username); ?></i><br/>rôle : <i><?php echo($role); ?></i></p>
<h3>Monitoring</h3>
<div class="menu"><a href="salles_live.php">Connexion Windows en cours dans les salles</a></div>

View File

@ -19,7 +19,7 @@ $role = $roles[$profil];
<?php
if ($profil >= $niveaux[$roles[1]]) {
?>
<p>Peut-être souhaitez-vous simplement voir les <a href="ma_salle_live.php">connexions en cours de votre salle de cours</a> ?</p>
<p>Peut-être souhaitez-vous simplement voir les <a href="ma_salle_live.php">connexions en cours de votre salle informatique</a> ?</p>
<?php
}
?>

View File

@ -9,5 +9,5 @@ $auth_ldap_basedn = "DC=iut,DC=local"; // D
$auth_ldap_port = "636"; // port du serveur : 636 (ldaps) recommandé
$auth_ldap_attribut_identifier = "sAMAccountName"; // attribut identifiant d'un compte dans l'annuaire
$auth_ldap_AD = true; // le serveur LDAP est-il un serveur AD ?
$auth_ldap_message = "Veuillez vous authentifier avec votre compte et votre mode passe Windows"; // message sur le formulaire d'authentification LDAP
= "Veuillez vous authentifier avec votre compte et votre mode passe Windows"; // message sur le formulaire d'authentification LDAP
?>

View File

@ -37,6 +37,9 @@ $ram = $machine[10];
$procSpeed = $machine[11];
$diskSize = $machine[12];
$freeSpace = $machine[13];
$mac_json = json_encode(array($mac_addr));
?>
<!DOCTYPE HTML>
<html lang="fr">
@ -79,9 +82,13 @@ $freeSpace = $machine[13];
?>
<form action="stop.php" method="POST">
<input type="hidden" name="host" value='<?php echo($host_json); ?>'>
<input type="hidden" name="mac" value='<?php echo($mac_json); ?>'>
<!--<input type="submit" value="fermer la session" name="stop">-->
<input type="submit" value="redémarrer cette machine" name="stop">
<input type="submit" value="éteindre cette machine" name="stop">
<input type="submit" value="allumer cette machine" name="stop">
<input type="submit" value="start processus distant" name="stop">
<input type="submit" value="stop processus distant" name="stop">
</form>
<br/>
<?php

View File

@ -239,13 +239,14 @@ function RechercheWifi(&$db) {
$compte = db_escape_string($db, $_POST["compte"]);
$nom = db_escape_string($db, $_POST["nom"]);
$prenom = db_escape_string($db, $_POST["prenom"]);
$groupe = db_escape_string($db, $_POST["groupe"]);
$ip = db_escape_string($db, $_POST["ip"]);
$browser = db_escape_string($db, $_POST["browser"]);
$date_debut = db_escape_string($db, $_POST["date_debut"]);
$date_fin = db_escape_string($db, $_POST["date_fin"]);
$contrainte = false;
$req_wifi = "SELECT nom AS 'Nom', prenom AS 'Prénom', wifi_username AS 'Compte', wifi_ip AS 'Adresse IP', wifi_browser AS 'Browser/Device', wifi_deb_conn AS 'Heure connexion', close AS 'Fermée ?'";
$req_wifi = "SELECT nom AS 'Nom', prenom AS 'Prénom', wifi_username AS 'Compte', groupe AS 'Groupe', wifi_ip AS 'Adresse IP', wifi_browser AS 'Browser/Device', wifi_deb_conn AS 'Heure connexion', close AS 'Fermée ?'";
$req_wifi = $req_wifi." FROM wifi, comptes WHERE wifi_username = username ";
$where = "";
if ($compte != "") {
@ -263,6 +264,11 @@ function RechercheWifi(&$db) {
$liste_const = $liste_const. "prénom = <i>$prenom</i><br/>";
$contrainte = true;
}
if ($groupe != "") {
$where = $where . " AND groupe LIKE \"{$groupe}\"";
$liste_const = $liste_const. "groupe = <i>$groupe</i><br/>";
$contrainte = true;
}
if ($ip != "") {
$where = $where ." AND wifi_ip LIKE \"{$ip}\"";
$liste_const = $liste_const. "adresse IP = <i>$ip</i><br/>";
@ -395,4 +401,3 @@ else {
<p class="footer">version <?php echo($winlog_version); ?></p>
</body>
</html>

View File

@ -11,24 +11,25 @@ FiltreProfil($profil);
$connexions_wifi = Connexions_wifi();
$html = "<p><i>Nb connexions déjà établies : ". count($connexions_wifi);
$html = $html . "<table>\n<th>nom</th><th>prénom</th><th>compte</th><th>heure connexion</th><th>adresse IP</th><th>browser</th><th>id connexion</th>\n";
$html = $html . "<table>\n<th>nom</th><th>prénom</th><th>compte</th><th>groupe</th><th>heure connexion</th><th>adresse IP</th><th>browser</th><th>id connexion</th>\n";
$lignes = "";
$pair = false;
$bold = "style=\"font-weight: bold;\"";
foreach ($connexions_wifi as $i => $con_wifi) {
$nom = $con_wifi["nom"];
$prenom = $con_wifi["prenom"];
$username = $con_wifi["username"];
$groupe = $con_wifi["groupe"];
$debut = $con_wifi["debut"];
$ip = $con_wifi["ip"];
$browser = $con_wifi["browser"];
$id = $con_wifi["id"];
$style = ($pair) ? "even" : "odd";
$lignes = $lignes . "<tr class=\"$style\"><td>$nom</td><td>$prenom</td><td>$username</td><td>$debut</td><td>$ip</td><td>$browser</td><td>$id</td></tr>\n";
$weight = ($groupe == $lib_personnel) ? $bold : "";
$lignes = $lignes . "<tr class=\"$style\" $weight><td>$nom</td><td>$prenom</td><td>$username</td><td>$groupe</td><td>$debut</td><td>$ip</td><td>$browser</td><td>$id</td></tr>\n";
$pair = !$pair;
}
$html = $html . $lignes . "</table>\n";
echo($html);
?>

View File

@ -54,34 +54,30 @@ $hauteur_salle["A102"] = 570;
$orix["A102"] = 20;
$oriy["A102"] = 50;
$largeur["A102"] = 120;
$hauteur["A102"] = 60;
$hauteur["A102"] = 50;
$police["A102"] = 11;
$orientation["A102"][0]="H";
$ligne_coord["A102"][0] = array(0, 0);
$ligne_machines["A102"][0] = array('A102D1','A102D2','A102D3','A102D4', 'A102D5','A102D6','A102D7');
$shift["A102"][0] = 20;
$orientation["A102"][0]="V";
$ligne_coord["A102"][0] = array(100, 100);
$ligne_machines["A102"][0] = array('A102Z1','A102A1');
$shift["A102"][0] = 10;
$orientation["A102"][1]="H";
$ligne_coord["A102"][1] = array(50, 70);
$ligne_machines["A102"][1] = array('A102Z1','A102C1','A102C2','A102C3','A102C4','A102C5','A102C6');
$shift["A102"][1] = 20;
$orientation["A102"][1]="V";
$ligne_coord["A102"][1] = array(300, 0);
$ligne_machines["A102"][1] = array('A102B8','A102B7','A102B6','A102B5','A102B4','A102B3','A102B2','A102B1');
$shift["A102"][1] = 10;
$orientation["A102"][2]="H";
$ligne_coord["A102"][2] = array(50, 200);
$ligne_machines["A102"][2] = array('A102B1','A102B2','A102B3','A102B4','A102B5','A102B6');
$shift["A102"][2] = 20;
$orientation["A102"][2]="V";
$ligne_coord["A102"][2] = array(500, 0);
$ligne_machines["A102"][2] = array('A102C8','A102C7','A102C6','A102C5','A102C4','A102C3','A102C2','A102C1');
$shift["A102"][2] = 10;
$orientation["A102"][3]="H";
$ligne_coord["A102"][3] = array(0, 270);
$ligne_machines["A102"][3] = array('A102A1','A102A2','A102A3','A102A4','A102A5','A102A6', 'A102A7');
$shift["A102"][3] = 20;
$orientation["A102"][3]="V";
$ligne_coord["A102"][3] = array(700, 0);
$ligne_machines["A102"][3] = array('A102D8','A102D7','A102D6','A102D5','A102D4','A102D3','A102D2','A102D1');
$shift["A102"][3] = 10;
$orientation["A102"][4]="H";
$ligne_coord["A102"][4] = array(400, 400);
$ligne_machines["A102"][4] = array('A102B7');
$shift["A102"][4] = 20;
$orien_porte["A102"][0]="H";
$porte_coord["A102"][0]=array(100,500);

View File

@ -60,15 +60,15 @@ $hauteur["A103"] = 60;
$orientation["A103"][0]="V";
$ligne_coord["A103"][0] = array(0, 0);
$ligne_machines["A103"][0] = array('VM-A10307','VM-A10308','VM-A10309','VM-A10310');
$ligne_machines["A103"][0] = array('A103A4','A103A3','A103A2','A103A1','A103A11');
$shift["A103"][0] = 20;
$orientation["A103"][1]="V";
$ligne_coord["A103"][1] = array(300, 0);
$ligne_machines["A103"][1] = array('VM-A10305','VM-A10304','VM-A10303','VM-A10302','VM-A10301');
$ligne_machines["A103"][1] = array('A103A6','A103A7','A103A8','A103A9','A103A10','A103A12');
$shift["A103"][1] = 20;
$orientation["A103"][2]="H";
$ligne_coord["A103"][2] = array(140, 0);
$ligne_machines["A103"][2] = array('VM-A10306');
$ligne_machines["A103"][2] = array('A103A5');
$shift["A103"][2] = 20;
$orien_porte["A103"][0]="H";

View File

@ -59,42 +59,42 @@ $police["A200"] = 11;
$orientation["A200"][0]="V";
$ligne_coord["A200"][0] = array(0, 0);
$ligne_machines["A200"][0] = array('VM-A20024','VM-A20023','VM-A20022','VM-A20021');
$ligne_machines["A200"][0] = array('A200F4','A200F3','A200F2','A200F1');
$shift["A200"][0] = 20;
$orientation["A200"][1]="V";
$ligne_coord["A200"][1] = array(130, 0);
$ligne_machines["A200"][1] = array('VM-A20020','VM-A20019','VM-A20018','VM-A20017');
$ligne_machines["A200"][1] = array('A200E4','A200E3','A200E2','A200E1');
$shift["A200"][1] = 20;
$orientation["A200"][2]="V";
$ligne_coord["A200"][2] = array(300, 0);
$ligne_machines["A200"][2] = array('VM-A20016','VM-A20015','VM-A20014','VM-A20013');
$ligne_machines["A200"][2] = array('A200D4','A200D3','A200D2','A200D1');
$shift["A200"][2] = 20;
$orientation["A200"][3]="V";
$ligne_coord["A200"][3] = array(430, 0);
$ligne_machines["A200"][3] = array('VM-A20012','VM-A20011','VM-A20010','VM-A20009');
$ligne_machines["A200"][3] = array('A200C4','A200C3','A200C2','A200C1');
$shift["A200"][3] = 20;
$orientation["A200"][4]="V";
$ligne_coord["A200"][4] = array(600, 0);
$ligne_machines["A200"][4] = array('VM-A20008','VM-A20007','VM-A20006','VM-A20005');
$ligne_machines["A200"][4] = array('A200B4','A200B3','A200B2','A200B1');
$shift["A200"][4] = 20;
$orientation["A200"][5]="V";
$ligne_coord["A200"][5] = array(730, 0);
$ligne_machines["A200"][5] = array('VM-A20004','VM-A20003','VM-A20002','VM-A20001');
$ligne_machines["A200"][5] = array('A200A4','A200A3','A200A2','A200A1');
$shift["A200"][5] = 20;
$orientation["A200"][6]="H";
$ligne_coord["A200"][6] = array(0, 370);
$ligne_machines["A200"][6] = array('VM-A20030','VM-A20028','VM-A20027','VM-A20026','VM-A20025');
$ligne_machines["A200"][6] = array('A200G4','A200G3','A200G2','A200G1');
$shift["A200"][6] = 20;
$orientation["A200"][7]="H";
$ligne_coord["A200"][7] = array(500, 450);
$ligne_machines["A200"][7] = array('VM-A20029');
$ligne_coord["A200"][7] = array(100, 450);
$ligne_machines["A200"][7] = array('A200H3','A200H2','A200H1','A200Z1');
$shift["A200"][7] = 20;
$orien_porte["A200"][0]="V";

View File

@ -84,7 +84,7 @@ $shift["A205"][4] = 20;
$orientation["A205"][5]="V";
$ligne_coord["A205"][5] = array(730, 80);
$ligne_machines["A205"][5] = array('A205F4','A205F3','A205F2','A205F1');
$ligne_machines["A205"][5] = array('A205F3','A205F2','A205F1','A205Z1');
$shift["A205"][5] = 20;
$orien_porte["A205"][0]="H";

View File

@ -59,27 +59,27 @@ $police["A307"] = 11;
$orientation["A307"][0]="V";
$ligne_coord["A307"][0] = array(0, 0);
$ligne_machines["A307"][0] = array('VM-A307028','VM-A307027','VM-A307026','VM-A307025','VM-A307024','VM-A307023','VM-A307022');
$ligne_machines["A307"][0] = array('A307D7','A307D6','A307D5','A307D4','A307D3','A307D2','A307D1');
$shift["A307"][0] = 20;
$orientation["A307"][1]="V";
$ligne_coord["A307"][1] = array(160, 0);
$ligne_machines["A307"][1] = array('VM-A307021','VM-A307020','VM-A307019','VM-A307018','VM-A307017','VM-A307016','VM-A307015');
$ligne_machines["A307"][1] = array('A307C7','A307C6','A307C5','A307C4','A307C3','A307C2','A307C1');
$shift["A307"][1] = 20;
$orientation["A307"][2]="V";
$ligne_coord["A307"][2] = array(320, 0);
$ligne_machines["A307"][2] = array('VM-A307014','VM-A307013','VM-A307012','VM-A307011','VM-A307010','VM-A307009','VM-A307008');
$ligne_machines["A307"][2] = array('A307B7','A307B6','A307B5','A307B4','A307B3','A307B2','A307B1');
$shift["A307"][2] = 20;
$orientation["A307"][3]="V";
$ligne_coord["A307"][3] = array(480, 0);
$ligne_machines["A307"][3] = array('VM-A307007','VM-A307006','VM-A307005','VM-A307004','VM-A307003','VM-A307002','VM-A307001');
$ligne_machines["A307"][3] = array('A307A7','A307A6','A307A5','A307A4','A307A3','A307A2','A307A1');
$shift["A307"][3] = 20;
$orientation["A307"][4]="H";
$ligne_coord["A307"][4] = array(640, 240);
$ligne_machines["A307"][4] = array('VM-A307029');
$ligne_machines["A307"][4] = array('A307Z1');
$shift["A307"][4] = 20;
$orien_porte["A307"][0]="H";

View File

@ -79,7 +79,7 @@ $shift["B501"][3] = 20;
$orientation["B501"][4]="V";
$ligne_coord["B501"][4] = array(780, 130);
$ligne_machines["B501"][4] = array('B501Z1','B501E3','B501E4','B501E5','B501E6');
$ligne_machines["B501"][4] = array('B501Z1','B501E3','B501E4');
$shift["B501"][4] = 20;
$orien_porte["B501"][0]="V";

View File

@ -59,14 +59,26 @@ $police["C200"] = 11;
$orientation["C200"][0]="V";
$ligne_coord["C200"][0] = array(0, 0);
$ligne_machines["C200"][0] = array('C2001','C2002','C2003','C2004');
$shift["C200"][0] = 80;
$ligne_machines["C200"][0] = array('C2009');
$shift["C200"][0] = 1;
$orientation["C200"][1]="V";
$ligne_coord["C200"][1] = array(400, 200);
$ligne_machines["C200"][1] = array('C2005','C2006','C2007','C2008','C2009');
$ligne_machines["C200"][1] = array('C2004','C2003','C2002','C2001');
$shift["C200"][1] = 20;
$orientation["C200"][2]="V";
$ligne_coord["C200"][2] = array(0, 150);
$ligne_machines["C200"][2] = array('C2008','C2007');
$shift["C200"][2] = 10;
$orientation["C200"][3]="V";
$ligne_coord["C200"][3] = array(0, 400);
$ligne_machines["C200"][3] = array('C2006','C2005');
$shift["C200"][3] = 10;
$orien_porte["C200"][0]="V";
$porte_coord["C200"][0]=array(550,0);

View File

@ -57,36 +57,38 @@ $largeur["CRDOC"] = 120;
$hauteur["CRDOC"] = 60;
$police["CRDOC"] = 11;
/*
$orientation["CRDOC"][0]="V";
$ligne_coord["CRDOC"][0] = array(0, 0);
$ligne_machines["CRDOC"][0] = array('VM-CRDOC11','VM-CRDOC12');
$shift["CRDOC"][0] = 20;
*/
$orientation["CRDOC"][0]="V";
$ligne_coord["CRDOC"][0] = array(0, 0);
$ligne_machines["CRDOC"][0] = array('CRDOC12','CRDOC11');
$shift["CRDOC"][0] = 20;
$orientation["CRDOC"][1]="V";
$ligne_coord["CRDOC"][1] = array(250, 0);
$ligne_machines["CRDOC"][1] = array('VM-CRDOC10');
$ligne_machines["CRDOC"][1] = array('CRDOC10');
$shift["CRDOC"][1] = 20;
$orientation["CRDOC"][2]="H";
$ligne_coord["CRDOC"][2] = array(500, 150);
$ligne_machines["CRDOC"][2] = array('VM-CRDOC01','VM-CRDOC02','VM-CRDOC03');
$ligne_machines["CRDOC"][2] = array('CRDOC01','CRDOC02','CRDOC03');
$shift["CRDOC"][2] = 20;
$orientation["CRDOC"][3]="V";
$ligne_coord["CRDOC"][3] = array(900, 220);
$ligne_machines["CRDOC"][3] = array('VM-CRDOC04','VM-CRDOC05','VM-CRDOC06');
$ligne_machines["CRDOC"][3] = array('CRDOC04','CRDOC05','CRDOC06');
$shift["CRDOC"][3] = 20;
$orientation["CRDOC"][4]="H";
$ligne_coord["CRDOC"][4] = array(500, 450);
$ligne_machines["CRDOC"][4] = array('VM-CRDOC09','VM-CRDOC08','VM-CRDOC07');
$ligne_machines["CRDOC"][4] = array('CRDOC09','CRDOC08','CRDOC07');
$shift["CRDOC"][4] = 20;
$orientation["CRDOC"][5]="V";
$ligne_coord["CRDOC"][5] = array(250, 600);
$ligne_machines["CRDOC"][5] = array('PCCRDOC');
$shift["CRDOC"][5] = 20;
$orien_porte["CRDOC"][0]="V";
$porte_coord["CRDOC"][0]=array(0,250);

View File

@ -49,37 +49,37 @@
$orix_salle["batA"] = 50;
$oriy_salle["batA"] = 200;
$largeur_salle["batA"] = 900;
$largeur_salle["batA"] = 1200;
$hauteur_salle["batA"] = 570;
$orix["batA"] = 100;
$orix["batA"] = 20;
$oriy["batA"] = 10;
$largeur["batA"] = 120;
$hauteur["batA"] = 60;
$police["batA"] = 11;
$orientation["batA"][0]="H";
$ligne_coord["batA"][0] = array(0, 0);
$ligne_coord["batA"][0] = array(100, 0);
$ligne_machines["batA"][0] = array('PCAMPHI2');
$shift["batA"][0] = 20;
$shift["batA"][0] = 10;
$orientation["batA"][1]="H";
$ligne_coord["batA"][1] = array(50, 70);
$ligne_machines["batA"][1] = array('PCACCUEIL','PCSECGESTION');
$shift["batA"][1] = 20;
$ligne_coord["batA"][1] = array(0, 70);
$ligne_machines["batA"][1] = array('PCINFIRMERIE');
$shift["batA"][1] = 10;
$orientation["batA"][2]="H";
$ligne_coord["batA"][2] = array(50, 200);
$ligne_machines["batA"][2] = array('PCCRDOC','PCPRET1W7','PCPRET2');
$shift["batA"][2] = 20;
$ligne_coord["batA"][2] = array(700, 70);
$ligne_machines["batA"][2] = array('PCSERIEYS17', 'PCSERIEYS17DOC', 'PCGAUTIER17DOC');
$shift["batA"][2] = 10;
$orientation["batA"][3]="H";
$ligne_coord["batA"][3] = array(0, 270);
$ligne_machines["batA"][3] = array('PCAYRALW7','PCDEVILLERS','PCSECINFO');
$ligne_coord["batA"][3] = array(0, 200);
$ligne_machines["batA"][3] = array('PCLIBREVISIO','PCLIBREINFO171','PCLIBREINFO172', 'PCDEVILLERS17','PCSERVIERES17','PCSECINFO17');
$shift["batA"][3] = 20;
$orientation["batA"][4]="H";
$ligne_coord["batA"][4] = array(400, 400);
$ligne_machines["batA"][4] = array('PBADMINSYS');
$ligne_machines["batA"][4] = array('PCVIALA','PBADMINSYS', 'PCPRADEL17', 'PCPELAMOURGUES', 'PCSECQLIO16');
$shift["batA"][4] = 20;
$orien_porte["batA"][0]="H";

View File

@ -49,19 +49,24 @@
$orix_salle["batB"] = 50;
$oriy_salle["batB"] = 200;
$largeur_salle["batB"] = 600;
$largeur_salle["batB"] = 950;
$hauteur_salle["batB"] = 570;
$orix["batB"] = 10;
$oriy["batB"] = 15;
$largeur["batB"] = 120;
$largeur["batB"] = 150;
$hauteur["batB"] = 60;
$police["batB"] = 11;
$orientation["batB"][0]="H";
$ligne_coord["batB"][0] = array(0, 0);
$ligne_machines["batB"][0] = array('PCDONNEZ');
$ligne_machines["batB"][0] = array('PCSECGEA', 'PCSECGESTION-CJ', 'PCSECGESTION', 'PCMAS2', 'PCLIBRECJ17');
$shift["batB"][0] = 20;
$orientation["batB"][1]="H";
$ligne_coord["batB"][1] = array(0, 80);
$ligne_machines["batB"][1] = array('PCDONNEZ');
$shift["batB"][1] = 20;
$orien_porte["batB"][0]="H";

View File

@ -49,28 +49,28 @@
$orix_salle["batC"] = 50;
$oriy_salle["batC"] = 200;
$largeur_salle["batC"] = 500;
$largeur_salle["batC"] = 1000;
$hauteur_salle["batC"] = 500;
$orix["batC"] = 10;
$oriy["batC"] = 10;
$largeur["batC"] = 120;
$largeur["batC"] = 135;
$hauteur["batC"] = 60;
$police["batC"] = 11;
$orientation["batC"][0]="H";
$ligne_coord["batC"][0] = array(0, 0);
$ligne_machines["batC"][0] = array('PCSTANDARD');
$ligne_coord["batC"][0] = array(60,0);
$ligne_machines["batC"][0] = array('PCINTENDANCE17','PBPOUGET18','PBVRANCKX17','PCCARTEMUT','PCCOURBOU', 'PCMOLINIERC17');
$shift["batC"][0] = 20;
$orientation["batC"][1]="H";
$ligne_coord["batC"][1] = array(50, 70);
$ligne_coord["batC"][1] = array(500, 400);
$ligne_machines["batC"][1] = array('PCSECINFOCOM');
$shift["batC"][1] = 20;
$orien_porte["batC"][0]="H";
$porte_coord["batC"][0]=array(100,450);
$orien_porte["batC"][0]="V";
$porte_coord["batC"][0]=array(0,80);
?>

View File

@ -28,6 +28,15 @@ function Machines_plan(&$ligne_machines) {
return $machines_de_la_salle;
};
// fonction renvoyant les adresses mac des machines de la salle
function AdressesMac_plan(&$hosts) {
$machines = Machines();
$macs_de_la_salle = array();
foreach($hosts as $host) {
$macs_de_la_salle[] = $machines[$host][8];
}
return $macs_de_la_salle;
}
// fonction d'affichage du plan 2D d'une salle
function Affiche_plan_salle(&$machines_de_la_salle, &$portes) {
@ -104,8 +113,10 @@ function Affiche_plan_salle(&$machines_de_la_salle, &$portes) {
if ($profil > 0) {
include_once($salle.'.php');
$machines_du_plan = Machines_plan($ligne_machines[$salle]);
$macs_du_plan = AdressesMac_plan($machines_du_plan);
$portes = $porte_coord[$salle];
$host_json = json_encode($machines_du_plan);
$mac_json = json_encode($macs_du_plan);
$info_cours = '&nbsp;&nbsp;&nbsp;&nbsp;<a href="../salles_live.php">[retour]</a>';
echo("<h3>Salle ".$salle.$info_cours."</h3>");
@ -114,6 +125,10 @@ if ($profil > 0) {
//$form = $form.'<input type="submit" value="fermer toutes les sessions" name="stop">';
$form = $form.'<input type="submit" value="redémarrer toute la salle" name="stop"><input type="submit" value="éteindre toute la salle" name="stop">';
$form = $form.'<input type="hidden" name="host" value=\''.$host_json.'\'>';
$form = $form.'<input type="hidden" name="mac" value=\''.$mac_json.'\'>';
$form = $form.'<input type="submit" value="démarrer toute la salle" name="stop">';
$form = $form.'<input type="submit" value="start processus distant" name="stop">';
$form = $form.'<input type="submit" value="stop processus distant" name="stop">';
$form = $form.'</form>';
echo $form;
}

View File

@ -10,6 +10,8 @@ $username = Username();
$profil = Profil($username);
FiltreProfil($profil);
$url = $url_stop;
if ($profil == $niveaux[$roles[3]]) {
$act = "";
@ -19,14 +21,23 @@ if ($profil == $niveaux[$roles[3]]) {
$eteindre_salle = "éteindre toute la salle";
$restart = "redémarrer cette machine";
$restart_salle = "redémarrer toute la salle";
$start_process = "start processus distant";
$stop_process = "stop processus distant";
$start_machine = "allumer cette machine";
$start_salle = "démarrer toute la salle";
$action_logout = array($logout, $logout_salle);
$action_stop = array($eteindre, $eteindre_salle);
$action_restart = array($restart, $restart_salle);
$action_start_remote = array($start_process);
$action_stop_remote = array($stop_process);
$action_wake = array($start_machine, $start_salle);
$action = $_POST["stop"];
$host_json = $_POST["host"]; // on récupère une chaîne de caractères représentant un tableau json
$mac_json = $_POST["mac"];
$hosts = json_decode($host_json);
$macs = json_decode($mac_json);
// on choisit la valeur de l'option à passer à la commande shutdown sur Ghost
if (in_array($action, $action_logout)) {
@ -38,12 +49,28 @@ if ($profil == $niveaux[$roles[3]]) {
if (in_array($action, $action_restart)) {
$act = "r";
}
if (in_array($action, $action_start_remote)) {
$act = "p";
$url = $rpc_url;
}
if (in_array($action, $action_stop_remote)) {
$act = "k";
$url = $rpc_url;
}
if (in_array($action, $action_wake)) {
$act = "w";
$url = $wake_url;
}
if ($act != "") {
foreach ($hosts as $host) {
PostURL($url_stop, array('act'=>$act, 'host'=>$host));
foreach ($hosts as $key => $host) {
//echo $host . " " . $mac[$key]. "<br/>";
PostURL($url, array('act'=>$act, 'host'=>$host, 'mac'=>$macs[$key]));
}
}
}
header('Location: salles_live.php');
?>
if ($url == $url_stop) {
header('Location: salles_live.php');
}
else {
header('Location: '.$_SERVER['HTTP_REFERER']);
}

View File

@ -1,6 +1,7 @@
<?php
include_once('admin/winlog_admin_conf.php');
include_once('admin/db_access.php');
include_once('admin/client_http.php');
// ne traiter que sur des requêtes POST sur le port 443
if ( $_SERVER["REQUEST_METHOD"] == "POST" && $_SERVER["SERVER_PORT"] == "443" && strcmp(addslashes($_POST["code"]), addslashes($server_code)) == 0 ) {
@ -30,10 +31,13 @@ if ( $_SERVER["REQUEST_METHOD"] == "POST" && $_SERVER["SERVER_PORT"] == "443" &&
db_query($db, $req_purge_C); // on commence par purger avant de créer une connexion
db_query($db, $req_con_C); // nouvelle connexion
db_query($db, $req_ip_machine); // update IP de la machine
PostURL($rpc_url, array('act'=>'k', 'host'=>$computer)); // kill processus distant
break;
case "D":
db_query($db, $req_con_D); // déconnexion
PostURL($rpc_url, array('act'=>'k', 'host'=>$computer));
PostURL($rpc_url, array('act'=>'p', 'host'=>$computer)); // start processus distant
break;
case "M":