Beispiel #1
0
        ossim_valid($id, OSS_HEX, 'illegal:' . _("Policy ID"));
        if (ossim_error()) {
            die(ossim_error());
        }
        Policy::update($conn, $id, $ctx, $priority, $active, $group, $order, $tzone, $b_month, $b_month_day, $b_week_day, $b_hour, $b_minute, $e_month, $e_month_day, $e_week_day, $e_hour, $e_minute, $descr, $source_ips, $source_host_groups, $dest_ips, $dest_host_groups, $source_nets, $source_net_groups, $dest_nets, $dest_net_groups, $portsrc, $portdst, $plug_groups, $sensors, $target, $taxonomy, $reputation, $event_conds, $idm, $correlate, $cross_correlate, $store, $rep, $qualify, $resend_alarms, $resend_events, $frw_conds, $sign, $sem, $sim);
        // Actions
        if (count($policy_action) > 0) {
            Policy_action::delete($conn, $id);
            foreach ($policy_action as $action_id) {
                Policy_action::insert($conn, $action_id, $id);
            }
        }
        break;
    case 'clone':
        $order = Policy::get_next_order($conn, $ctx, $group);
        $newid = Policy::insert($conn, $ctx, $priority, $active, $group, $order, $tzone, $b_month, $b_month_day, $b_week_day, $b_hour, $b_minute, $e_month, $e_month_day, $e_week_day, $e_hour, $e_minute, $descr, $source_ips, $source_host_groups, $dest_ips, $dest_host_groups, $source_nets, $source_net_groups, $dest_nets, $dest_net_groups, $portsrc, $portdst, $plug_groups, $sensors, $target, $taxonomy, $reputation, $event_conds, $idm, $correlate, $cross_correlate, $store, $rep, $qualify, $resend_alarms, $resend_events, $frw_conds, $sign, $sem, $sim);
        // Actions
        if (!empty($newid) && count($policy_action) > 0) {
            foreach ($policy_action as $action_id) {
                Policy_action::insert($conn, $action_id, $newid);
            }
        }
        break;
    default:
        die(_('Wrong option chosen'));
}
$db->close();
?>
    <p> <?php 
echo _("Policy successfully inserted");
?>
Beispiel #2
0
    if (!strcasecmp($target_any, "any")) {
        array_push($target, "any");
    }
    /* actions / responses */
    $responses = array();
    $actions = POST('actions');
    if ($actions) {
        foreach ($actions as $action_id) {
            ossim_valid($action_id, OSS_DIGIT, 'illegal:' . _("Action ID"));
            $responses[] = $action_id;
        }
    }
    if ($order == 0) {
        $order = Policy::get_next_order($conn, $group);
    }
    $newid = Policy::insert($conn, $priority, $active, $group, $order, $begin_hour, $end_hour, $begin_day, $end_day, $descr, $source_ips, $source_host_groups, $dest_ips, $dest_host_groups, $source_nets, $source_net_groups, $dest_nets, $dest_net_groups, $ports, $plug_groups, $sensors, $target, $correlate, $cross_correlate, $store, $qualify, $resend_alarms, $resend_events, $sign, $sem, $sim);
    // Response/Actions
    if (count($responses) > 0) {
        foreach ($responses as $action_id) {
            Policy_action::insert($conn, $action_id, $newid);
        }
        Response::insert($conn, "policy {$newid}", $source_nets, $source_ips, $dest_nets, $dest_ips, $sensors, $ports, $ports, $plug_ids, $responses);
    }
    ?>
    <p> <?php 
    echo gettext("Policy succesfully inserted");
    ?>
 </p>
    <script>document.location.href="policy.php"</script>
<?php 
    $db->close($conn);