Esempio n. 1
0
}
# validate $_POST['action'] values
if ($_POST['action'] != 'add' && $_POST['action'] != 'edit' && $_POST['action'] != 'delete') {
    $Result->show("danger", _("Invalid action. Do not manipulate the POST values!"), true);
}
# disable edit on delete
$readonly = $_POST['action'] == "delete" ? "disabled" : "";
# fetch all firewall zones
$firewallZones = $Zones->get_zones();
# fetch settings
$firewallZoneSettings = json_decode($User->settings->firewallZoneSettings, true);
# fetch all devices
$devices = $Tools->fetch_multiple_objects("devices", "type", $firewallZoneSettings['deviceType']);
# fetch old mapping
if ($_POST['action'] != 'add') {
    $mapping = $Zones->get_zone_mapping($_POST['id']);
}
?>
<!-- header  -->
<div class="pHeader"><?php 
print _('Add a mapping between a firewall device and a firewall zone');
?>
</div>
<!-- content -->
<div class="pContent">
	<!-- form -->
	<form id="mappingEdit">

	<!-- table -->
	<table class="table table-noborder table-condensed">
	<!-- zone name -->
Esempio n. 2
0
    if (!empty($vrf['description'])) {
        $vrfText .= " [{$vrf['description']}]";
    }
    print "<tr>";
    print "\t<th>" . _('VRF') . "</th>";
    print "\t<td>{$vrfText}</td>";
    print "</tr>";
}
# FW zone info
if ($User->settings->enableFirewallZones == 1) {
    # search
    $zone_check = $Tools->fetch_object("firewallZones", "subnetId", $subnet['id']);
    if ($zone_check !== false) {
        # class
        $Zones = new FirewallZones($Database);
        $zone = $Zones->get_zone_mapping($zone_check->id);
        if ($zone !== false) {
            // alias fix
            $zone->alias = strlen($zone->alias) > 0 ? "(" . $zone->alias . ")" : "";
            $zone->description = strlen($zone->description) > 0 ? " - " . $zone->description : "";
            $zone->interface = strlen($zone->interface) > 0 ? "(" . $zone->interface . ")" : "";
            # divider
            print "<tr>";
            print "\t<td colspan='2'><hr></td>";
            print "</tr>";
            # zone details
            print "<tr>";
            print "\t<th>" . _('Firewall Zone') . "</th>";
            print "\t<td>";
            print $zone->zone . " " . $zone->alias . " " . $zone->description . "<br>" . $zone->deviceName . " " . $zone->interface;
            print "\t</td>";