Пример #1
0
        $type = 'ICMP';
        break;
    case 4:
        $type = 'other';
        break;
    default:
        die(_('Wrong type'));
}
$limit = $limit < 1 || $limit > 7 ? 1 : $limit;
$end = time();
$begind = $end - $limit * 86400;
//86400 belongs to 24 hours in seconds --> 24*60*60
$nfsen_sensors = get_nfsen_sensors();
$sensor_list = '';
foreach ($nfsen_sensors as $flow_id => $sdata) {
    if (!Av_sensor::is_channel_allowed($conn, $flow_id)) {
        continue;
    }
    $sname = Av_sensor::get_nfsen_channel_name($conn, $flow_id);
    $sensor_list .= "{$flow_id};{$sname}:";
}
$sensor_list = preg_replace('/:$/i', '', $sensor_list);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<?php 
//If the refresh is enabled, we set it up in the meta.
if (isset($winfo['refresh']) && $winfo['refresh'] != 0) {
    echo '<meta http-equiv="refresh" content="' . $winfo['refresh'] . '">';
Пример #2
0
function allowed_nfsen_section()
{
    if (Session::am_i_admin()) {
        return true;
    }
    require_once 'ossim_db.inc';
    $db = new ossim_db();
    $conn = $db->connect();
    $flag = true;
    // Decode channel information
    foreach ($_SESSION['profileinfo']['all_channels'] as $channel) {
        if (!Av_sensor::is_channel_allowed($conn, $channel)) {
            $flag = false;
            break;
        }
    }
    $db->close();
    return $flag;
}