Exemplo n.º 1
0
    $_REQUEST['filter_delay'] = empty2null(get_request('filter_delay', get_profile('web.items.filter.delay')));
    $_REQUEST['filter_history'] = empty2null(get_request('filter_history', get_profile('web.items.filter.history')));
    $_REQUEST['filter_trends'] = empty2null(get_request('filter_trends', get_profile('web.items.filter.trends')));
    $_REQUEST['filter_status'] = empty2null(get_request('filter_status', get_profile('web.items.filter.status')));
    $_REQUEST['filter_logtimefmt'] = empty2null(get_request('filter_logtimefmt', get_profile('web.items.filter.logtimefmt')));
    $_REQUEST['filter_delta'] = empty2null(get_request('filter_delta', get_profile('web.items.filter.delta')));
    $_REQUEST['filter_trapper_hosts'] = empty2null(get_request('filter_trapper_hosts', get_profile('web.items.filter.trapper_hosts')));
}
if (isset($_REQUEST['filter_rst'])) {
    $_REQUEST['filter_host'] = null;
    $_REQUEST['filter_description'] = null;
    $_REQUEST['filter_key'] = null;
} else {
    $_REQUEST['filter_host'] = empty2null(get_request('filter_host', get_profile('web.items.filter.host')));
    $_REQUEST['filter_description'] = empty2null(get_request('filter_description', get_profile('web.items.filter.description')));
    $_REQUEST['filter_key'] = empty2null(get_request('filter_key', get_profile('web.items.filter.key')));
}
if (isset($_REQUEST['filter_set']) || isset($_REQUEST['filter_rst']) || $prev_selection_mode != $_REQUEST['selection_mode']) {
    update_profile('web.items.filter.selection_mode', $_REQUEST['selection_mode'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.node', $_REQUEST['filter_node'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.group', $_REQUEST['filter_group'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.host', $_REQUEST['filter_host'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.application', $_REQUEST['filter_application'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.description', $_REQUEST['filter_description'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.type', $_REQUEST['filter_type'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.key', $_REQUEST['filter_key'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.snmp_community', $_REQUEST['filter_snmp_community'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.snmp_oid', $_REQUEST['filter_snmp_oid'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.snmp_port', $_REQUEST['filter_snmp_port'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.snmpv3_securityname', $_REQUEST['filter_snmpv3_securityname'], PROFILE_TYPE_STR);
    update_profile('web.items.filter.snmpv3_securitylevel', $_REQUEST['filter_snmpv3_securitylevel'], PROFILE_TYPE_STR);
Exemplo n.º 2
0
            $db_errors .= mysql_errno() . ": " . mysql_error() . "\n";
        }
    }
    if ($params['xcoordh_nw'] !== '' && $params['ycoordh_nw'] !== '' && $params['xcoordh_nw'] != 25 && $params['ycoordh_sw'] != 25) {
        $latitude = deg2dbl($params['lat_deg_ne'], $params['lat_min_ne'], $params['lat_sec_ne'], $params['lat_ns_ne']);
        $longitude = deg2dbl($params['lng_deg_sw'], $params['lng_min_sw'], $params['lng_sec_sw'], $params['lng_we_sw']);
        $query = sprintf($query_fmt, $new_kap_id, $latitude, $longitude, $params['xcoordh_nw'], $params['ycoordh_nw'], str2db('REF'), $_SESSION['wp-user']['id'], $timestamp, 2, 1);
        mysql_query($query);
        if (mysql_errno() !== 0) {
            $db_errors .= mysql_errno() . ": " . mysql_error() . "\n";
        }
    }
    if ($params['xcoordh_ne'] !== '' && $params['ycoordh_ne'] !== '' && $params['xcoordh_ne'] != $chart['width'] - 25 && $params['ycoordh_ne'] != 25 || deg2dbl($params['lat_deg_ne'], $params['lat_min_ne'], $params['lat_sec_ne'], $params['lat_ns_ne']) != 'NULL' || deg2dbl($params['lng_deg_ne'], $params['lng_min_ne'], $params['lng_sec_ne'], $params['lng_we_ne']) != 'NULL') {
        $latitude = deg2dbl($params['lat_deg_ne'], $params['lat_min_ne'], $params['lat_sec_ne'], $params['lat_ns_ne']);
        $longitude = deg2dbl($params['lng_deg_ne'], $params['lng_min_ne'], $params['lng_sec_ne'], $params['lng_we_ne']);
        $query = sprintf($query_fmt, $new_kap_id, $latitude, $longitude, empty2null($params['xcoordh_ne']), empty2null($params['ycoordh_ne']), str2db('REF'), $_SESSION['wp-user']['id'], $timestamp, 3, 1);
        mysql_query($query);
        if (mysql_errno() !== 0) {
            $db_errors .= mysql_errno() . ": " . mysql_error() . "\n";
        }
    }
    if ($params['xcoordh_se'] !== '' && $params['ycoordh_se'] !== '' && $params['xcoordh_se'] != $chart['width'] - 25 && $params['ycoordh_se'] != $chart['height'] - 25) {
        $latitude = deg2dbl($params['lat_deg_sw'], $params['lat_min_sw'], $params['lat_sec_sw'], $params['lat_ns_sw']);
        $longitude = deg2dbl($params['lng_deg_ne'], $params['lng_min_ne'], $params['lng_sec_ne'], $params['lng_we_ne']);
        $query = sprintf($query_fmt, $new_kap_id, $latitude, $longitude, $params['xcoordh_se'], $params['ycoordh_se'], str2db('REF'), $_SESSION['wp-user']['id'], $timestamp, 4, 1);
        mysql_query($query);
        if (mysql_errno() !== 0) {
            $db_errors .= mysql_errno() . ": " . mysql_error() . "\n";
        }
    }
}