Ejemplo n.º 1
0
$section = GET('section');
ossim_valid($id, OSS_HEX, 'illegal:' . _('Asset ID'));
ossim_valid($section, OSS_ALPHA, OSS_NULLABLE, 'illegal:' . _('Asset Section'));
if (ossim_error()) {
    die(ossim_error());
}
// Database Object
$db = new ossim_db();
$conn = $db->connect();
if (Asset_host::is_in_db($conn, $id)) {
    $asset_type = 'asset';
    Session::logcheck('environment-menu', 'PolicyHosts');
    $breadcrumb = array('section' => _('Assets'), 'current' => _('Asset Details'));
    $edit = Asset_host::can_i_modify_ips($conn, $id);
    $delete = Asset_host::can_delete($conn, $id);
    $local_assets = Asset_host::get_asset_by_system($conn, Util::get_system_uuid());
    $p_plugin = Session::am_i_admin() && !$local_assets[$id];
    $deploy_agent = Session::logcheck_bool('environment-menu', 'EventsHidsConfig');
} else {
    if (Asset_net::is_in_db($conn, $id)) {
        $asset_type = 'network';
        Session::logcheck('environment-menu', 'PolicyNetworks');
        $breadcrumb = array('section' => _('Networks'), 'current' => _('Network Details'));
        $edit = Asset_net::can_i_modify_ips($conn, $id);
        $delete = Asset_net::can_delete($conn, $id);
        $p_plugin = Session::am_i_admin();
        $deploy_agent = FALSE;
    } else {
        if (Asset_group::is_in_db($conn, $id)) {
            $asset_type = 'group';
            Session::logcheck('environment-menu', 'PolicyHosts');