Exemplo n.º 1
0
		<?php 
    echo gettext("No");
    ?>
 </a>
    </p>
<?php 
    exit;
}
require_once 'ossim_db.inc';
require_once 'classes/Net_group.inc';
require_once 'classes/Net_group_scan.inc';
$db = new ossim_db();
$conn = $db->connect();
if (Net_group::can_delete($conn, $name)) {
    Net_group::delete($conn, $name);
    Net_group_scan::delete($conn, $name, 3001);
} else {
    echo "ERROR_CANNOT";
}
$db->close($conn);
?>

    <p> <?php 
echo gettext("Network group deleted");
?>
 </p>
    <p><a href="netgroup.php"><?php 
echo gettext("Back");
?>
 </a></p>
    <?php 
Exemplo n.º 2
0
    exit;
}
switch ($action) {
    case 'delete_netgroup':
        $name = explode(";", POST('name'));
        foreach ($name as $netgroup_id) {
            ossim_valid($netgroup_id, OSS_HEX, 'illegal:' . _('Network group'));
            if (ossim_error()) {
                $data['status'] = 'error';
                $data['data'] = ossim_get_error_clean();
                echo json_encode($data);
                exit;
            }
        }
        $db = new ossim_db();
        $conn = $db->connect();
        $data['status'] = 'OK';
        $data['data'] = _('Network group removed successfully');
        foreach ($name as $netgroup_id) {
            if (Net_group::can_delete($conn, $netgroup_id)) {
                Net_group::delete($conn, $netgroup_id);
                Net_group_scan::delete($conn, $netgroup_id, 3001);
            } else {
                $data['status'] = 'error';
                $data['data'] = _('Error! Network group could not be removed. This network group belongs to a policy');
            }
        }
        $db->close();
        break;
}
echo json_encode($data);
Exemplo n.º 3
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;
    ?>
&msg=saved";