예제 #1
0
Session::logcheck("MenuPolicy", "PolicyNetworks");
$db = new ossim_db();
$conn = $db->connect();
$net_name = GET('name');
$update = intval(GET('update'));
$removeicon = intval(GET('removeicon'));
$clone = GET('clone') == 1 ? 1 : 0;
$style_success = "style='display: none;'";
if ($update == 1) {
    $success_message = gettext("Network succesfully updated");
    $style_success = "style='display: block;text-align:center;'";
}
$array_assets = array('0' => '0', "1" => "1", "2" => "2", "3" => "3", "4" => "4", "5" => "5");
$info_CIDR = "<div style='font-weight:normal; width: 170px;'>\n\t\t\t\t<div><span class='bold'>Format:</span> CIDR [,CIDR,...]</div>\n\t\t\t\t<div><span class='bold'>CIDR:</span> xxx.xxx.xxx.xxx/xx</div>\n\t\t\t</div>";
if ($removeicon) {
    Net::clean_icon($conn, $net_name);
}
if (isset($_SESSION['_net'])) {
    $net_name = $_SESSION['_net']['net_name'];
    $cidr = $_SESSION['_net']['cidr'];
    $descr = $_SESSION['_net']['descr'];
    $asset = $_SESSION['_net']['asset'];
    $sensors = $_SESSION['_net']['sensors'];
    $threshold_a = $_SESSION['_net']['threshold_a'];
    $threshold_c = $_SESSION['_net']['threshold_c'];
    $rrd_profile = $_SESSION['_net']['rrd_profile'];
    $nagios = $_SESSION['_net']['nagios'];
    unset($_SESSION['_net']);
} else {
    $conf = $GLOBALS["CONF"];
    $threshold_a = $threshold_c = $conf->get_conf("threshold");