예제 #1
0
ossim_valid($id, OSS_HEX, 'illegal:' . _('Asset group ID'));
if (ossim_error()) {
    echo ossim_error(_('Error! Asset group not found'));
    exit;
}
$asset_group = new Asset_group($id);
$asset_group->can_i_edit($conn);
$asset_group->load_from_db($conn);
//Getting group data
$id = $asset_group->get_id();
$name = $asset_group->get_name();
$owner = $asset_group->get_owner();
$descr = $asset_group->get_descr();
$threshold_a = $asset_group->get_threshold('a');
$threshold_c = $asset_group->get_threshold('c');
$nagios = Asset_group_scan::is_plugin_in_group($conn, $id, 2007);
//Closing database connection
$db->close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title><?php 
echo _('OSSIM Framework');
?>
</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();
?>
예제 #2
0
        $asset_group->save_in_db($conn);
        $_hosts_data_aux = $asset_group->get_hosts($conn, '', TRUE);
        $hosts = array_keys($_hosts_data_aux[0]);
        if (!empty($nagios)) {
            if (Asset_group_scan::is_plugin_in_group($conn, $id, 2007)) {
                Asset_group_scan::delete_plugin_from_db($conn, $id, 2007);
            }
            Asset_group_scan::save_plugin_in_db($conn, $id, 2007);
            foreach ($hosts as $host_id) {
                if (!Asset_host_scan::is_plugin_in_host($conn, $host_id, 2007)) {
                    Asset_host_scan::save_plugin_in_db($conn, $host_id, 2007);
                }
            }
        } else {
            if (Asset_group_scan::is_plugin_in_group($conn, $id, 2007)) {
                Asset_group_scan::delete_plugin_from_db($conn, $id, 2007);
            }
            foreach ($hosts as $host_id) {
                if (Asset_host_scan::is_plugin_in_host($conn, $host_id, 2007)) {
                    Asset_host_scan::delete_plugin_from_db($conn, $host_id, 2007);
                }
            }
        }
        $data['status'] = 'OK';
        $data['data'] = _('Asset group saved successfully');
        $db->close();
    } catch (Exception $e) {
        $data['status'] = 'error';
        $data['data'] = array('php_exception' => $e->getMessage());
    }
}