当前位置: 首页>>代码示例>>PHP>>正文


PHP ossim_clean_error函数代码示例

本文整理汇总了PHP中ossim_clean_error函数的典型用法代码示例。如果您正苦于以下问题:PHP ossim_clean_error函数的具体用法?PHP ossim_clean_error怎么用?PHP ossim_clean_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ossim_clean_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete_nfsen_source

function delete_nfsen_source($data)
{
    if (!Session::am_i_admin()) {
        $return['error'] = TRUE;
        $return['msg'] = _('Action not authorized');
        return $return;
    }
    require_once '../sensor/nfsen_functions.php';
    $sensor = $data['sensor'];
    ossim_valid($sensor, OSS_ALPHA, 'illegal:' . _('Nfsen Source'));
    if (ossim_error()) {
        $info_error = _('Error') . ': ' . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    $res = delete_nfsen($sensor);
    if ($res['status'] == 'success') {
        $return['error'] = FALSE;
        $return['msg'] = _('Source deleted successfully');
        //To forcer load variables in session again
        unset($_SESSION['tab']);
    } else {
        $return['error'] = TRUE;
        $return['msg'] = $res['data'];
    }
    return $return;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:29,代码来源:nfsen_ajax.php

示例2: check_ossim_error

function check_ossim_error()
{
    if (ossim_error()) {
        $error = ossim_get_error();
        ossim_clean_error();
        Av_exception::throw_error(Av_exception::USER_ERROR, $error);
    }
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:8,代码来源:plugin_ajax.php

示例3: check_ossim_error

function check_ossim_error($throw_excep = TRUE)
{
    if (ossim_error()) {
        $error = ossim_get_error();
        ossim_clean_error();
        if ($throw_excep) {
            Av_exception::throw_error(Av_exception::USER_ERROR, $error);
        } else {
            Util::response_bad_request($error);
        }
    }
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:12,代码来源:save_selection.php

示例4: modify_plugingroup_plugin

function modify_plugingroup_plugin($conn, $data)
{
    $plugin_group = $data['plugin_group'];
    $plugin_id = $data['plugin_id'];
    $sids_str = $data['plugin_sids'];
    ossim_valid($plugin_id, OSS_DIGIT, 'illegal:' . _("Plugin ID"));
    ossim_valid($plugin_group, OSS_HEX, 'illegal:' . _("Plugin GroupID"));
    if (ossim_error()) {
        $info_error = "Error: " . ossim_get_error();
        ossim_clean_error();
        $return['error'] = true;
        $return['msg'] = $info_error;
        return $return;
    }
    $total_sel = 1;
    if (is_array($sids_str)) {
        $total_sel = count($sids_str);
        $sids_str = implode(',', $sids_str);
    }
    if ($sids_str !== '') {
        list($valid, $data) = Plugin_sid::validate_sids_str($sids_str);
        if (!$valid) {
            $return['error'] = true;
            $return['msg'] = _("Error for data source ") . $plugin_id . ': ' . $data;
            return $return;
        }
        if ($sids_str == "ANY") {
            $sids_str = "0";
        } else {
            $total = Plugin_sid::get_sidscount_by_id($conn, $plugin_id);
            $sids_str = $total_sel == $total ? "0" : $sids_str;
        }
        Plugin_group::edit_plugin($conn, $plugin_group, $plugin_id, $sids_str);
    }
    $return['error'] = false;
    $return['output'] = '';
    return $return;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:38,代码来源:plugin_groups_ajax.php

示例5: modify_deploy_hosts

function modify_deploy_hosts($wizard, $data)
{
    $os = $data['os'];
    $hosts = $data['hosts'];
    $username = $data['username'];
    $password = $data['password'];
    $domain = $data['domain'];
    ossim_valid($os, "windows|linux", 'illegal:' . _('Deploy Option'));
    ossim_valid($hosts, OSS_HEX, 'illegal:' . _('Host'));
    ossim_valid($username, OSS_USER_2, 'illegal:' . _('Username'));
    ossim_valid($password, OSS_PASSWORD, 'illegal:' . _('Password'));
    ossim_valid($domain, OSS_NOECHARS, OSS_ALPHA, OSS_PUNC_EXT, OSS_NULLABLE, 'illegal:' . _('Domain'));
    if (ossim_error()) {
        $response['error'] = TRUE;
        $response['msg'] = ossim_get_error();
        ossim_clean_error();
        return $response;
    }
    $domain = $os == 'windows' ? $domain : '';
    //Encrypting password to save it in the object
    $pass_c = Util::encrypt($password, Util::get_system_uuid());
    //First we clean the deploy info stored in the object
    $wizard->clean_step_data();
    //Saving the info to achieve the deploy
    $wizard->set_step_data('deploy_os', $os);
    $wizard->set_step_data('deploy_username', $username);
    $wizard->set_step_data('deploy_password', $pass_c);
    $wizard->set_step_data('deploy_domain', $domain);
    $wizard->set_step_data('deploy_hosts', $hosts);
    //Setting the deploy step to 1 (Inicialized)
    $wizard->set_step_data('deploy_step', 1);
    //Saving wizard status
    $wizard->save_status();
    $response['error'] = FALSE;
    return $response;
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:36,代码来源:deploy_ajax.php

示例6: draw_hosts_by_nets_os

function draw_hosts_by_nets_os($conn, $data)
{
    global $empty_tree;
    $tree = array();
    $os = $data['os'];
    $id = $data['net'];
    ossim_valid($os, "windows|linux", 'illegal:' . _("Operating System"));
    ossim_valid($id, OSS_HEX, 'illegal:' . _("Network"));
    if (ossim_error()) {
        ossim_clean_error();
        return $empty_tree;
    }
    $prm = array('%"' . $os . '%');
    if ($id == '0') {
        $id_sql = ' AND n.id IS NULL';
    } else {
        $id_sql = ' AND n.id = UNHEX(?)';
        $prm[] = $id;
    }
    $sql = "SELECT DISTINCT hex(h.id) AS id , h.hostname AS name\n                FROM host_properties hp, host h\n                LEFT JOIN host_net_reference hn ON hn.host_id=h.id\n                LEFT JOIN net n ON n.id=hn.net_id\n                WHERE h.id=hp.host_id AND hp.property_ref=3 AND hp.value LIKE ? {$id_sql}";
    //Always cached
    $rs = $conn->CacheExecute($sql, $prm);
    if (!$rs || $rs->EOF) {
        return $empty_tree;
    }
    while (!$rs->EOF) {
        $tooltip = 'IPs: ' . Asset_host_ips::get_ips_to_string($conn, $rs->fields['id']);
        $_aux = array('key' => 'host_' . $rs->fields['id'], 'title' => $rs->fields['name'], 'isFolder' => FALSE, 'icon' => FALSE, 'type' => 'host', 'host_id' => $rs->fields['id'], 'tooltip' => $tooltip);
        $tree[] = $_aux;
        $rs->MoveNext();
    }
    return $tree;
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:33,代码来源:tree.php

示例7: set_default_map

function set_default_map($conn, $id)
{
    ossim_valid($id, OSS_HEX, 'illegal:' . _('Map'));
    if (ossim_error()) {
        $info_error = "Error: " . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    if (!is_map_editable($conn, $id)) {
        $return['error'] = TRUE;
        $return['msg'] = _("You do not have permission to edit this map");
        return $return;
    }
    $login = Session::get_session_user();
    $config = new User_config($conn);
    $config->set($login, "riskmap", $id, 'simple', "main");
    $return['error'] = FALSE;
    $return['msg'] = _("Default map changed successfully");
    return $return;
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:22,代码来源:map_options.php

示例8: draw_rss_url

function draw_rss_url($widget_content = '')
{
    echo "\n\t\t<tr>\n\t\t\t<td class='nobborder' style='text-align:center;'><br>\n\t\t\t\t<div style='width:60%;margin:0 auto 0 auto;text-align:center;'>\n\t\t\t\t\t<strong>" . _('RSS Url') . ": </strong> <input style='width:250px' type='text' name='widget_content' id='widget_content' value='{$widget_content}'/>\n\t\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class='nobborder'><br></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class='nobborder' style='text-align:center;'>" . _('OR CHOOSE ONE OF THE FOLLOWING FEEDS') . ":</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class='nobborder'><br></td>\n\t\t</tr>";
    $feeds = array();
    $feeds_aux = array();
    $feeds_aux = file("../widgets/files/rss_feed_list.txt") or exit(_("Unable to get the RSS collection"));
    foreach ($feeds_aux as $f) {
        if (preg_match("/(^\\*)|(^\\W)/", $f)) {
            continue;
        }
        $feed = explode("####", trim($f));
        //Validation
        ossim_valid($feed[1], OSS_URL_ADDRESS, 'illegal:' . _("RSS Url"));
        ossim_valid($feed[0], OSS_TEXT, 'illegal:' . _("RSS Title"));
        if (ossim_error()) {
            ossim_clean_error();
            continue;
        }
        //End of validation
        $feeds[] = $feed;
    }
    echo "\n\t\t<tr>\n\t\t\t<td class='nobborder'>\n\t\t\t\t<div style='width:75%;margin:0 auto;padding-top:10px;'>\n\t\t\t\t\t<table width='100%' align='center' class='table_data'>\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<th>" . _('Available RSS Feeds') . "</th>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>";
    $color = 0;
    foreach ($feeds as $feed) {
        $class = $color % 2 == 0 ? "lightgray" : "blank";
        echo "<tr class='{$class}' onclick='javascript:choose_option(\"" . $feed[1] . "\");'>\t\t\t\t\t\t\t\t\n\t\t\t\t<td class='td_report_name'>\n\t\t\t\t\t<a id='sel_{$color}' href='javascript:void(0);'>" . $feed[0] . "</a>\n\t\t\t\t</td>\n\t\t\t</tr>";
        $color++;
    }
    echo "\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t</td>\n\t\t</tr>";
    echo "\n\t\t<tr>\n\t\t\t<td class='nobborder'><br></td>\n\t\t</tr>";
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:wizard_common.php

示例9: schedule_scan

function schedule_scan($conn, $wizard, $data)
{
    $step = intval($wizard->get_step_data('scan_step'));
    $nets = $wizard->get_step_data('scan_nets');
    if ($step != 3 || count($nets) < 1) {
        $response['error'] = TRUE;
        $response['msg'] = _('Asset Scan not valid to schedule');
        return $response;
    }
    $sched = $data['sch_opt'];
    ossim_valid($sched, OSS_DIGIT, 'illegal:' . _("Schedule Option"));
    if (ossim_error()) {
        $response['error'] = TRUE;
        $response['msg'] = ossim_get_error();
        ossim_clean_error();
        $wizard->set_step_data('scan_nets', -1);
        return $response;
    }
    if ($sched == 1) {
        $period = 86400;
    } elseif ($sched == 2) {
        $period = 604800;
    } else {
        $period = 2419200;
    }
    $sensor_id = Av_sensor::get_default_sensor($conn);
    $name = _('Default_wizard_scan');
    $type = 5;
    $targets = array();
    foreach ($nets as $cidrs) {
        $cidrs = explode(' ', $cidrs);
        foreach ($cidrs as $cidr) {
            $targets[$cidr] = $cidr;
        }
    }
    $targets = implode(' ', $targets);
    $params = $targets . '#-T3 -A -sS -F';
    Inventory::insert($conn, $sensor_id, $name, $type, $period, $params, $targets);
    $response['error'] = FALSE;
    $response['data'] = array();
    return $response;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:42,代码来源:scan_ajax.php

示例10: import_assets_from_csv

function import_assets_from_csv($filename, $iic, $ctx, $import_type)
{
    //Process status
    $summary = array('general' => array('status' => '', 'data' => '', 'statistics' => array('total' => 0, 'warnings' => 0, 'errors' => 0, 'saved' => 0)), 'by_hosts' => array());
    $db = new ossim_db();
    $conn = $db->connect();
    $str_data = file_get_contents($filename);
    if ($str_data === FALSE) {
        $summary['general']['status'] = 'error';
        $summary['general']['data']['errors'] = _('Failed to read data from CSV file');
        $summary['general']['statistics']['errors'] = 1;
        return $summary;
    }
    $array_data = preg_split('/\\n|\\r/', $str_data);
    foreach ($array_data as $k => $v) {
        if (trim($v) != '') {
            $data[] = explode('";"', trim($v));
        }
    }
    /*************************************************************************************************************************************
     * From asset section:
     *  - Version 4.x.x or higher: "IP (IP1,IP2,...)";"Hostname";"FQDNs(FQDN1,FQDN2,...)";"Description";"Asset value";"Operating System";
     *                   "Latitude";"Longitude";"Host ID";"External Asset";"Device Types(Type1,Type2,...)"
     *
     *  - Version 3.x.x: "IP"*;"Hostname";"FQDNs(FQDN1,FQDN2,...)";"Description";"Asset value";"Sensors(Sensor1,Sensor2,...)";
     *                   "Operating System";"Latitude";"Longitude"
     *
     * From welcome wizard:
     *  - Version 4.x.x or higher: "IP (IP1,IP2,...)";"Hostname";"Description";"Operating System";"Device Type(Type1,Type2,...)"
     *
     **************************************************************************************************************************************/
    //Check file size
    if (count($data) <= 0 || count($data) == 1 && preg_match('/IP/', $data[0][0])) {
        $summary['general']['status'] = 'error';
        $summary['general']['data'] = _('CSV file is empty');
        $summary['general']['statistics']['errors'] = 1;
        return $summary;
    }
    //Check importation type and headers
    $csv_headers = array();
    if ($import_type == 'hosts') {
        if (preg_match('/Operating System/', $data[0][5]) || preg_match('/Sensors/', $data[0][5])) {
            $csv_headers = array_shift($data);
        } else {
            $summary['general']['status'] = 'error';
            $summary['general']['data'] = _('Headers not found');
            $summary['general']['statistics']['errors'] = 1;
            return $summary;
        }
    }
    //Setting total hosts to import
    $summary['general']['statistics']['total'] = count($data);
    //Getting all Operating System
    $all_os = Properties::get_all_os();
    //Getting devices types
    $all_devices = array();
    $aux_all_devices = Devices::get_all_for_filter($conn);
    $_all_devices = $aux_all_devices[0];
    foreach ($_all_devices as $d_data) {
        $d_key = $d_data['type_name'];
        $d_key .= $d_data['subtype_id'] != 0 ? ':' . $d_data['subtype_name'] : '';
        $all_devices[$d_key] = $d_data['type_id'] . ':' . $d_data['subtype_id'];
    }
    //Allowed sensors
    $filters = array('where' => "acl_sensors.entity_id = UNHEX('{$ctx}')");
    $a_sensors = Av_sensor::get_basic_list($conn, $filters);
    $sensor_ids = array_keys($a_sensors);
    if (count($sensor_ids) == 0) {
        $summary['general']['status'] = 'error';
        $s_error_msg = Session::is_pro() ? _('There is no sensors for this context') : _('There is no sensors for this IP address');
        $summary['general']['data'] = $s_error_msg;
        $summary['general']['statistics']['errors'] = 1;
        return $summary;
    }
    Util::disable_perm_triggers($conn, TRUE);
    foreach ($data as $k => $v) {
        //Clean previous errors
        ossim_clean_error();
        $num_line = $k + 1;
        //Set default status
        $summary['by_hosts'][$num_line]['status'] = 'error';
        //Check file format
        $cnd_1 = $import_type == 'hosts' && count($v) < 9;
        $cnd_2 = $import_type == 'welcome_wizard_hosts' && count($v) < 5;
        if ($cnd_1 || $cnd_2) {
            $summary['by_hosts'][$num_line]['errors']['Format'] = _('Number of fields is incorrect');
            $summary['general']['statistics']['errors']++;
            continue;
        }
        //Clean values
        $param = array();
        $index = 0;
        $max_index = count($v) - 1;
        foreach ($v as $field) {
            $parameter = trim($field);
            if ($index == 0) {
                $pattern = '/^\\"|^\'/';
                $param[] = preg_replace($pattern, '', $parameter);
            } else {
                if ($index == $max_index) {
//.........这里部分代码省略.........
开发者ID:jackpf,项目名称:ossim-arc,代码行数:101,代码来源:import_all_hosts.php

示例11: modify_device_host

function modify_device_host($conn, $data)
{
    $id = $data['id'];
    $type = $data['type'];
    $subtype = $data['subtype'];
    ossim_valid($id, OSS_HEX, 'illegal:' . _("Host ID"));
    ossim_valid($type, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("Device Type"));
    ossim_valid($subtype, OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("Device Subtype"));
    if (ossim_error()) {
        $info_error = "Error: " . ossim_get_error();
        ossim_clean_error();
        $return['error'] = true;
        $return['msg'] = $info_error;
        return $return;
    }
    if (empty($type)) {
        $sql = "DELETE FROM host_types WHERE host_id = UNHEX(?)";
        $params = array($id);
    } else {
        $sql = "DELETE FROM host_types WHERE host_id = UNHEX(?)";
        $params = array($id);
        $conn->Execute($sql, $params);
        $sql = "REPLACE INTO host_types (host_id, type, subtype) VALUES (UNHEX(?), ?, ?)";
        $params = array($id, $type, $subtype);
    }
    if ($conn->Execute($sql, $params) === false) {
        $return['error'] = true;
        $return['msg'] = $conn->ErrorMsg();
    } else {
        Util::memcacheFlush(false);
        $return['error'] = false;
        $return['data'] = _('Device Property Modified Successfully');
    }
    return $return;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:35,代码来源:deploy_ajax.php

示例12: build_crumb

function build_crumb($data)
{
    Session::logcheck("dashboard-menu", "ControlPanelExecutiveEdit");
    $type = $data['type'];
    $step = $data['step'];
    $titles = array();
    $pro = Session::is_pro();
    ossim_valid($type, OSS_DIGIT, 'illegal:' . _("Breadcrumb"));
    ossim_valid($step, OSS_DIGIT, 'illegal:' . _("Step"));
    if (ossim_error()) {
        $info_error = "Error: " . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    switch ($type) {
        case 1:
            $titles = array(1 => utf8_encode(_("Select Type")), 2 => utf8_encode(_("Select Category")), 4 => utf8_encode(_("Customize Widget")), 5 => utf8_encode(_("Save Widget")));
            if ($pro) {
                $titles[3] = utf8_encode(_("Select Assets"));
            }
            break;
        case 2:
            $titles = array(1 => utf8_encode(_("Select Type")), 2 => utf8_encode(_("Insert Rss URL")), 4 => utf8_encode(_("Customize Widget")), 5 => utf8_encode(_("Save Widget")));
            break;
        case 3:
            $titles = array(1 => utf8_encode(_("Select Type")), 2 => utf8_encode(_("Insert Image URL")), 4 => utf8_encode(_("Customize Widget")), 5 => utf8_encode(_("Save Widget")));
            break;
        case 4:
            $titles = array(1 => utf8_encode(_("Select Type")), 2 => utf8_encode(_("Select Report")), 4 => utf8_encode(_("Customize Widget")), 5 => utf8_encode(_("Save Widget")));
            break;
        case 5:
            $titles = array(1 => utf8_encode(_("Select Type")), 2 => utf8_encode(_("Select OSSIM URL")), 4 => utf8_encode(_("Customize Widget")), 5 => utf8_encode(_("Save Widget")));
            break;
        case 6:
            $titles = array(1 => utf8_encode(_("Select Type")), 4 => utf8_encode(_("Customize Widget")), 5 => utf8_encode(_("Save Widget")));
            if ($pro) {
                $titles[3] = utf8_encode(_("Select Assets"));
            }
            break;
        case 7:
            $titles = array(1 => utf8_encode(_("Select Type")), 4 => utf8_encode(_("Customize Widget")), 5 => utf8_encode(_("Save Widget")));
            break;
    }
    $breadcrumb = "";
    ksort($titles);
    foreach ($titles as $i => $title) {
        if ($i > $step) {
            break;
        }
        if ($i == $step) {
            $class = "class='current'";
            $link = "#";
        } else {
            $class = "";
            $link = "wizard.php?backbc=1&step={$i}";
        }
        $breadcrumb .= "<li id='step{$i}' {$class}>\n\t\t\t\t\t\t\t<a href='{$link}'>" . $title . "</a>\n\t\t\t\t\t\t</li>";
    }
    $return['error'] = FALSE;
    $return['msg'] = $breadcrumb;
    return $return;
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:64,代码来源:dashboard_ajax.php

示例13: submit_scan


//.........这里部分代码省略.........
        $arr_ctx = array();
        $sgr = array();
        foreach ($_SESSION["_vuln_targets"] as $target_selected => $server_id) {
            $sgr[$server_id][] = $target_selected;
            if (preg_match("/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\/\\d{1,2}\$/i", $target_selected)) {
                $related_ctxs = array_values(Asset_net::get_id_by_ips($dbconn, $target_selected));
                if (is_array($related_ctxs) && count($related_ctxs) > 0) {
                    $arr_ctx[$target_selected] = key(array_shift($related_ctxs));
                }
            } else {
                if (preg_match("/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\$/i", $target_selected)) {
                    $related_ctxs = array_values(Asset_host::get_id_by_ips($dbconn, $target_selected));
                    if (is_array($related_ctxs) && count($related_ctxs) > 0) {
                        $arr_ctx[$target_selected] = key(array_shift($related_ctxs));
                        // to assign a ctx for a IP
                    }
                } else {
                    if (valid_hostname($target_selected) || valid_fqdns($target_selected)) {
                        $filters = array('where' => "hostname like '{$target_selected}' OR fqdns like '{$target_selected}'");
                        $_hosts_data = Asset_host::get_basic_list($dbconn, $filters);
                        $host_list = $_hosts_data[1];
                        if (count($host_list) > 0) {
                            $first_host = array_shift($host_list);
                            $hips = explode(",", $first_host['ips']);
                            foreach ($hips as $hip) {
                                $hip = trim($hip);
                                $arr_ctx[$hip] = $first_host['ctx'];
                            }
                        }
                    }
                }
            }
        }
        ossim_clean_error();
        unset($_SESSION["_vuln_targets"]);
        // clean scan targets
        $query = array();
        $IP_ctx = array();
        foreach ($arr_ctx as $aip => $actx) {
            $IP_ctx[] = $actx . "#" . $aip;
        }
        if ($vuln_op == "editrecurring" && $sched_id > 0) {
            $query[] = "DELETE FROM vuln_job_schedule WHERE id='{$sched_id}'";
            $i = 1;
            foreach ($sgr as $notify_sensor => $targets) {
                $target_list = implode("\n", $targets);
                $target_list .= "\n" . implode("\n", $ip_exceptions_list);
                $query[] = "INSERT INTO vuln_job_schedule ( name, username, fk_name, job_TYPE, schedule_type, day_of_week, day_of_month, \n                            time, email, meth_TARGET, meth_CRED, meth_VSET, meth_CUSTOM, meth_CPLUGINS, meth_Wfile, \n                            meth_Ucheck, meth_TIMEOUT, next_CHECK, createdate, enabled, resolve_names, time_interval, IP_ctx, credentials) VALUES ( '{$sname}', '{$username}', '" . Session::get_session_user() . "', '{$jobType}',\n                            '{$schedule_type}', '{$dayofweek}', '{$dayofmonth}', '{$time_value}', '{$notify_sensor}', '{$target_list}',\n                            {$I3crID}, '{$sid}', '{$custadd_type}', {$plugs_list}, {$semail}, '{$scan_locally}',\n                            '{$timeout}', '{$requested_run}', '{$insert_time}', '1', '{$resolve_names}' ,'{$time_interval}', '" . implode("\n", $IP_ctx) . "', '{$credentials}') ";
                $sjobs_names[] = $sname . $i;
                $i++;
            }
        } elseif ($recurring) {
            $i = 1;
            foreach ($sgr as $notify_sensor => $targets) {
                $target_list = implode("\n", $targets);
                $target_list .= "\n" . implode("\n", $ip_exceptions_list);
                $query[] = "INSERT INTO vuln_job_schedule ( name, username, fk_name, job_TYPE, schedule_type, day_of_week, day_of_month, \n                                time, email, meth_TARGET, meth_CRED, meth_VSET, meth_CUSTOM, meth_CPLUGINS, meth_Wfile, \n                                meth_Ucheck, meth_TIMEOUT, scan_ASSIGNED, next_CHECK, createdate, enabled, resolve_names, time_interval, IP_ctx, credentials) VALUES ( '{$sname}', '{$username}', '" . Session::get_session_user() . "', '{$jobType}',\n                                '{$schedule_type}', '{$dayofweek}', '{$dayofmonth}', '{$time_value}', '{$notify_sensor}', '{$target_list}',\n                                {$I3crID}, '{$sid}', '{$custadd_type}', {$plugs_list}, {$semail}, '{$scan_locally}',\n                                '{$timeout}', '{$SVRid}', '{$requested_run}', '{$insert_time}', '1', '{$resolve_names}' , '{$time_interval}', '" . implode("\n", $IP_ctx) . "', '{$credentials}') ";
                $sjobs_names[] = $sname . $i;
                $i++;
            }
        } else {
            $i = 1;
            foreach ($sgr as $notify_sensor => $targets) {
                $target_list = implode("\n", $targets);
                $target_list .= "\n" . implode("\n", $ip_exceptions_list);
                $query[] = "INSERT INTO vuln_jobs ( name, username, fk_name, job_TYPE, meth_SCHED, meth_TARGET,  meth_CRED,\n                        meth_VSET, meth_CUSTOM, meth_CPLUGINS, meth_Wfile, meth_TIMEOUT, scan_ASSIGNED,\n                        scan_SUBMIT, scan_next, scan_PRIORITY, status, notify, authorized, author_uname, resolve_names, credentials ) VALUES ( '{$sname}',\n                        '{$username}', '" . Session::get_session_user() . "', '{$jobType}', '{$schedule_type}', '{$target_list}', {$I3crID}, '{$sid}', '{$custadd_type}', {$plugs_list},\n                         {$semail}, '{$timeout}', '{$SVRid}', '{$insert_time}', '{$requested_run}', '3',\n                        'S', '{$notify_sensor}', '{$scan_locally}', '" . implode("\n", $IP_ctx) . "', '{$resolve_names}' , '{$credentials}') ";
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:67,代码来源:sched.php

示例14: delete_alarm

function delete_alarm($conn, $data)
{
    $id = $data['id'];
    //Validating ID before closing the alarm
    ossim_valid($id, OSS_HEX, 'illegal:' . _("Backlog ID"));
    if (ossim_error()) {
        $info_error = "Error: " . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    //Opening the alarm
    Alarm::delete_backlog($conn, $id);
    $return['error'] = FALSE;
    $return['msg'] = _('Alarm deleted successfully');
    return $return;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:18,代码来源:alarm_actions.php

示例15: delete_engine

function delete_engine($conn, $data)
{
    $id = $data['engine'];
    ossim_valid($id, OSS_HEX, 'illegal:' . _('Engine ID'));
    if (ossim_error()) {
        $info_error = _('Error') . ': ' . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    if ($id == Session::get_default_engine($conn)) {
        $return['error'] = TRUE;
        $return['msg'] = _('It is not allowed to delete the default engine');
        return $return;
    }
    $contexts = Acl::get_contexts_by_engine($conn, $id);
    if (count($contexts) > 0) {
        $return['error'] = TRUE;
        $return['msg'] = _('There are contexts asociated to this engine. You are not allowed to delete this engine');
        return $return;
    }
    Acl::delete_entities($conn, $id);
    Alarm::delete_from_taxonomy($conn, $id);
    $id = Util::uuid_format($id);
    if (is_dir(_MAIN_PATH . "/{$id}")) {
        Directive_editor::remove_engine($id);
    }
    Web_indicator::set_on('Reload_servers');
    $return['error'] = FALSE;
    $return['data'] = '';
    return $return;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:33,代码来源:engine_ajax.php


注:本文中的ossim_clean_error函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。