Ejemplo n.º 1
0
if (preg_match("/(.*=)(.*\\|)(.*)/", $str, $fnd)) {
    $prev = $fnd[2];
    $str = $fnd[1] . $fnd[3];
}
$data = array();
$top = 10;
$tag_typing = 0;
if (trim($str) != "") {
    list($sensors, $hosts) = Host::get_ips_and_hostname($conn);
    $nets = Net::get_list($conn);
    $plugins = GetPlugins($conn);
    $sourcetypes = GetSourceTypes($conn);
    $plugingroups = Plugingroup::get_list($conn);
    $ports = Port::get_list($conn);
    $categories = GetPluginCategories($conn);
    $subcategories = GetPluginSubCategories($conn, $categories);
    // Typing a tag
    if (preg_match("/^(sensor|src|dst|plugin|datasource|plugingroup|dsgroup|src_port|dst_port|product_type|event_category|category|data)(\\!?\\=)(.*)/i", $str, $found)) {
        $tag_typing = 1;
        $str = $found[3];
        $op = $found[2];
        if ($str == "") {
            $str = ".";
        }
        $qstr = $str;
        if ($found[1] == "sensor") {
            foreach ($sensors as $ip => $name) {
                if ((preg_match("/^{$qstr}/i", $name) || preg_match("/^{$qstr}/i", $ip)) && !preg_match("/{$name}/i", $fnd[2]) && count($data) < $top && $current_query["sensor{$op}{$ip}"] == "") {
                    $data[] = array("name" => "<b>sensor</b>{$op}{$prev}{$name}");
                }
            }
Ejemplo n.º 2
0
    foreach ($categories as $idcat => $category) {
        echo "<option value=\"{$idcat}\"" . ($_SESSION["category"][0] != 0 && $_SESSION["category"][0] == $idcat ? " selected" : "") . ">{$category}</option>\n";
    }
    ?>
																	</select>
																</div>
															</div>
														
															<div style='text-align: left; padding-bottom: 15px; clear: both;'>
																<div style='float: left; width:90px;'><?php 
    echo _("Sub-Category");
    ?>
:</div>
																<div style='float: left;'>
																	<?php 
    $subcategories = GetPluginSubCategories($db, $categories);
    ?>
																	<select name="category[1]" id="subcategory" class="selectp" style="width:155px" onchange="$('input[name=plugin]').val('');this.form.bsf.click()"><option value=''></option> 
																	<?php 
    if (is_array($subcategories[$_SESSION["category"][0]])) {
        foreach ($subcategories[$_SESSION["category"][0]] as $idscat => $subcategory) {
            echo "<option value=\"{$idscat}\"" . ($_SESSION["category"][1] != 0 && $_SESSION["category"][1] == $idscat ? " selected" : "") . ">{$subcategory}</option>\n";
        }
    }
    ?>
																	</select>
																</div>
															</div>
														</td>
													</tr>
												</table>