");
$_SESSION["pageaide"]="Gestion_des_clients_windows#Description_du_processus_de_configuration_du_registre_Windows";
echo "
".gettext("Gestion des clé")."
";
$testniveau=getintlevel();
$act=$_POST['ajoutcle'];
$autre=$_POST['modifcle'];
$salle=$_POST['salles'];
if (!$salle) { $salle=$_GET['salles']; }
connexion();
if (! isset($_POST['groups'])) {
//incorporation d'un modele
$query="SELECT `mod` FROM modele GROUP BY `mod`;";
$resultat = mysql_query($query);
echo gettext("Choisir le modele à incorporer au groupe")." $salle
";
echo "
".gettext("Attention, toute clé non présente dans base y sera également ajoutée afin de respecter la cohérence de vos restrictions")."
";
}
else {
$nombre=$_POST['nombre'];
$priorite = priorite($salle);
for ($n=0;$n<$nombre;$n++) {
$mod=$_POST['modele'.$n];
$query="SELECT `cle`,`etat` FROM `modele` WHERE `mod`= '$mod' ;";
$resultat = mysql_query($query);
while ($row=mysql_fetch_row($resultat)) {
$cle=$row[0];
$query = "SELECT cleID,Intitule,valeur,antidote,type FROM corresp WHERE cleID='$cle';";
$insert = mysql_query($query);
$row1 = mysql_fetch_row($insert);
$query = "SELECT cleID,valeur FROM restrictions WHERE cleID='$cle' AND groupe='$salle';";
$verif = mysql_query($query);
$row2=mysql_fetch_row($verif);
if ($row[1] == "1") {
$row1[2]=ajoutedoublebarre($row1[2]);
if ($row2[0]) {
$query = "UPDATE `restrictions` SET `valeur` = '$row1[2]',priorite='$priorite' WHERE `cleID` = '$cle' AND `groupe` = '$salle';";
$insert = mysql_query($query);
} else {
$query="INSERT INTO restrictions (resID,valeur,cleID,groupe,priorite) VALUES ('','$row1[2]','$row[0]','$salle','$priorite');";
$insert = mysql_query($query);
}
}
else{
if ($row1[4] == "config") {
$query="DELETE FROM restrictions where cleID='$cle';";
$insert = mysql_query($query);
}
else {
if ($row2[0]) {
$query = "UPDATE `restrictions` SET `valeur` = '$row1[3]',priorite='$priorite' WHERE `cleID` = '$cle' AND `groupe` = '$salle';";
$insert = mysql_query($query);
} else {
$query="INSERT INTO restrictions (resID,valeur,cleID,groupe,priorite) VALUES ('','$row1[3]','$row[0]','$salle','$priorite');";
$insert = mysql_query($query);
}
}
}
}
}
echo "";
}
include("pdp.inc.php");
?>