Пример #1
0
function GetOssimHostsFromHostGroups($hostgroup)
{
    $db = new ossim_db();
    $conn = $db->connect();
    $pg = array();
    try {
        $asset_group = new Asset_group($hostgroup);
        $asset_group->load_from_db($conn);
        $_hosts = $asset_group->get_hosts($conn, array(), TRUE);
        $hosts = $_hosts[0];
    } catch (Exception $e) {
        echo $e->getMessage();
        return $pg;
    }
    foreach ($hosts as $hg) {
        $pg[] = $hg[2];
        //  Array ( [0] => ID [1] => CTX [2] => IP [3] => Name )
    }
    $db->close();
    return $pg;
}
Пример #2
0
        <meta http-equiv="Pragma" content="no-cache">
        <?php 
//CSS Files
$_files = array(array('src' => 'av_common.css', 'def_path' => TRUE));
Util::print_include_files($_files, 'css');
?>
    </head>

    <body>
    <?php 
if ($data['status'] != 'error') {
    try {
        $db = new ossim_db();
        $conn = $db->connect();
        $asset_group = new Asset_group($id);
        $asset_group->load_from_db($conn);
        $asset_group->set_name($name);
        $asset_group->set_owner($owner);
        $asset_group->set_descr($descr);
        $asset_group->save_in_db($conn);
        $data['status'] = 'OK';
        $data['data'] = _('Your changes have been saved');
        $db->close();
    } catch (Exception $e) {
        $data['status'] = 'error';
        $data['data'] = array('php_exception' => $e->getMessage());
    }
}
if ($data['status'] == 'error') {
    $txt_error = '<div>' . _('The following errors occurred') . ":</div>\n                      <div style='padding: 10px;'>" . implode('<br/>', $data['data']) . '</div>';
    $config_nt = array('content' => $txt_error, 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto; text-align: left;');
Пример #3
0
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
require_once 'av_init.php';
$group_id = GET('id');
ossim_valid($group_id, OSS_HEX, OSS_NULLABLE, 'illegal:' . _("Group ID"));
if (ossim_error()) {
    die(ossim_error());
}
$db = new ossim_db(TRUE);
$conn = $db->connect();
try {
    $group = new Asset_group($group_id);
    $group->load_from_db($conn);
} catch (Exception $e) {
    echo _('Impossible to load the group info');
    die;
}
?>
<div id='tray_container'>

    <div class="tray_triangle"></div>

    <div id='tray_host_owner' class='tray_section'>
        <div class='tray_title'>
            <?php 
echo _('Owner');
?>
        </div>