Beispiel #1
0
     $oldStatus = "<font style='color:#04B486'>Online</font>";
     $newStatus = "<font style='color:#DF0101'>Offline</font>";
 } else {
     $oldStatus = "<font style='color:#DF0101'>Offline</font>";
     $newStatus = "<font style='color:#04B486'>Online</font>";
 }
 //set subnet
 $subnet = $Subnets->fetch_subnet(null, $change['subnetId']);
 //ago
 if (is_null($change['lastSeen']) || $change['lastSeen'] == "1970-01-01 00:00:01" || $change['lastSeen'] == "0000-00-00 00:00:00") {
     $ago = "never";
 } else {
     $timeDiff = $now - strtotime($change['lastSeen']);
     // reformat
     $lastSeen = date("m/d H:i", strtotime($change['lastSeen']));
     $ago = $lastSeen . " (" . $Result->sec2hms($timeDiff) . " ago)";
 }
 // desc
 $change['description'] = strlen($change['description']) > 0 ? "{$Subnets->mail_font_style} {$change['description']}</font>" : "{$Subnets->mail_font_style} / </font>";
 // subnet desc
 $subnet->description = strlen($subnet->description) > 0 ? "{$Subnets->mail_font_style} {$subnet->description}</font>" : "{$Subnets->mail_font_style} / </font>";
 //content
 $content[] = "<tr>";
 $content[] = "\t<td style='padding:3px 8px;border:1px solid #ccc;'><a href='" . rtrim(str_replace(BASE, "", $Scan->settings->siteURL), "/") . "" . create_link("subnets", $subnet->sectionId, $subnet->id) . "'>{$Subnets->mail_font_style_href} " . $Subnets->transform_to_dotted($change['ip_addr']) . "</font></a></td>";
 $content[] = "\t<td style='padding:3px 8px;border:1px solid #ccc;'>{$Subnets->mail_font_style} {$change['description']}</font></td>";
 $content[] = "\t<td style='padding:3px 8px;border:1px solid #ccc;'>{$Subnets->mail_font_style_href} {$change['dns_name']}</font></td>";
 $content[] = "\t<td style='padding:3px 8px;border:1px solid #ccc;'><a href='" . rtrim(str_replace(BASE, "", $Scan->settings->siteURL), "/") . "" . create_link("subnets", $subnet->sectionId, $subnet->id) . "'>{$Subnets->mail_font_style_href} " . $Subnets->transform_to_dotted($subnet->subnet) . "/" . $subnet->mask . "</font></a>" . $subnet->description . "</td>";
 $content[] = "\t<td style='padding:3px 8px;border:1px solid #ccc;'>{$Subnets->mail_font_style} {$ago}</td>";
 $content[] = "\t<td style='padding:3px 8px;border:1px solid #ccc;'>{$Subnets->mail_font_style} {$oldStatus} > {$newStatus}</td>";
 $content[] = "</tr>";
 //plain content
Beispiel #2
0
         $oldStatus = "<font style='color:#04B486'>Online</font>";
         $newStatus = "<font style='color:#DF0101'>Offline</font>";
     } else {
         $oldStatus = "<font style='color:#DF0101'>Offline</font>";
         $newStatus = "<font style='color:#04B486'>Online</font>";
     }
     //set subnet
     $subnet = $Subnets->fetch_subnet(null, $change['subnetId']);
     //set section
     $section = $Tools->fetch_object("sections", "id", $subnet->sectionId);
     //ago
     if (is_null($change['lastSeen']) || $change['lastSeen'] == "0000-00-00 00:00:00") {
         $ago = "never";
     } else {
         $timeDiff = time() - strtotime($change['lastSeen']);
         $ago = $change['lastSeen'] . " (" . $Result->sec2hms($timeDiff) . " ago)";
     }
     //content
     $content[] = "<tr>";
     $content[] = "\t<td style='padding:3px 8px;border:1px solid silver;'><a href='" . rtrim($Scan->settings->siteURL, "/") . "" . create_link("subnets", $section->id, $subnet->id) . "'>" . $Subnets->transform_to_dotted($change['ip_addr']) . "</a></td>";
     $content[] = "\t<td style='padding:3px 8px;border:1px solid silver;'>{$change['description']}</td>";
     $content[] = "\t<td style='padding:3px 8px;border:1px solid silver;'><a href='" . rtrim($Scan->settings->siteURL, "/") . "" . create_link("subnets", $section->id, $subnet->id) . "'>" . $Subnets->transform_to_dotted($subnet->subnet) . "/" . $subnet->mask . " - " . $subnet->description . "</a></td>";
     $content[] = "\t<td style='padding:3px 8px;border:1px solid silver;'><a href='" . rtrim($Scan->settings->siteURL, "/") . "" . create_link("subnets", $section->id) . "'>{$section->name} {$section->description}</a></td>";
     $content[] = "\t<td style='padding:3px 8px;border:1px solid silver;'>{$ago}</td>";
     $content[] = "\t<td style='padding:3px 8px;border:1px solid silver;'>{$oldStatus}</td>";
     $content[] = "\t<td style='padding:3px 8px;border:1px solid silver;'>{$newStatus}</td>";
     $content[] = "</tr>";
     //plain content
     $content_plain[] = "\t * " . $Subnets->transform_to_dotted($change['ip_addr']) . " (" . $Subnets->transform_to_dotted($subnet->subnet) . "/" . $subnet->mask . ")\r\n \t  " . strip_tags($oldStatus) . " => " . strip_tags($newStatus);
 }
 $content[] = "</table>";