コード例 #1
0
ファイル: actionform.php プロジェクト: jackpf/ossim-arc
?>
"/>
			</td>
		</tr>
		<?php 
if ($pro) {
    ?>
			<tr>
				<th><label for='ctx'><?php 
    echo _('Context') . required();
    ?>
</label></th>
				<td class="left nobborder">
					<select name="ctx" id="ctx" class='vfield' onfocus='set_focus(this);'>
						<?php 
    $contexts = get_policy_entities($conn);
    if (count($contexts) == 0) {
        echo "<option value='' style='text-align:center !important;'>- " . _("No contexts found") . " -</option>";
    } else {
        echo "<option value='' style='text-align:center !important;'>- " . _("Select one context") . " -</option>\n";
    }
    foreach ($contexts as $k => $v) {
        echo "<option value='{$k}'" . ($ctx == $k ? " selected" : "") . ">{$v}</option>";
    }
    ?>
					</select>
				</td>
			</tr>
			<?php 
}
?>
コード例 #2
0
ファイル: policy.php プロジェクト: AntBean/alienvault-ossim
        }
    }
    asort($entities);
    $ctx_pro = array_shift(array_keys($entities));
    return array($entities, $ctx_pro);
}
$db = new ossim_db();
$conn = $db->connect();
$pro = Session::is_pro();
$avmssp = true;
//intval($conf->get_conf("alienvault_mssp", FALSE));
$contexts = array();
$engines = array();
$ctx_prev = '';
if ($pro) {
    list($entities, $ctx_prev) = get_policy_entities($conn, $ctx_pro);
} else {
    $ctx_prev = Session::get_default_ctx();
    $entities[$ctx_prev] = Session::get_entity_name($conn, $ctx_prev);
}
$ctx = GET("ctx") != "" ? GET("ctx") : $_SESSION['policy_ctx'];
$reorder = GET("reorder");
if (empty($ctx)) {
    $ctx = $ctx_prev;
}
ossim_valid($ctx, OSS_HEX, 'illegal:' . _("ctx"));
ossim_valid($reorder, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("Policy Option"));
if (ossim_error()) {
    die(ossim_error());
}
$_SESSION['policy_ctx'] = $ctx;