Example #1
0
ossim_valid($order, OSS_ALPHA, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("Order"));
ossim_valid($page, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("page"));
ossim_valid($rp, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("rp"));
ossim_valid($search, OSS_TEXT, OSS_NULLABLE, 'illegal:' . _("search"));
ossim_valid($field, OSS_ALPHA, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("field"));
if (ossim_error()) {
    die(ossim_error());
}
$db = new ossim_db();
$conn = $db->connect();
if (!empty($nessus_action) and !empty($net_group_name)) {
    if ($nessus_action == "toggle") {
        $nessus_action = ($scan_list = Net_group_scan::get_list($conn, "WHERE net_group_name = '{$net_group_name}' AND plugin_id = 3001")) ? "disable" : "enable";
    }
    if ($nessus_action == "enable") {
        Net_group::enable_nessus($conn, $net_group_name);
    } elseif ($nessus_action = "disable") {
        Net_group::disable_nessus($conn, $net_group_name);
    }
}
if (empty($order)) {
    $order = "name";
}
$start = ($page - 1) * $rp;
$limit = "LIMIT {$start}, {$rp}";
$where = "";
if (!empty($search) && !empty($field)) {
    $where = "name LIKE '%{$search}%'";
}
$xml = "";
$net_group_list = Net_group::get_list($conn, $where, "ORDER BY {$order} {$limit}");