/**
  * Constructor.
  *
  * @return void
  */
 public function __construct($tagProperties = array())
 {
     $this->pdf = Pdf::singleton();
     if (isset($tagProperties['ID'])) {
         $this->id = $tagProperties['ID'];
         if (!isset($this->pdf->linksIds[$this->id])) {
             $this->pdf->linksIds[$this->id] = $this->pdf->AddLink();
         }
         $this->pdf->SetLink($this->pdf->linksIds[$this->id], -1);
     }
 }
Exemple #2
0
     $pdf->SetFont('Helvetica', '', 10);
 }
 $pdf->SetFillColor(238, 238, 238);
 $pdf->Cell(28, 6, $HostIP, 1, 0, 'C', 1);
 $pdf->Cell(52, 6, $HostName, 1, 0, 'C', 1);
 //$pdf->Cell(20, 6, "LocalChks",1,0,'C');
 $pdf->Cell(22, 6, $Serious, 1, 0, 'C', 1);
 $pdf->Cell(22, 6, $High, 1, 0, 'C', 1);
 $pdf->Cell(22, 6, $Med, 1, 0, 'C', 1);
 $pdf->Cell(22, 6, $Low, 1, 0, 'C', 1);
 $pdf->Cell(22, 6, $Info, 1, 0, 'C', 1);
 //$pdf->Cell(20, 6, "Exceptions",1,0,'C');
 $pdf->Ln();
 foreach ($hosts as $hostIP_ctx => $hostname) {
     list($hostIP, $hostctx) = explode("#", $hostIP_ctx);
     ${"IP_" . $hostIP_ctx} = $pdf->AddLink();
     $pdf->Cell(28, 6, $hostIP, 1, 0, 'C', 0, ${"IP_" . $hostIP_ctx});
     $pdf->Cell(52, 6, $hostname, 1, 0, 'C', 0, ${"IP_" . $hostIP_ctx});
     //$pdf->Cell(20, 6, $check_text,1,0,'C');
     $host_risk = array(0, 0, 0, 0, 0, 0, 0, 0);
     $query1 = "SELECT COUNT( risk ) AS count, risk FROM (\n                        SELECT DISTINCT risk, port, protocol, app, scriptid, msg, hostIP\n                        FROM vuln_nessus_results t1\n                        WHERE t1.report_id in ({$report_id})\n                        AND t1.ctx=UNHEX('{$hostctx}')\n                        AND t1.hostIp='{$hostIP}'\n                        {$perms_where}\n                        {$query_critical}\n                        and t1.falsepositive <> 'Y') as t group by hostIP, risk";
     $ecount = 0;
     $result1 = $dbconn->Execute($query1);
     $prevrisk = 0;
     $Eriskcount = 0;
     while ($result1->fields) {
         $riskcount = $result1->fields['count'];
         $risk = $result1->fields['risk'];
         if ($ecount > 0) {
             $Eriskcount += $ecount;
             $riskcount -= $ecount;