ossim_valid($order, OSS_ALPHA, 'illegal: iSortCol_0');
ossim_valid($torder, OSS_DIGIT, 'illegal: sSortDir_0');
ossim_valid($sec, OSS_DIGIT, 'illegal: sEcho');
if (ossim_error()) {
    $response['sEcho'] = 1;
    $response['iTotalRecords'] = 0;
    $response['iTotalDisplayRecords'] = 0;
    $response['aaData'] = '';
    echo json_encode($response);
    exit;
}
/*
If $all_list = TRUE, then the asset list will be load from host because there are no filters to be applied
If $all_list = FALSE, then the asset list will be load from user_host_filter because there are already some filters applied
*/
$filters = Asset_filter_list::retrieve_filter_list_session();
if ($filters === FALSE) {
    $all_list = TRUE;
} else {
    $cont = $filters->get_num_filter_added();
    $all_list = $cont > 0 ? FALSE : TRUE;
}
// Order by column
switch ($order) {
    case 0:
        $order = 'host.hostname';
        break;
    default:
        $order = 'host.hostname';
}
$maxrows = $maxrows > 50 ? 50 : $maxrows;
Пример #2
0
*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck('environment-menu', 'PolicyHosts');
Asset_filter_list::create_filter_copy();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title> <?php 
echo _('AlienVault USM');
?>
 </title>
        <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
        <meta http-equiv="Pragma" content="no-cache"/>
    
        <?php 
//CSS Files
$_files = array(array('src' => 'av_common.css', 'def_path' => TRUE), array('src' => 'jquery-ui.css', 'def_path' => TRUE), array('src' => 'tipTip.css', 'def_path' => TRUE), array('src' => 'jquery.switch.css', 'def_path' => TRUE), array('src' => 'simplePagination.css', 'def_path' => TRUE), array('src' => '/assets/asset_search.css', 'def_path' => TRUE), array('src' => '/assets/asset_filters.css', 'def_path' => TRUE));
Util::print_include_files($_files, 'css');
function cancel_filter_list()
{
    Asset_filter_list::restore_filter_copy();
    $return['error'] = FALSE;
    $return['msg'] = '';
    return $return;
}
Пример #4
0
Session::logcheck('environment-menu', 'PolicyHosts');
//Getting parameters
$back = intval(GET('back'));
//This params are validated in the class.
$filter_id = GET("filter_id");
$filter_val = GET("filter_value");
$cond_filter = $filter_id != '' && $filter_val != '';
$db = new ossim_db();
$conn = $db->connect();
$config_nt = array('content' => '', 'options' => array('type' => 'nf_error', 'cancel_button' => true), 'style' => 'position:absolute;top:15px;left:50%;margin-left:-150px;text-align:center;padding:1px 30px;z-index:999');
//Getting the object with the filters. Unserialize needed.
$filter_list = Asset_filter_list::retrieve_filter_list_session();
//If we don't have any object, we create a new one.
if ($filter_list === FALSE || !$back || $cond_filter) {
    try {
        $filter_list = new Asset_filter_list($conn);
        if ($cond_filter) {
            $filter_list->modify_filter($filter_id, $filter_val, 0);
        }
        $filter_list->store_filter_list_session();
    } catch (Exception $e) {
        $config_nt['content'] = $e->getMessage();
        $nt = new Notification('nt_notif', $config_nt);
        $nt->show();
    }
}
$cont = $filter_list->get_num_filter_added();
if ($cont > 0) {
    try {
        $filter_list->force_reload();
        $filter_list->apply_filter_search($conn);
Пример #5
0
function get_selected_values($id)
{
    //Getting the object with the filters.
    $filters = Asset_filter_list::retrieve_filter_list_session();
    //If the filters object is not an object, returns empty
    if ($filters === FALSE) {
        return array();
    }
    $filter = $filters->get_filter($id);
    //If the concrete filter is not an object, returns empty.
    if (!is_object($filter)) {
        return array();
    }
    //Returns the selected values
    return $filter->get_values();
}