示例#1
0
                document.location.href = '../conf/reload.php?what=policies&back=<?php 
echo urlencode($back);
?>
';
            }
            
        </script>
    	
    </head>

    <body style="margin:0">
    
        <br><table id="flextable" style="display:none"></table>

        <?php 
if (Web_indicator::is_on("Reload_policies")) {
    echo "<button class='button' onclick='apply_changes()'>" . _("Apply Changes") . "</button>";
}
?>
        
         <!-- Right Click Menu -->
        <ul id="myMenu" class="contextMenu" style="width:110px">
            <li class="hostreport"><a href="#new" class="greybox" style="padding:3px"><img src="../pixmaps/tables/table_row_insert.png" align="absmiddle"/> <?php 
echo _("New Action");
?>
</a></li>
            <li class="hostreport"><a href="#modify" class="greybox" style="padding:3px"><img src="../pixmaps/tables/table_edit.png" align="absmiddle"/> <?php 
echo _("Modify");
?>
</a></li>
            <li class="hostreport"><a href="#delete" class="greybox" style="padding:3px"><img src="../pixmaps/tables/table_row_delete.png" align="absmiddle"/> <?php 
示例#2
0
    $log_dst = $order_dst . " (" . $policy_dst->get_id() . ")";
}
if ($group_src == $group_dst) {
    // same group => swap
    Policy::swap_simple_orders($conn, $policy_src, $policy_dst);
} else {
    // different group => especial swap
    if ($order_src < $order_dst) {
        // Only change group (do not change order value)
        if ($order_src == $order_dst - 1) {
            Policy::change_group($conn, $policy_src->get_id(), $group_dst);
        } else {
            for ($i = $order_src; $i < $order_dst - 1; $i++) {
                Policy::swap_orders($conn, $i, $i + 1, $group_dst, $ctx, "src");
            }
        }
    } else {
        if ($order_src == $order_dst) {
            Policy::change_group($conn, $policy_src->get_id(), $group_dst);
        }
        for ($i = $order_src; $i > $order_dst; $i--) {
            Policy::swap_orders($conn, $i - 1, $i, $group_dst, $ctx, "dst");
        }
    }
}
$infolog = array($order_src . " (" . $policy_src->get_id() . ")", $log_dst);
Log_action::log(98, $infolog);
Web_indicator::set_on("Reload_policies");
// ReloadPolicy key deprecated, now using Reload_policies always
//Web_indicator::set_on("ReloadPolicy");
$db->close();
示例#3
0
if (Session::am_i_admin() && 1 == 2) {
    // Temporary hidden
    ?>
						<div class="fbutton" onclick="GB_show('User Contributed Directives', '/ossim/directives/editxml.php?engine_id=<?php 
    echo $engine_id;
    ?>
', 600, '90%');"><div><span class="xml" style="padding-left:20px;font-size:12px"><b><?php 
    echo _("Edit XML");
    ?>
</b></span></div></div>
						<div class="btnseparator"></div>
						<?php 
}
?>
						<div class="fbutton" onclick="restart_directives();"><div><span class="apply <?php 
echo Web_indicator::is_on("Reload_directives") ? "reload_red" : "";
?>
" style="padding-left:20px;font-size:12px"><b><?php 
echo _("Restart Server");
?>
</b></span></div></div>
						<div class="btnseparator"></div>
    						
    						<form method="post">
    						<input type="hidden" name="engine_id" id="engine_id" value="<?php 
echo $engine_id;
?>
" />
    						
    						<div class='fbutton'><span class='search_label'><?php 
echo "<b>" . _("Search") . "</b> " . _("a directive name");
示例#4
0
?>
", "no": "<?php 
echo _('No');
?>
"}
                av_confirm(msg, opts).done(function()
            		{
				    document.location.href = '/ossim/conf/reload.php?what=plugins&back=<?php 
echo $back_url;
?>
';
            		});
            });

            <?php 
if (Web_indicator::is_on("Reload_plugins")) {
    ?>
            $('#button_apply').show();
            <?php 
}
?>

            $(document).on('dblclick', '.table_data tr', function(e)
            {
                $(this).disableTextSelect();
                
                edit_sid(this);
            });
            
            
            $('.table_data').dataTable(
示例#5
0
        				{separator: true},
        				{name: '<?php 
    echo _("Delete selected");
    ?>
', bclass: 'delete', onpress : action},
        				{separator: true},
        				{name: '<?php 
    echo _("Duplicate selected");
    ?>
', bclass: 'duplicate', onpress : action},
        				{separator: true},
        				{name: '<?php 
    echo _("Reload Policies");
    ?>
', bclass: '<?php 
    echo Web_indicator::is_on("Reload_policies") ? "reload_red" : "reload";
    ?>
', onpress : action},
        				{separator: true},
        				{name: '<?php 
    echo _("<b>Enable/Disable</b> policy");
    ?>
', bclass: 'yesno', onpress : action}
        				],
        			sortname: "<?php 
    echo $sortname;
    ?>
",
        			sortorder: "<?php 
    echo $sortorder;
    ?>
示例#6
0
            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');
                ?>
			<script type="text/javascript">document.location.href = "index.php?s_type=<?php 
                echo $s_type;
                ?>
&msg=saved"</script>
			<?php 
                exit;
            }
        }
    }
}
//Get Data
$id = intval(GET('id'));
$s_type = GET('s_type');
ossim_valid($id, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _('Task ID'));
示例#7
0
    }
    @socket_close($socket);
}
// Switch off web indicator
if ($what == 'all') {
    Web_indicator::set_off('Reload_policies');
    Web_indicator::set_off('Reload_sensors');
    Web_indicator::set_off('Reload_plugins');
    Web_indicator::set_off('Reload_directives');
    Web_indicator::set_off('Reload_servers');
} else {
    Web_indicator::set_off('Reload_' . $what);
}
// Reset main indicator if no more policy reload need
if (!Web_indicator::is_on('Reload_policies') && !Web_indicator::is_on('Reload_sensors') && !Web_indicator::is_on('Reload_plugins') && !Web_indicator::is_on('Reload_directives') && !Web_indicator::is_on('Reload_servers')) {
    Web_indicator::set_off('ReloadPolicy');
}
if ($what == 'tasks') {
    try {
        $frcon = new Frameworkd_socket();
        $frcon->write("control action=\"refresh_inventory_task\"\n");
    } catch (Exception $e) {
        $error = _('An error occurred while updating Agent cache...');
        echo ossim_error($error);
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
示例#8
0
		
		});
	
	</script>
	
</head>
<body style="margin:0">

    <?php 
//Local menu
include_once '../local_menu.php';
?>
		
	<table id="flextable" style="display:none"></table>
    <?php 
if (Web_indicator::is_on("Reload_servers")) {
    echo "<button class='button' onclick='apply_changes()'>" . _("Apply Changes") . "</button>";
}
?>
    
    	
	<?php 
if (Session::is_pro()) {
    ?>
	    
		<div id='toggle_hierarchy' class='av_link'>
			<img src="../pixmaps/arrow_green.gif"/>
			<?php 
    echo _("Server Hierarchy");
    ?>
		</div>
ossim_valid($ctx, OSS_HEX, 'illegal:' . _("order"));
if (ossim_error()) {
    die(ossim_error());
}
//db connection
$db = new ossim_db();
$conn = $db->connect();
$group1 = Policy_group::get_list($conn, $ctx, " AND id=UNHEX('{$group}')");
if ($group1[0]) {
    $ctx = $group1[0]->get_ctx();
    if ($order == "up") {
        $pg_ord = Policy::get_pg_order($conn, $ctx, $group1[0]->get_order(), 'up');
        $group2 = Policy_group::get_list($conn, $ctx, " AND policy_group.order={$pg_ord}");
        $pg_src = $group2[0];
        $pg_dst = $group1[0];
    } elseif ($order == "down") {
        $pg_ord = Policy::get_pg_order($conn, $ctx, $group1[0]->get_order(), 'down');
        $group2 = Policy_group::get_list($conn, $ctx, " AND policy_group.order={$pg_ord}");
        $pg_src = $group1[0];
        $pg_dst = $group2[0];
    }
    if (is_object($pg_src) && is_object($pg_dst)) {
        echo "Swapping: id1=" . $pg_dst->get_group_id() . ",order1=" . $pg_src->get_order() . ",id2=" . $pg_dst->get_group_id() . ",order2=" . $pg_dst->get_order() . "<br>\n";
        Policy_group::swap_orders($conn, $pg_src->get_ctx(), $pg_src->get_group_id(), $pg_src->get_order(), $pg_dst->get_group_id(), $pg_dst->get_order());
        $infolog = array($pg_dst->get_name() . "(" . $pg_dst->get_group_id() . ")", $pg_dst->get_name() . "(" . $pg_dst->get_group_id() . ")");
        Log_action::log(99, $infolog);
        Web_indicator::set_on("Reload_policies");
        Web_indicator::set_on("ReloadPolicy");
    }
}
$db->close();
示例#10
0
function delete_engine($conn, $data)
{
    $id = $data['engine'];
    ossim_valid($id, OSS_HEX, 'illegal:' . _('Engine ID'));
    if (ossim_error()) {
        $info_error = _('Error') . ': ' . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    if ($id == Session::get_default_engine($conn)) {
        $return['error'] = TRUE;
        $return['msg'] = _('It is not allowed to delete the default engine');
        return $return;
    }
    $contexts = Acl::get_contexts_by_engine($conn, $id);
    if (count($contexts) > 0) {
        $return['error'] = TRUE;
        $return['msg'] = _('There are contexts asociated to this engine. You are not allowed to delete this engine');
        return $return;
    }
    Acl::delete_entities($conn, $id);
    Alarm::delete_from_taxonomy($conn, $id);
    $id = Util::uuid_format($id);
    if (is_dir(_MAIN_PATH . "/{$id}")) {
        Directive_editor::remove_engine($id);
    }
    Web_indicator::set_on('Reload_servers');
    $return['error'] = FALSE;
    $return['data'] = '';
    return $return;
}
示例#11
0
    $out = @socket_read($socket, 2048);
    if (strncmp($out, 'ok id="2"', 9) != 0) {
        $error = sprintf(_("Bad response from %s server. Please, wait until it's available again or check if it's running at %s"), Session::is_pro() ? "USM" : "OSSIM", "{$address}:{$port}");
        echo ossim_error($error);
        exit;
    }
    @socket_shutdown($socket);
    @socket_close($socket);
}
// Switch off web indicator
if ($what == 'all') {
    Web_indicator::set_off('Reload_policies');
    Web_indicator::set_off('Reload_sensors');
    Web_indicator::set_off('Reload_servers');
} else {
    Web_indicator::set_off('Reload_' . $what);
}
// ReloadPolicy key deprecated, now using Reload_policies always
// Reset main indicator if no more policy reload need
/*
if (!Web_indicator::is_on('Reload_policies') && !Web_indicator::is_on('Reload_sensors') && !Web_indicator::is_on('Reload_plugins') 
    && !Web_indicator::is_on('Reload_directives') && !Web_indicator::is_on('Reload_servers')) {
    Web_indicator::set_off('ReloadPolicy');
}
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php