Commit 62f3f60c authored by Laurent Joly's avatar Laurent Joly
Browse files

maintenance_gestion_poste.php

Ajout des options de maintenance
Les fonctions sont à implémenter
parent 2e0d8305
......@@ -43,9 +43,106 @@ if (isset($_GET['uuid']))
else
$get_uuid = -1;
$page_id=1;
if (isset($_POST["valider"]))
$post_valider = $purifier->purify($_POST["valider"]);
else
$post_valider = "";
$page_id=1;
include("maintenance_top.php");
if ($post_valider == "Valider les modifications")
{
if (isset($_POST["poste_id"]))
$post_poste_id = $_POST["poste_id"];
else
$post_poste_id = array();
if (isset($_POST["action"]))
$post_action = $purifier->purify($_POST["action"])+0;
else
$post_action = 0;
echo "<p align='left'>";
$count=0;
switch($post_action)
{
case 0:
echo "<b><i>Aucune action</i></b>";
break;
case 1:
echo "<b><i>Protection des machines :</i></b> ";
foreach ($post_poste_id as $tmp)
{
$result=maintenance_poste_protection($config,$tmp);
if ($result)
{
if ($count==0)
$count=1;
else
echo ", ";
echo $result;
}
}
break;
case 2:
echo "<b><i>D&#233;protection des machines :</i></b> ";
foreach ($post_poste_id as $tmp)
{
$result=maintenance_poste_deprotection($config,$tmp);
if ($result)
{
if ($count==0)
$count=1;
else
echo ", ";
echo $result;
}
}
break;
case 3:
echo "<b><i>Suppression des machines sans uuid :</i></b> ";
foreach ($post_poste_id as $tmp)
{
$result=maintenance_poste_supression($config,$tmp);
if ($result)
{
if ($count==0)
$count=1;
else
echo ", ";
echo $result;
}
}
break;
case 4:
echo "<b><i>Recharger le dernier rapport wpkg des machines :</i></b> ";
foreach ($post_poste_id as $tmp)
{
$result=maintenance_poste_reset_wpkg($config,$tmp);
if ($result)
{
if ($count==0)
$count=1;
else
echo ", ";
echo $result;
}
}
break;
case 5:
echo "<b><i>Aucune action</i></b>";
break;
case 6:
echo "<b><i>Aucune action</i></b>";
break;
}
echo "</p></ br>";
}
echo "<script>\n";
echo "function checkAll()\n";
echo "{\n";
......@@ -173,11 +270,11 @@ echo ">Tout</option>";
echo " <option value='0'";
if ($get_flag==0)
echo " selected";
echo ">Non protégé</option>";
echo ">Non prot&#233;g&#233;</option>";
echo " <option value='1'";
if ($get_flag==1)
echo " selected";
echo ">Protégé</option>";
echo ">Prot&#233;g&#233;</option>";
echo " <option value='2'";
if ($get_flag==2)
echo " selected";
......@@ -190,7 +287,7 @@ if ($tri == 4)
echo "5";
else
echo "4";
echo "' style='color:" . $regular_lnk . "'>Installées</a></th>\n";
echo "' style='color:" . $regular_lnk . "'>Install&#233;es</a></th>\n";
echo "<th>";
echo " <select name='uuid' onchange='submit()'>";
echo " <option value='-1'";
......@@ -211,17 +308,34 @@ echo "</tr>\n";
echo "<input type='hidden' name='tri' value='" . $tri . "'>\n";
echo "</form>\n";
echo "<form method='post' action='?tri2=" . $tri2 . "&flag=" . $get_flag . "&uuid=" . $get_uuid . "'>\n";
echo "<tr>\n";
echo "<td colspan='4'>";
echo "<td colspan='10'>\n";
echo "<table cellspadding='2' cellspacing='1' border='0' align='center' bgcolor='black' width='100%'>\n";
echo "<form method='post' action='?tri=" . $tri . "&flag=" . $get_flag . "&uuid=" . $get_uuid . "'>\n";
echo "<tr>\n";
echo "<td width='33%' style='color:white' align='center'>";
echo "<select name='action'>";
echo "<option value='0'>-- Choisir une action --</option>";
echo "<option value='1'>Prot&#233;ger des machines</option>";
echo "<option value='2'>D&#233;prot&#233;ger des machines</option>";
echo "<option value='3'>Supprimer des machines sans uuid</option>";
echo "<option value='4'>Recharger le dernier rapport wpkg</option>";
echo "<option value='5'>Rien</option>";
echo "</select>";
echo "</td>\n";
echo "<td colspan='3' style='color:white'>";
echo "<td width='33%' style='color:white' align='center'>";
echo "<input type='checkbox' onchange='checkAll()' name='chk[]' /> Tous/Aucun";
echo "</td>\n";
echo "<td colspan='3'>";
echo "<td width='*' style='color:white' align='center'>";
echo "<input type='submit' name='valider' value='Valider les modifications'>";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";
foreach ($liste_poste as $nom_poste => $lp)
{
$affichage = 0;
......@@ -249,7 +363,7 @@ foreach ($liste_poste as $nom_poste => $lp)
{
echo "<tr bgcolor='" . $bg . "' style='color: " . $txt . "'>";
echo "<td align='center'>";
echo "<input type='checkbox' id='poste_id[]' name='poste_id[]' value='" . $lp["id_poste"] . "' />";
echo "<input type='checkbox' id='poste_id[]' name='poste_id[]' value='" . $lp["id"] . "' />";
echo "</td>";
echo "<td align='center'><a href='poste_statuts.php?id_host=" . $nom_poste . "' style='color: " . $lnk . "'>" . $nom_poste . "</a></td>";
echo "<td align='center' bgcolor='" . $wintype_txt . "'>";
......@@ -287,7 +401,7 @@ foreach ($liste_poste as $nom_poste => $lp)
echo "<td align='center'>" . $lp["nb_appli_installed"] . "</td>";
$rapport_date = date('d/m/Y', strtotime($lp["date_modification_poste"]));
$rapport_time = date('H:i:s', strtotime($lp["date_modification_poste"]));
echo "<td align='center'><a href='log.php?logfile=" . $lp["file_log_poste"] . "' target='rapport_poste' style='color: " . $lnk . "'>" . $rapport_date . " à " . $rapport_time . "</a></td>";
echo "<td align='center'><a href='log.php?logfile=" . $lp["file_log_poste"] . "' target='rapport_poste' style='color: " . $lnk . "'>" . $rapport_date . " &#224; " . $rapport_time . "</a></td>";
echo "<td align='center'>" . $lp["IP_poste"] . "</td>";
echo "<td align='center'>" . $lp["mac_address_poste"] . "</td>";
echo "<td align='center'>" . $lp["uuid_poste"] . "</td>";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment