[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/registre/ -> edit_cle.php (source)

   1  <?php
   2  
   3     /**
   4     
   5     * Edition des cles
   6     * @Version $Id: edit_cle.php 6010 2010-11-29 13:39:39Z dbo $ 
   7     
   8    
   9     * @Projet LCS / SambaEdu 
  10     
  11     * @auteurs  Cedric Bellegarde
  12     
  13     * @Licence Distribue selon les termes de la licence GPL
  14     
  15     * @note 
  16     
  17     */
  18  
  19     /**
  20  
  21     * @Repertoire: registre
  22     * file: edit_cle.php
  23  
  24    */    
  25  
  26  
  27  include  "entete.inc.php";
  28  include  "ldap.inc.php";
  29  include  "ihm.inc.php";
  30  
  31  require_once  ("lang.inc.php");
  32  bindtextdomain('se3-registre',"/var/www/se3/locale");
  33  textdomain ('se3-registre');
  34  
  35  if (ldap_get_right("computers_is_admin",$login)!="Y")
  36          die (gettext("Vous n'avez pas les droits suffisants pour acc&#233;der &#224; cette fonction")."</BODY></HTML>");
  37  
  38      $_SESSION["pageaide"]="Gestion_des_clients_windows#Description_du_processus_de_configuration_du_registre_Windows";
  39  
  40  
  41  require  "include.inc.php";
  42  
  43  $cle=$_GET['cle'];
  44  $template=$_GET['template'];
  45  $state=$_GET['state'];
  46  $value=$_GET['value'];
  47  $choix=$_GET['choix'];
  48  $antidote=$_GET['antidote'];
  49  
  50  $checkedA="";
  51  $checkedI="";
  52  $checkedD="";
  53  
  54  connexion();
  55  echo "<title>".gettext("Edition d'une restriction")."</title>";
  56  
  57  if ($choix != "") {
  58      $deleteSQL = "delete from restrictions where cleID='$cle' and groupe='$template'";
  59      if ($choix == "Active") {
  60          $addSQL = "Insert into restrictions values ('', '$cle', '$template', '$value', '0')";
  61          mysql_query($deleteSQL);
  62          mysql_query($addSQL);
  63      }
  64      else if ($choix == "Inactive") {
  65          $addSQL = "Insert into restrictions values ('', '$cle', '$template', '$antidote')";
  66          mysql_query($deleteSQL);
  67          mysql_query($addSQL);
  68      }
  69      else {
  70          mysql_query($deleteSQL);
  71      }
  72      ?>
  73          <script language="JavaScript" type="text/javascript">
  74              opener.location.reload(true);
  75              self.close();
  76          </script>
  77      <?php
  78  }
  79  else {
  80      if ($state == "1") $checkedA="checked";
  81      if ($state == "0") $checkedI="checked";
  82  //    if ($state == "-1") $checkedD="checked";
  83  
  84      $query="Select valeur, type, Intitule, antidote from corresp where cleID='$cle'";
  85      $result = mysql_query($query);
  86      $row = mysql_fetch_row($result);
  87      if ($value == "") $value = $row[0];
  88      echo "$row[2]:\n";
  89      echo "<form method=get action=\"edit_cle.php\">\n";
  90      echo "<br/>\n";
  91      echo "<input type=\"radio\" name=\"choix\" id='choix_active' value=\"Active\" $checkedA><label for='choix_active'>Active</label><br/>\n";
  92      if ($row[1] != "config")
  93          echo "<input type=\"radio\" name=\"choix\" id='choix_inactive' value=\"Inactive\" $checkedI><label for='choix_inactive'>Inactive</label><br/>\n";
  94  //    echo "<input type=\"radio\" name=\"choix\" id='choix_nc' value=\"Non configur&eacute;e\" $checkedD><label for='choix_nc'>Non configur&eacute;e</label><br/>";
  95      if ($row[1] == "config")
  96          echo "<br/>Valeur: <input type=\"text\" value=\"$value\" name=\"value\" size=\"40\"><br/>";
  97      else
  98          echo "<input type=\"hidden\" name=\"value\" value=\"$row[0]\">";
  99  
 100      echo "<input type=\"hidden\" name=\"cle\" value=\"$cle\">";
 101      echo "<input type=\"hidden\" name=\"template\" value=\"$template\">";
 102      echo "<input type=\"hidden\" name=\"antidote\" value=\"$row[3]\">";
 103  
 104  }
 105  mysql_close();
 106  
 107  include("pdp.inc.php");
 108  
 109  ?>


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1