[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/popup/ -> popcomputer.inc.php (source)

   1  <?php
   2    
   3     /**    
   4     * Permet d'envoyer des popup a un parc 
   5     * @Version $Id: popparc.inc.php 2939 2008-05-04 14:20:22Z plouf $ 
   6     
   7    
   8     * @Projet LCS / SambaEdu 
   9     
  10     * @auteurs Philippe Peter Caen 
  11     
  12     * @Licence Distribue selon les termes de la licence GPL
  13     
  14     * @note 
  15     
  16     */
  17  
  18     /**
  19  
  20     * @Repertoire: popup
  21     * file: popparc.php
  22  
  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-popup',"/var/www/se3/locale");
  33  textdomain ('se3-popup');
  34  
  35  
  36    
  37    $computer=$_POST['computer'];
  38    $filtrecomp=isset($_POST['filtrecomp']) ? $_POST['filtrecomp'] : "";
  39  
  40  if (is_admin("computers_is_admin",$login)=="Y") {
  41  
  42      //aide
  43          $_SESSION["pageaide"]="Gestion_des_parcs#Envoi_d.27un_popup";
  44          
  45      // Affichage du formulaire de selection de machine
  46          if (!isset($computers)) {
  47          echo "<H1>".gettext("Pop Down :-) ")."</H1>\n";
  48          echo "<BR>";
  49              echo "<H3>".gettext("S&#233;lection de la machine destinataire du Pop Up")."</H3>";
  50          echo "<FORM action=\"popcomputer.inc.php\" method=\"post\">\n";
  51                  echo "<P>".gettext("Lister les noms contenant: ");
  52                  echo "<INPUT TYPE=\"text\" NAME=\"filtrecomp\"\n VALUE=\"$filtrecomp\" SIZE=\"8\">";
  53                  echo "<input type=\"submit\" value=\"".gettext("Valider")."\">\n";
  54                  echo "<br><br></FORM>\n";
  55  
  56          
  57           if ($filtrecomp == '') 
  58              $filtrel = '*';
  59          else 
  60              $filtrel = "*$filtrecomp*";
  61          $list_machines=search_machines("(&(cn=$filtrel)(objectClass=ipHost))","computers");
  62              if ( count($list_machines)>0) {
  63              echo gettext("Choisir les machines:")." \n";
  64                      echo "<FORM method=\"post\" action=\"popcomputer.inc.php\">\n"; 
  65                      echo "<SELECT NAME=\"computers[]\" multiple=\"multiple\" SIZE=\"".count($list_machines)."\">";
  66                      for ($loop=0; $loop < count($list_machines); $loop++) {
  67                              echo "<option value=\"".$list_machines[$loop]["cn"]."\">".$list_machines[$loop]["cn"]."\n";
  68                          }
  69                      echo "</SELECT>&nbsp;&nbsp;\n";
  70                      echo "<input type=\"submit\" value=\"".gettext("Valider")."\">\n";
  71                      echo "</FORM>\n";
  72                 }
  73         } else {
  74          $computers = $computers;
  75          $nbrconnect=0;
  76          for ($loop=0; $loop < count($computers); $loop++) {
  77              $connect=`smbstatus |grep -w $computers[$loop]`;
  78              if (empty($connect)) {
  79                  echo "<LI><small><b>$computers[$loop]</b> n'est pas connect&#233;e !</small></LI>";
  80                      } else {
  81                                  $nbrconnect= $nbrconnect + 1;
  82                                  exec ("cat /tmp/popup.txt|smbclient -U 'Administrateur Samba Edu 3' -M $computers[$loop]");
  83                                  echo "<LI><small><b>$computers[$loop]</b>".gettext(" est destinataire du Pop Up")."</small></LI>";
  84              }
  85          }
  86          echo "<br><br>";
  87               if ($nbrconnect==0) {
  88                     echo "<b><small>".gettext("Pas d'&#233;mission de Pop Up car aucune machine n'est actuellement connect&#233;e !")."</small></b>";
  89                  } else {
  90                     echo gettext("Nombre total de popup &#233;mis: ")." $nbrconnect";
  91                 }
  92  
  93      }
  94  }
  95  
  96  include ("pdp.inc.php");
  97  
  98  ?>
  99  


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