[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-clamav/www/ -> clamav-log.php (source)

   1  <?php
   2  
   3  /**
   4  
   5     * Page clamv
   6     * @Version $Id: clamav-log.php 8471 2015-02-14 17:19:26Z plouf $
   7  
   8     * @Projet LCS / SambaEdu
   9  
  10     * @auteurs
  11  
  12     * @Licence Distribue selon les termes de la licence GPL
  13  
  14     * @note
  15  
  16     */
  17  
  18     /**
  19  
  20     * @Repertoire: /se3-clamav
  21     * file: clamav-log.php
  22     */
  23  
  24  
  25  
  26  require("entete.inc.php");
  27  require  ("ihm.inc.php");
  28  
  29  // HTMLpurifier
  30  include ("../se3/includes/library/HTMLPurifier.auto.php");
  31  $config = HTMLPurifier_Config::createDefault();
  32  $purifier = new HTMLPurifier($config);
  33  
  34  $directory=$purifier->purify($_POST[directory]);
  35  
  36  if ( is_admin("se3_is_admin",$login)!="Y") die (gettext("Vous n'avez pas les droits suffisants pour acc&eacute;der &agrave; cette fonction"
  37  )."</BODY></HTML>");
  38  
  39  echo "<h1> Solution antivirus serveur</h1>\n";
  40  if (isset($directory)) {
  41      print "<h2> Log des scans du r&eacute;pertoire".$directory."</h2>\n";
  42      if (! isset($scan_start)) $scan_start=0;
  43      $query=" SELECT * FROM clamav_scan WHERE directory='".$directory."'";
  44      $query .=" ORDER BY id desc ";
  45      $query .="LIMIT $scan_start,1";
  46      
  47      $result = mysql_query($query);
  48      
  49      if (($result)) {
  50        echo "<TABLE width='100%'><TR><TD WIDTH='50%' align=\"left\">";
  51        if ($scan_start!=0) {
  52          echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>\n";
  53          $previous_scan_start=$scan_start-1;
  54          echo "<input type=\"hidden\" name=\"scan_start\" value=\"$previous_scan_start\"/>";
  55          print "<input type=\"hidden\" name=\"directory\" value=\"".$directory."\">\n";
  56          print "<input type=\"submit\" value=\"".gettext("Afficher les logs pr&eacute;c&eacute;dents.")."\">\n";
  57          print "</form>\n";
  58          }
  59        echo"</td>\n";
  60        if (mysql_num_rows($result)==0) {
  61          echo "<td></td></tr></table>\n";
  62          echo gettext("fin des logs de scan");
  63        } else {
  64          echo "<td width=\"50%\" align=\"right\">";
  65          echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>\n";
  66          $next_scan_start=$scan_start+1;
  67          echo "<input type=\"hidden\" name=\"scan_start\" value=\"$next_scan_start\"/>";
  68          print "<input type=\"hidden\" name=\"directory\" value=\"".$directory."\">\n";
  69          print "<input type=\"submit\" value=\"".gettext("Afficher les logs suivants.")."\">\n";
  70          print "</form>\n";
  71          echo "</td></tr></table>\n";
  72          // affichage de la table connexions
  73          echo "<TABLE  align='center' border='1'>\n";
  74          echo "<TR><TH> Log du scan par clamav</TH></TR>\n";
  75          $r=mysql_fetch_array($result);
  76         // SUMMARY
  77          echo "<TR><TD class=\"menuheader\">\n";
  78          echo "r&eacute;sum&eacute;";
  79          echo "</TD></TR>";
  80          echo "<TR><TD><pre>\n";        
  81          echo $r["summary"];
  82          echo "</pre></TD></TR>";
  83          //SCAN RESULT
  84          echo "<TR><TD class=\"menuheader\">\n";
  85          echo "R&eacute;sultat du scan";
  86          echo "</TD></TR>";
  87          echo "<TR><TD><pre>\n";        
  88          echo $r["result"];
  89          echo "</pre></TD></TR></TABLE>\n";
  90          }
  91        }
  92      } else {  
  93      $query="SELECT DISTINCT directory FROM clamav_scan"; 
  94      $result = mysql_query($query);
  95  
  96      print "<form action='".$_SERVER['PHP_SELF']."' method='post'>\n";
  97      while ($r=mysql_fetch_array($result)) {
  98        print "<input type=\"radio\" name=\"directory\" value=\"".$r["directory"]."\">\n"; 
  99        print gettext("Log des scans du r&eacute;pertoire ".$r["directory"]);
 100        print "<br/>\n";
 101      }
 102      print "<input type=\"submit\" value=\"".gettext("Afficher les logs.")."\">\n";
 103      print "</form>\n";    
 104  }
 105  
 106  require ("pdp.inc.php");
 107  ?>


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