Ejemplo n.º 1
0
if (POST('withoutmenu') != "1") {
    include "../hmenu.php";
    $get_param = "name={$ngname}";
} else {
    $get_param = "name={$ngname}&withoutmenu=1";
}
if (POST('insert') && !empty($ngname)) {
    if ($error == true) {
        $txt_error = "<div>" . _("We Found the following errors") . ":</div><div style='padding:10px;'>" . implode("<br/>", $message_error) . "</div>";
        Util::print_error($txt_error);
        Util::make_form("POST", "newnetgroupform.php?" . $get_param);
        die;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    Net_group::update($conn, $ngname, $threshold_c, $threshold_a, $rrd_profile, $networks, $descr);
    Net_group_scan::delete($conn, $ngname, 3001);
    //if (POST('nessus')) { Net_group_scan::insert($conn, $ngname, 3001, 0); }
    $db->close($conn);
    Util::clean_json_cache_files("(policy|vulnmeter|hostgroup)");
}
if (isset($_SESSION['_netgroup'])) {
    unset($_SESSION['_netgroup']);
}
if ($_SESSION["menu_sopc"] == "Network groups" && POST('withoutmenu') != "1") {
    ?>
	<p> <?php 
    echo _("Network Group succesfully updated");
    ?>
 </p>
	<script type='text/javascript'>document.location.href="netgroup.php"</script>
Ejemplo n.º 2
0
"/>
</head>

<body>
    <?php 
if (POST('insert') && empty($data['data']['id'])) {
    if ($data['status'] == 'error') {
        $txt_error = "<div>" . _("The following errors occurred") . ":</div>\n    \t\t\t\t\t  <div style='padding: 2px 10px 5px 10px;'>" . implode("<br/>", $validation_errors) . "</div>";
        $config_nt = array('content' => $txt_error, 'options' => array('type' => 'nf_error', 'cancel_button' => false), 'style' => 'width: 80%; margin: 20px auto; text-align: left;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        exit;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    Net_group::update($conn, $id, $ctx, $ngname, $rrd_profile, $networks, $descr);
    Net_group_scan::delete($conn, $id, 3001);
    $db->close();
    Util::memcacheFlush();
    ?>
    	
    	<script type='text/javascript'>
            if (!parent.is_lightbox_loaded(window.name))
            {
                document.location.href="netgroup.php?msg=created";
            }
            else
            {
                document.location.href="netgroup_form.php?id=<?php 
    echo $id;
    ?>