Пример #1
0
}
if ($list = GET('delete_backlog')) {
    if (!Session::menu_perms("MenuIncidents", "ControlPanelAlarmsDelete")) {
        die(ossim_error("You don't have required permissions to delete Alarms"));
    } else {
        if (check_uniqueid($prev_unique_id, $param_unique_id)) {
            if (!strcmp($list, "all")) {
                $backlog_id = $list;
                $id = null;
            } else {
                list($backlog_id, $id) = split("-", $list);
            }
            if (GET('only_close') != "") {
                $backlog_id = "closeall";
            }
            Alarm::delete_from_backlog($conn, $backlog_id, $id);
        } else {
            die(ossim_error("Can't do this action for security reasons."));
        }
    }
}
if (!empty($delete_day)) {
    if (!Session::menu_perms("MenuIncidents", "ControlPanelAlarmsDelete")) {
        die(ossim_error("You don't have required permissions to delete Alarms"));
    } else {
        if (check_uniqueid($prev_unique_id, $param_unique_id)) {
            Alarm::delete_day($conn, $delete_day);
        } else {
            die(ossim_error("Can't do this action for security reasons."));
        }
    }
Пример #2
0
    die(ossim_error("You don't have required permissions to delete Alarms"));
}
// check unique_id for alarms
if (check_uniqueid($prev_unique_id, $param_unique_id)) {
    foreach ($_POST as $key => $value) {
        if (preg_match("/check_(\\d+)_(\\d+)/", $key, $found)) {
            if ($only_close) {
                Alarm::close($conn, $found[2]);
            } elseif ($move_tag != "") {
                if ($move_tag > 0) {
                    Tags::set_alarm_tag($conn, $found[1], $move_tag);
                } else {
                    Tags::del_alarm_tag($conn, $found[1]);
                }
            } else {
                Alarm::delete_from_backlog($conn, $found[1], $found[2]);
            }
            //echo "<tr><td class='nobborder'>Alarm deleted: <font color='red'><b>" . $found[1] . "-" . $found[2] . "</b></font></td></tr>";
        }
    }
    //header ("Location: alarm_console.php");
    ?>
<html>
<head><title>Delete Selected Alarms</title></head>
<?php 
    if (!$background) {
        ?>
<body><script>document.location.href='alarm_console.php?hide_closed=<?php 
        echo $hide_closed;
        ?>
&query=<?php 
Пример #3
0
    $to_date = $timestamp != "" ? $timestamp : null;
}
if ($only_delete) {
    for ($i = 1; $i <= $only_delete; $i++) {
        $data = explode("_", GET('group' . $i));
        $name = $_SESSION[$data[0]];
        $src_ip = $data[1];
        $dst_ip = $data[2];
        $timestamp = $data[3];
        $timestamp_date = preg_replace("/ \\d\\d\\:\\d\\d\\:\\d\\d/", "", $timestamp);
        AlarmGroups::delete_group($conn, $data[0], $_SESSION["_user"]);
        list($list, $num_rows) = AlarmGroups::get_alarms($conn, $src_ip, $dst_ip, 0, "", null, null, $timestamp, $timestamp_date, $name);
        foreach ($list as $s_alarm) {
            $s_backlog_id = $s_alarm->get_backlog_id();
            $s_event_id = $s_alarm->get_event_id();
            Alarm::delete_from_backlog($conn, $s_backlog_id, $s_event_id);
        }
    }
    exit;
}
if ($only_close) {
    for ($i = 1; $i <= $only_close; $i++) {
        $data = explode("_", GET('group' . $i));
        $name = $_SESSION[$data[0]];
        $src_ip = $data[1];
        $dst_ip = $data[2];
        $timestamp = $data[3];
        AlarmGroups::change_status($conn, $data[0], "closed");
        list($list, $num_rows) = AlarmGroups::get_alarms($conn, $src_ip, $dst_ip, 0, "", null, null, $from_date, $to_date, $name);
        foreach ($list as $s_alarm) {
            $s_backlog_id = $s_alarm->get_backlog_id();