diff --git a/admin/authentification_ldap.php b/admin/authentification_ldap.php index a86e53d..040a61f 100644 --- a/admin/authentification_ldap.php +++ b/admin/authentification_ldap.php @@ -16,7 +16,7 @@ include_once('ldap_conf.php');
-WINLOG
+WINLOG-R
Nb connexions déjà établies : ". count($connexions_wifi);
-$html = $html . "\n
nom prénom compte heure connexion adresse IP browser id connexion \n";
+$html = $html . "\n
\n";
echo($html);
?>
-
-
diff --git a/admin/salles/A102.php b/admin/salles/A102.php
index fabe5a0..975790a 100644
--- a/admin/salles/A102.php
+++ b/admin/salles/A102.php
@@ -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);
diff --git a/admin/salles/A103.php b/admin/salles/A103.php
index b1d29bd..4bd7f69 100644
--- a/admin/salles/A103.php
+++ b/admin/salles/A103.php
@@ -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";
diff --git a/admin/salles/A200.php b/admin/salles/A200.php
index 52441ae..38384a3 100644
--- a/admin/salles/A200.php
+++ b/admin/salles/A200.php
@@ -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";
diff --git a/admin/salles/A205.php b/admin/salles/A205.php
index 5558728..650d4d0 100644
--- a/admin/salles/A205.php
+++ b/admin/salles/A205.php
@@ -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";
diff --git a/admin/salles/A307.php b/admin/salles/A307.php
index cd27550..c8d1a5a 100644
--- a/admin/salles/A307.php
+++ b/admin/salles/A307.php
@@ -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";
diff --git a/admin/salles/B501.php b/admin/salles/B501.php
index 5b644a8..1555245 100644
--- a/admin/salles/B501.php
+++ b/admin/salles/B501.php
@@ -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";
diff --git a/admin/salles/C200.php b/admin/salles/C200.php
index 4689a65..f2c3fb0 100644
--- a/admin/salles/C200.php
+++ b/admin/salles/C200.php
@@ -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);
diff --git a/admin/salles/CRDOC.php b/admin/salles/CRDOC.php
index 20c17fc..a178bf7 100644
--- a/admin/salles/CRDOC.php
+++ b/admin/salles/CRDOC.php
@@ -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);
diff --git a/admin/salles/batA.php b/admin/salles/batA.php
index 1684207..3448adc 100644
--- a/admin/salles/batA.php
+++ b/admin/salles/batA.php
@@ -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";
diff --git a/admin/salles/batB.php b/admin/salles/batB.php
index 8893584..d7ac764 100644
--- a/admin/salles/batB.php
+++ b/admin/salles/batB.php
@@ -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";
diff --git a/admin/salles/batC.php b/admin/salles/batC.php
index ece83e9..4332f4f 100644
--- a/admin/salles/batC.php
+++ b/admin/salles/batC.php
@@ -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);
?>
diff --git a/admin/salles/index.php b/admin/salles/index.php
index c8f4b34..db7d733 100644
--- a/admin/salles/index.php
+++ b/admin/salles/index.php
@@ -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 = ' [retour]';
echo("nom prénom compte groupe heure connexion adresse IP browser id connexion \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 . " \n";
+ $weight = ($groupe == $lib_personnel) ? $bold : "";
+ $lignes = $lignes . "$nom $prenom $username $debut $ip $browser $id \n";
$pair = !$pair;
}
$html = $html . $lignes . "$nom $prenom $username $groupe $debut $ip $browser $id Salle ".$salle.$info_cours."
");
@@ -114,6 +125,10 @@ if ($profil > 0) {
//$form = $form.'';
$form = $form.'';
$form = $form.'';
+ $form = $form.'';
+ $form = $form.'';
+ $form = $form.'';
+ $form = $form.'';
$form = $form.'';
echo $form;
}
diff --git a/admin/stop.php b/admin/stop.php
index 18b8a30..0122008 100644
--- a/admin/stop.php
+++ b/admin/stop.php
@@ -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]. "
";
+ 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']);
+}
diff --git a/index.php b/index.php
index 72da0ca..434fdc3 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,7 @@
'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":