[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-backup/var/www/se3/sauvegarde/ -> saveBackupPcSettings.php (source)

   1  <?php
   2  
   3  
   4     /**
   5  
   6     * Change le proprio pour le NAS (Backuppc)
   7     * Ajout du support de NAS
   8     * @Version $Id: saveBackupPcSettings.php 8591 2015-03-16 07:14:59Z plouf $
   9  
  10     * @Projet LCS / SambaEdu
  11  
  12     * @auteurs Philippe Chadefaux Wawa MrT
  13  
  14     * @Licence Distribue selon les termes de la licence GPL
  15  
  16     * @note
  17  
  18     */
  19  
  20      require ("config.inc.php");
  21         require_once  ("functions.inc.php");
  22      require  ("ldap.inc.php");
  23      require  ("ihm.inc.php");
  24      include ("fonction_backup.inc.php");
  25  
  26      require_once ("lang.inc.php");
  27      bindtextdomain('sauvegarde',"/var/www/se3/locale");
  28      textdomain ('sauvegarde');
  29          
  30          // HTMLPurifier
  31          require_once  ("traitement_data.inc.php");
  32  
  33          $bck_user = $_POST['bck_user'];
  34  
  35  
  36      // Verifie les droits
  37      $login =isauth();
  38      if (ldap_get_right("system_is_admin",$login)!="Y")
  39             die (gettext("Vous n'avez pas les droits suffisants pour acc&#233;der &#224; cette fonction")."</BODY></HTML>");
  40      
  41      $bck_user = trim($bck_user);
  42          
  43      
  44      $sql= "SELECT * FROM `params` WHERE name = 'bck_user';";
  45      $c = mysql_query($sql) or die("ERREUR: $sql");
  46      if (mysql_num_rows($c) == 0 ) {
  47          $sql2 = "INSERT INTO `params` ( `id` , `name` , `value` , `srv_id` , `descr` , `cat` )"
  48               ."VALUES (NULL , 'bck_user', '$bck_user', '0', 'utilisateur proprietaire backuppc', '5');";
  49          $c2 = mysql_query($sql2) or die("ERREUR: $sql2");
  50  
  51      } else {
  52          $sql2 = "UPDATE `params` SET `value` = '$bck_user' , `cat` = '5'  WHERE `params`.`name` ='bck_user' ;";
  53          $c2 = mysql_query($sql2) or die("ERREUR: $sql2");
  54      }
  55  
  56      
  57      $bck_uidnumber = trim($_POST['bck_uidnumber']);
  58          
  59      
  60      $sql= "SELECT * FROM `params` WHERE name = 'bck_uidnumber';";
  61      $c = mysql_query($sql) or die("ERREUR: $sql");
  62      if (mysql_num_rows($c) == 0 ) {
  63          $sql2 = "INSERT INTO `params` ( `id` , `name` , `value` , `srv_id` , `descr` , `cat` )"
  64               ."VALUES (NULL , 'bck_uidnumber', '$bck_uidnumber', '0', 'uidnumber proprietaire backuppc', '5');";
  65          $c2 = mysql_query($sql2) or die("ERREUR: $sql2");
  66  
  67      } else {
  68          $sql2 = "UPDATE `params` SET `value` = '$bck_uidnumber' , `cat` = '5' WHERE `params`.`name` ='bck_uidnumber' ;";
  69          $c2 = mysql_query($sql2) or die("ERREUR: $sql2");
  70      }
  71  
  72  
  73      exec ("sudo /usr/share/se3/sbin/chgbpcuser.sh");
  74      die("Modifications r&eacute;alis&eacute;es avec succes !");
  75  
  76  ?>


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