Пример #1
0
</head>

<body>

<?php 
if (POST('withoutmenu') != "1") {
    include "../hmenu.php";
    $get_param = "ip={$ip}&name=" . urlencode($sname);
} else {
    $get_param = "ip={$ip}&name=" . urlencode($sname) . "&withoutmenu=1";
}
if (POST('insert') && !empty($sname)) {
    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", "modifysensorform.php?" . $get_param);
        die;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    Sensor::update($conn, $sname, $ip, $priority, $port, $tzone, $descr);
    $db->close($conn);
    Util::clean_json_cache_files("sensors");
}
if (isset($_SESSION['_sensor'])) {
    unset($_SESSION['_sensor']);
}
?>
    <script type='text/javascript'>document.location.href="modifysensorform.php?<?php 
echo $get_param;
?>
Пример #2
0
	<meta http-equiv="Pragma" content="no-cache"/>
	<link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>

<body>
<?php 
if (POST('insert')) {
    if ($data['status'] == 'error') {
        $txt_error = "<div>" . _("We Found the following errors") . ":</div>\n    \t\t\t\t\t  <div style='padding: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();
        Util::make_form("POST", "newlocationsform.php");
        die;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    $newid = Locations::insert($conn, $ctx, $name, $desc, $location, $latitude, $longitude, $cou);
    Util::memcacheFlush();
    $db->close($conn);
}
?>
    <script type='text/javascript'>
        if (!parent.is_lightbox_loaded(window.name))
        {
            document.location.href="locations.php?msg=updated";
        }
        else
Пример #3
0
	<meta http-equiv="Pragma" content="no-cache"/>
	<link type="text/css" rel="stylesheet" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>

<body>
    <?php 
if (POST('insert')) {
    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();
        Util::make_form('POST', 'newsensorform.php');
        exit;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    $new_id = Util::uuid();
    try {
        $new = new Av_Sensor($new_id);
        $new->set_properties(array('version' => '', 'has_nagios' => 0, 'has_ntop' => 1, 'has_vuln_scanner' => 1, 'has_kismet' => 0));
        $new->set_name($sname);
        $new->set_ip($ip);
        $new->set_priority($priority);
        $new->set_port($port);
        $new->set_tzone($tzone);
        $new->set_descr($descr);
        foreach ($entities as $ctx) {
Пример #4
0
echo Util::get_css_id();
?>
"/>
    </head>

    <body>

    <?php 
$msg = NULL;
if (empty($data['data']['login'])) {
    if ($data['status'] == 'error') {
        $txt_error = "<div>" . _('The following errors occurred') . ":</div>\n                          <div style='padding: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();
        Util::make_form('POST', "user_form.php?login={$login}");
        exit;
    } else {
        //Create or update user
        $insert_menu = FALSE;
        $language_changed = FALSE;
        $tzone_changed = FALSE;
        // MENUS
        if (!$pro && $am_i_admin && !$is_my_profile) {
            $insert_menu = true;
            $perms = array();
            list($menu_perms, $perms_check) = Session::get_menu_perms($conn);
            foreach ($menu_perms as $mainmenu => $menus) {
                foreach ($menus as $key => $menu) {
                    $cond_1 = POST("menu_perm{$key}") == 'on';
                    $cond_2 = $perms_check[$mainmenu][$key] == TRUE;
Пример #5
0
                }
            }
        }
        $period = POST('task_period');
        $enable = POST('task_enable') >= 1 ? 1 : 0;
        ossim_valid($id, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _('Task ID'));
        if (ossim_error()) {
            $data['status'] = 'error';
            $data['data']['id'] = ossim_get_error_clean();
        }
        if ($data['status'] == 'error') {
            $txt_error = '<div>' . _('We Found the following errors') . ":</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();
            Util::make_form("POST", "index.php");
            exit;
        } else {
            if (POST('mode') == 'insert') {
                $id = Inventory::insert($conn, $sensor_id, $name, $s_type_ids[$s_type], $period, $params, $enable, $nets);
                Web_indicator::set_on('Reload_tasks');
                ?>
			<script type="text/javascript">document.location.href = "index.php?s_type=<?php 
                echo $s_type;
                ?>
&msg=saved"</script>
			<?php 
                exit;
            } elseif (POST('mode') == 'update') {
                Inventory::modify($conn, $id, $sensor_id, $name, $s_type_ids[$s_type], $period, $params, $enable, $nets);
                Web_indicator::set_on('Reload_tasks');
Пример #6
0
     $db->close();
     exit;
 }
 if (!Session::hostAllowed_by_ip_ctx($conn, $ip, Session::get_default_ctx())) {
     $db->close();
     die(ossim_error(_("You don't have permission to create a new server with this IP Address")));
 }
 // Try to attach a new server
 $client = new Alienvault_client();
 $response = $client->system()->set_component($ip, $rpass);
 $return = @json_decode($response, TRUE);
 if (!$return || $return['status'] == 'error') {
     $config_nt = array('content' => $return['message'], 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto; text-align:center;');
     $nt = new Notification('nt_1', $config_nt);
     $nt->show();
     Util::make_form("POST", "newserverform.php");
     $db->close();
     exit;
 } else {
     $new_id = strtoupper(str_replace('-', '', $return['data']['server_id']));
     if ($return['data']['hostname'] != '') {
         $sname = $return['data']['hostname'];
     }
 }
 if (!isset($resend_alarms)) {
     $resend_alarms = 0;
 }
 if (!isset($resend_events)) {
     $resend_events = 0;
 }
 $new_id = Server::insert($conn, $sname, $ip, $port, $descr, $correlate, $cross_correlate, $store, $rep, $qualify, $resend_alarms, $resend_events, $sign, $sem, $sim, $alarm_to_syslog, $remoteadmin, $remotepass, $remoteurl, $fwrd_server, TRUE, $new_id);
Пример #7
0
	<meta http-equiv="Pragma" content="no-cache"/>
	<link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>
<body>

<?php 
if (POST('insert') && empty($data['data']['locations_id'])) {
    if ($data['status'] == 'error') {
        $txt_error = "<div>" . _("We Found the following errors") . ":</div>\n\t\t\t\t\t  <div style='padding: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();
        Util::make_form("POST", "newlocationsform.php?id=" . urlencode($locations_id));
        exit;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    Locations::update($conn, $locations_id, $name, $desc, $location, $latitude, $longitude, $cou);
    Util::memcacheFlush();
    $db->close();
    ?>
	<script type='text/javascript'>
        if (!parent.is_lightbox_loaded(window.name))
        {
            document.location.href="locations.php?msg=updated";
        }
        else
        {
Пример #8
0
	  <meta http-equiv="Pragma" content="no-cache"/>
	  <link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>

<body>

<?php 
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();
    Util::make_form("POST", "newportform.php");
    exit;
}
$db = new ossim_db();
$conn = $db->connect();
if (POST('insert')) {
    Port::insert($conn, $port, $protocol, $service, $descr, $ctx);
    Util::memcacheFlush();
}
$db->close();
?>

<script type='text/javascript'>
    if (!parent.is_lightbox_loaded(window.name))
    {
        document.location.href="port.php?msg=updated";
Пример #9
0
    Util::print_error($txt_error);
    if (is_numeric($ips) && isset($_SESSION["_scan"]) && $num_hosts > 0 && !$invalid_hosts) {
        Util::make_form("POST", "../host/newhostform.php?scan=1&ips={$ips}");
    } else {
        if (!$invalid_hosts) {
            unset($_SESSION["_scan"]);
        }
        Util::make_form("POST", "../netscan/index.php");
    }
    die;
}
/*
echo "<pre>";
	print_r($_SESSION["_scan"]);
echo "</pre>";
*/
if (isset($_SESSION["_scan"])) {
    $scan = $_SESSION["_scan"];
    update_db($_POST, $scan);
    echo "<br/><a href=\"../netscan/index.php\">" . _("Return to Scan Results page") . "</a><br/>";
    echo "<br/><a href=\"../host/host.php?hmenu=Assets&smenu=Hosts\">" . _("Return to host's policy") . "</a>";
} else {
    echo ossim_error(_("Error to update database values"));
    Util::make_form("POST", "../netscan/index.php");
}
?>

</body>
</html>

Пример #10
0
    $get_param = "withoutmenu=1";
}
?>

<h1><?php 
echo gettext("New Server");
?>
</h1>


<?php 
if (POST('insert')) {
    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", "newserverform.php?" . $get_param);
        die;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    if (!isset($resend_alarms)) {
        $resend_alarms = 0;
    }
    if (!isset($resend_events)) {
        $resend_events = 0;
    }
    Server::insert($conn, $sname, $ip, $port, $descr, $correlate, $cross_correlate, $store, $qualify, $resend_alarms, $resend_events, $sign, $sem, $sim);
    $db->close($conn);
}
if (isset($_SESSION['_server'])) {
    unset($_SESSION['_server']);
Пример #11
0
echo gettext('OSSIM Framework');
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>
<body>

<?php 
if ($data['status'] == 'error') {
    $txt_error = '<div>' . _('We Found the following errors') . ":</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();
    Util::make_form('POST', 'newdbsform.php');
    exit;
}
$db = new ossim_db();
$conn = $db->connect();
Databases::insert($conn, $db_name, $ip, $port, $user, $pass, $icon);
Util::memcacheFlush();
$db->close();
?>
    <script type='text/javascript'>document.location.href="dbs.php?msg=created";</script>

</body>
</html>
Пример #12
0
</head>

<body>

<?php 
if (POST('withoutmenu') != "1") {
    include "../hmenu.php";
    $get_param = "ip={$ip}";
} else {
    $get_param = "ip={$ip}&withoutmenu=1";
}
if (POST('insert') && !empty($ip)) {
    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", "modifyhostform.php?" . $get_param);
        die;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    Host::update($conn, $ip, $hostname, $asset, $threshold_c, $threshold_a, $rrd_profile, $alert, $persistence, $nat, $sensors, $descr, $os, $mac, $mac_vendor, $latitude, "{$longitude};{$zoom}", $fqdns, $icon);
    if ($hostname != $old_hostname) {
        $query = "UPDATE risk_indicators SET type_name=? WHERE type='host' AND type_name=?";
        $params = array($hostname, $hostname_old);
        $conn->Execute($query, $params);
    }
    Host_scan::delete($conn, $ip, 3001);
    Host_scan::delete($conn, $ip, 2007);
    //if (!empty($nessus)) Host_scan::insert($conn, $ip, 3001);
    Host_scan::delete($conn, $ip, 3001);
    if (!empty($nagios)) {
Пример #13
0
<?php 
if (POST('withoutmenu') != "1") {
    include "../hmenu.php";
}
?>

<h1> <?php 
echo gettext("New port");
?>
 </h1>

<?php 
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", "newsingleportform.php");
    die;
}
if (POST('insert')) {
    Port::insert($conn, $port, $protocol, $service, $descr);
}
if (isset($_SESSION['_singleport'])) {
    unset($_SESSION['_singleport']);
}
$db->close($conn);
?>
    <p> <?php 
echo gettext("Port succesfully inserted");
?>
 </p>
    <?php 
Пример #14
0
<body>

<?php 
include "../hmenu.php";
?>

<h1><?php 
echo _("Modify Agentless Host");
?>
</h1>


<?php 
if (!empty($info_error)) {
    Util::print_error($info_error);
    Util::make_form("POST", "agentless.php");
} else {
    ?>
	<div id='info' class='ossim_error' style='<?php 
    echo $display;
    ?>
'><?php 
    echo _($info);
    ?>
</div>
	   
	<table align="center" id='table_form'>
		<tr>
			<td class='nobborder subsection_1'>
				<form method="POST" name="al_modify_form_1" id="al_modify_form_1" action="al_modifyform.php?al_data=hd">
				<table width='100%'>
Пример #15
0
} else {
    $get_param = "withoutmenu=1";
}
?>
                                                                                
<h1> <?php 
echo gettext("New Database Server");
?>
 </h1>

<?php 
if (POST('insert')) {
    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", "newdbsform.php?" . $get_param);
        die;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    $icon = "";
    if (is_uploaded_file($HTTP_POST_FILES['icon']['tmp_name'])) {
        $icon = file_get_contents($HTTP_POST_FILES['icon']['tmp_name']);
    }
    Databases::insert($conn, $dbs_name, $ip, $port, $user, $pass, $icon);
    $db->close($conn);
    if (isset($_SESSION['_dbs'])) {
        unset($_SESSION['_dbs']);
    }
}
?>
Пример #16
0
        
		<div style="padding:30px">

        <?php 
if ($system_id && $rpass) {
    try {
        $data = Av_center::add_system($system_id, $rpass);
        $config_nt = array('content' => sprintf(_("<< %s >> successfully authenticated"), "<b>" . $data['hostname'] . "</b>"), 'options' => array('type' => 'nf_success', 'cancel_button' => false), 'style' => 'width: 60%; margin: 10px auto 30px auto; text-align:center;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        Util::make_form("POST", AV_MAIN_PATH . "/#configuration/deployment/components", "_top", "Close");
    } catch (Exception $e) {
        $config_nt = array('content' => $e->getMessage(), 'options' => array('type' => 'nf_error', 'cancel_button' => false), 'style' => 'width: 80%; margin: 10px auto 30px auto; text-align:center;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        Util::make_form("POST", "add_system.php?id=" . urlencode($system_id));
    }
} else {
    ?>
            
            <form action="add_system.php" method="POST">
            <input type="hidden" name="id" value="<?php 
    echo $system_id;
    ?>
">
            
                <label for="rpass"><?php 
    echo _('Please enter the root password of the remote system in order to configure it.');
    ?>
</label>
			    <br>
Пример #17
0
<body>

<?php 
//Local menu
include_once AV_MAIN_ROOT_PATH . '/local_menu.php';
?>

<div class='c_back_button' style='display:block;'>
     <input type='button' class="av_b_back" onclick="document.location.href='/ossim/ossec/agentless.php';return false;"/>
</div>

<?php 
if (!empty($critical_error)) {
    Util::print_error($critical_error);
    Util::make_form('POST', '/ossim/ossec/agentless.php');
} else {
    ?>
    <div id='info_error' style="<?php 
    echo $display;
    ?>
">
    	<?php 
    if (!empty($info_error)) {
        $config_nt = array('content' => $info_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);
        echo $nt->show();
    }
    ?>
	</div>
	
Пример #18
0
	<meta http-equiv="Pragma" content="no-cache"/>
	<link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>
<body>

<?php 
if (empty($data['data']['db_id'])) {
    if ($data['status'] == 'error') {
        $txt_error = '<div>' . _('We Found the following errors') . ":</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();
        Util::make_form('POST', 'newdbsform.php?id=' . $db_id);
        exit;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    Databases::update($conn, $db_id, $db_name, $ip, $port, $user, $pass, $icon);
    Util::memcacheFlush();
    $db->close();
    ?>
	<script type='text/javascript'>
        if (!parent.is_lightbox_loaded(window.name))
        {
            document.location.href="dbs.php?msg=updated";
        }
        else
        {
Пример #19
0
    <meta http-equiv="Pragma" content="no-cache"/>
    <link rel="stylesheet" type="text/css" href="../style/style.css"/>
</head>
<body>

<?php 
if (POST('withoutmenu') != "1") {
    include "../hmenu.php";
}
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);
    if (!empty($action_id)) {
        Util::make_form("POST", "actionform.php");
    } else {
        Util::make_form("POST", "action.php");
    }
    die;
}
if ($action == 'new' || $action == 'edit') {
    $cond = html_entity_decode($cond);
    $db = new ossim_db();
    $conn = $db->connect();
    if ($action_type == "exec" && !Session::am_i_admin()) {
        $txt_end = '<b>' . _("Only global admins can add or modify 'exec' actions") . '</b>';
    } else {
        if ($action == 'new') {
            // new action
            if ($action_type == 'email') {
                $last_id = Action::insertEmail($conn, $action_type, $cond, $on_risk, $descr, $email_from, $email_to, $email_subject, $email_message);
            } else {
Пример #20
0
</head>

<body>

<?php 
if (POST('withoutmenu') != "1") {
    include "../hmenu.php";
    $get_param = "withoutmenu=0";
} else {
    $get_param = "name={$ngname}&withoutmenu=1";
}
if (POST('insert')) {
    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::insert($conn, $ngname, $threshold_c, $threshold_a, $rrd_profile, $networks, $descr);
    /*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 
Пример #21
0
 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>
<body>

<?php 
if ($error == true) {
    $txt_error = "<div>" . _("The following errors occurred") . ":</div><div style='padding:10px;'>" . implode("<br/>", $message_error) . "</div>";
    Util::print_error($txt_error);
    $url = !empty($action_id) ? "actionform.php" : "action.php";
    Util::make_form("POST", $url);
    $db->close();
    exit;
}
if ($action == 'new' || $action == 'edit') {
    $cond = html_entity_decode($cond);
    $txt_end = _("Action successfully updated");
    if ($action_type == "exec" && !Session::am_i_admin()) {
        $txt_end = '<b>' . _("Only global admins can add or modify 'exec' actions") . '</b>';
    } else {
        if ($action == 'new') {
            if ($action_type == '1') {
                Action::insertEmail($conn, $ctx, $name, $action_type, $cond, $on_risk, $descr, $email_from, $email_to, $email_subject, $email_message);
            } else {
                if ($action_type == '2') {
                    Action::insertExec($conn, $ctx, $name, $action_type, $cond, $on_risk, $descr, $exec_command);
Пример #22
0
	<meta http-equiv="Pragma" content="no-cache">
	<link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</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();
        Util::make_form("POST", "newportgroupform.php?id={$id}");
        die;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    $actives_ports = Port_group::expand_ports($actives_ports);
    Port_group::update($conn, $id, $pgname, $actives_ports, $descr, $ctx);
    Util::memcacheFlush();
    $db->close();
    ?>
	<script type='text/javascript'>
        if (!parent.is_lightbox_loaded(window.name))
        {
            document.location.href="portgroup.php?msg=updated";
        }
        else
Пример #23
0
 </title>
					<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
					<meta http-equiv="Pragma" content="no-cache">
					<link type="text/css" rel="stylesheet" href="../style/av_common.css?t=<?php 
            echo Util::get_css_id();
            ?>
"/>
				</head>

				<body>
					<?php 
            $txt_error = "<div>" . _("The following errors occurred") . ":</div>\n\t\t\t\t\t\t  <div style='padding: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();
            Util::make_form("POST", "incidenttype.php");
            ?>
				</body>
			</html>
			<?php 
        } else {
            $db = new ossim_db();
            $conn = $db->connect();
            if ($_GET['action'] == 'modify') {
                $inctype_id = POST('id');
                $inctype_descr = POST('descr');
                $custom = intval(POST('custom'));
                $location = "incidenttype.php?msg=3";
                Incident_type::update($conn, $inctype_id, $inctype_descr, $custom == 1 ? "custom" : "");
            } elseif ($_GET['action'] == 'delete') {
                $inctype_id = POST('id');
Пример #24
0
	<link type="text/css" rel="stylesheet" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>

<body>

<?php 
if (POST('insert') && empty($data['data']['id'])) {
    if ($data['status'] == 'error') {
        $txt_error = "<div>" . _("We Found the following errors") . ":</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();
        Util::make_form("POST", "newserverform.php?id={$id}");
        exit;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    if (!isset($resend_alarms)) {
        $resend_alarms = 0;
    }
    if (!isset($resend_events)) {
        $resend_events = 0;
    }
    Server::update($conn, $id, $sname, $ip, $port, $descr, $correlate, $cross_correlate, $store, $rep, $qualify, $resend_alarms, $resend_events, $sign, $sem, $sim, $alarm_to_syslog, $remoteadmin, $remotepass, $remoteurl, $setssh, $fwrd_server);
    Util::resend_asset_dump('servers');
    Util::memcacheFlush();
    $db->close();
    ?>
Пример #25
0
    <meta http-equiv="Pragma" content="no-cache">
    <link type="text/css" rel="stylesheet" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>

<body>

<?php 
if ($data['status'] == 'error') {
    $txt_error = '<div>' . _('The following errors occurred') . ":</div>\n                  <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();
    Util::make_form("POST", "pluginref.php");
    exit;
}
$db = new ossim_db();
$conn = $db->connect();
try {
    $error = Plugin_reference::new_rule($conn, $plugin_id1, $plugin_id2, $plugin_sid1, $plugin_sid2);
} catch (Exception $e) {
    $_SESSION['av_latest_error'] = _($e->getMessage());
    $error = 1;
}
$msg = $error ? 'error' : 'created';
$db->close();
?>

<script type='text/javascript'>document.location.href="pluginref.php?msg=<?php 
Пример #26
0
	<meta http-equiv="Pragma" content="no-cache">
	<link type="text/css" rel="stylesheet" href="../style/av_common.css?t=<?php 
echo Util::get_css_id();
?>
"/>
</head>

<body>

<?php 
if ($data['status'] == 'error') {
    $txt_error = '<div>' . _('The following errors occurred') . ":</div>\n\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();
    Util::make_form('POST', 'plugin.php');
    exit;
}
if ($category == '' || $subcategory == '') {
    $category = '';
    $subcategory = '';
}
$name = str_replace("<", "&lt;", str_replace(">", "&gt;", $name));
$db = new ossim_db();
$conn = $db->connect();
Plugin_sid::update($conn, $plugin_id, $sid, $priority, $reliability, $category, $subcategory, $name);
Util::resend_asset_dump();
$db->close();
?>
<script type='text/javascript'>
	document.location.href="pluginsid.php?plugin_id=<?php 
Пример #27
0
        }
    } catch (Exception $e) {
        if (Session::is_pro() && $new_context_uuid != '' && preg_match("/password/", $e->getMessage())) {
            Acl::delete_entities($conn, $new_context_uuid);
            // Refresh current permissions
            $_SESSION['_user_vision'] = Acl::get_user_vision($conn);
        }
        $config_nt = array('content' => $e->getMessage(), 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto; text-align:center;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        $db->close();
        // Detected sensor not inserted yet, back to rpass mode
        if (!empty($_POST['rpass'])) {
            Util::make_form("POST", "newsensorform.php?ip={$ip}");
        } else {
            Util::make_form("POST", "newsensorform.php?id={$sensor_id}&ip={$ip}&sname={$sname}");
        }
        exit;
    }
    $db->close();
    unset($_SESSION['_sensor_list']);
    ?>

        <script type='text/javascript'>
            if (!top.is_lightbox_loaded(window.name))
            {
                top.frames['main'].location.href="sensor.php?msg=updated";
            }
            else
            {
                top.frames['main'].location.href="newsensorform.php?id=<?php 
Пример #28
0
        $conn = $db->connect();
        if (!isset($resend_alarms)) {
            $resend_alarms = 0;
        }
        if (!isset($resend_events)) {
            $resend_events = 0;
        }
        Server::update($conn, $id, $sname, $ip, $port, $descr, $correlate, $cross_correlate, $store, $rep, $qualify, $resend_alarms, $resend_events, $sign, $sem, $sim, $alarm_to_syslog, $remoteadmin, $remotepass, $remoteurl, $setssh, $fwrd_server);
        Util::resend_asset_dump('servers');
        Util::memcacheFlush();
    } catch (Exception $e) {
        $db->close();
        $config_nt = array('content' => $e->getMessage(), '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();
        Util::make_form("POST", "modifyserverform.php?id={$id}");
        exit;
    }
    $db->close();
    ?>

        <script type='text/javascript'>
            if (!parent.is_lightbox_loaded(window.name))
            {
                document.location.href="server.php?msg=updated";
            }
            else
            {
                document.location.href="modifyserverform.php?id=<?php 
    echo $id;
    ?>
Пример #29
0
    <link rel="stylesheet" type="text/css" href="../style/style.css"/>
</head>
<body>

<?php 
if (GET('withoutmenu') != "1") {
    include "../hmenu.php";
}
echo "<h1>" . gettext($txt_start) . "</h1>";
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);
    if (!empty($ip)) {
        Util::make_form("POST", "hostcredentialsform.php?ip=" . $ip);
    } else {
        Util::make_form("POST", "host.php");
    }
    die;
}
if ($action == 'edit' || $action == 'delete') {
    $db = new ossim_db();
    $conn = $db->connect();
    if ($action == 'edit') {
        Host::modify_credentials($conn, $ip, $type, $user_ct, $pass_ct, $extra);
    } else {
        if ($action == 'delete' && !empty($id)) {
            Host::delete_credential($conn, $id);
        }
    }
    $db->close($conn);
    if (isset($_SESSION['_credentials'])) {