[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-clonage/sources/www/tftp/ -> ajax_lib.php (source)

   1  <?php
   2  
   3  /* $Id: ajax_lib.php 8361 2015-01-02 20:41:48Z keyser $
   4    ===========================================
   5    Projet SE3
   6    Dispositif SE3+TFTP+Sauvegarde/Restauration/Clonage
   7    Stephane Boireau
   8    Distribu� selon les termes de la licence GPL
   9    =============================================
  10   */
  11  
  12  require ("config.inc.php");
  13  require_once  ("functions.inc.php");
  14  require_once  ("lang.inc.php");
  15  require_once  ("ihm.inc.php");
  16  require_once  ("ldap.inc.php");
  17  require_once  ("fonc_parc.inc.php");
  18  require_once ("fonc_outils.inc.php");
  19  require_once  ("lib_action_tftp.php");
  20  //require_once ("parcs_ajax_lib.php");
  21  //debug_var();
  22  $login = isauth();
  23  
  24  if ((is_admin("system_is_admin", $login) != "Y") && (ldap_get_right("parc_can_clone", $login) != "Y")) {
  25      echo "<p style='color:red'>Action non autorisee.</p>";
  26      die();
  27  }
  28  
  29  $restriction_parcs = "n";
  30  if (is_admin("system_is_admin", $login) != "Y") {
  31      $restriction_parcs = "y";
  32      $tab_delegated_parcs = list_delegated_parcs($login);
  33      if (count($tab_delegated_parcs) == 0) {
  34          echo "<p style='color:red'>Aucun parc ne vous a ete delegue.</p>\n";
  35          die();
  36      }
  37  }
  38  
  39  
  40  if ($_GET['mode'] == 'ping_ip') {
  41      $resultat = fping($_GET['ip']);
  42      if ($resultat) {
  43          //echo "<img type=\"image\" src=\"../elements/images/enabled.gif\" border='0' alt='".$_GET['ip']."' title='".$_GET['ip']."' />";
  44          echo "<img type=\"image\" src=\"../elements/images/enabled.gif\" border=\"0\" alt=\"" . $_GET['ip'] . "\" title=\"" . $_GET['ip'] . "\" />";
  45      } else {
  46          //echo "<img type=\"image\" src=\"../elements/images/disabled.gif\" border='0' alt='".$_GET['ip']."' title='".$_GET['ip']."' />";
  47          echo "<img type=\"image\" src=\"../elements/images/disabled.gif\" border=\"0\" alt=\"" . $_GET['ip'] . "\" title=\"" . $_GET['ip'] . "\" />";
  48      }
  49  } elseif ($_GET['mode'] == 'session') {
  50      $res = get_smbsess($_GET['nom_machine']);
  51      echo $res['html'];
  52  } elseif ($_GET['mode'] == 'wake_shutdown_or_reboot') {
  53      wake_shutdown_or_reboot($_GET['ip'], $_GET['nom'], $_GET['wake'], $_GET['shutdown_reboot']);
  54  } elseif ($_GET['mode'] == 'check_versions_sysresccd') {
  55      $resultat2 = exec("/usr/bin/sudo /usr/share/se3/scripts/se3_get_sysresccd.sh 'check_version'", $retour);
  56      foreach ($retour as $key => $value) {
  57          echo $value;
  58      }
  59  } elseif ($_GET['mode'] == 'check_versions_udpcast') {
  60      $resultat2 = exec("/usr/bin/sudo /usr/share/se3/scripts/se3_get_udpcast.sh 'check_version'", $retour);
  61      foreach ($retour as $key => $value) {
  62          echo $value;
  63      }
  64  } elseif ($_GET['mode'] == 'check_versions_slitaz') {
  65      $resultat2 = exec("/usr/bin/sudo /usr/share/se3/scripts/se3_get_slitaz.sh 'check_version'", $retour);
  66      foreach ($retour as $key => $value) {
  67          echo $value;
  68      }
  69  } elseif ($_GET['mode'] == 'check_versions_pxe_client_linux') {
  70      $resultat2 = exec("/usr/bin/sudo /usr/share/se3/scripts/se3_get_install_client_linux.sh 'check_version'", $retour);
  71      foreach ($retour as $key => $value) {
  72          echo $value;
  73      }
  74  }
  75  ?>


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