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


PHP ossim_error函数代码示例

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


在下文中一共展示了ossim_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: validate_post_params

function validate_post_params($conn, $name, $descr, $sids, $imported_sids)
{
    $vals = array('name' => array(OSS_INPUT, 'illegal:' . _("Name")), 'descr' => array(OSS_TEXT, OSS_NULLABLE, 'illegal:' . _("Description")));
    ossim_valid($name, $vals['name']);
    ossim_valid($descr, $vals['descr']);
    $plugins = array();
    $sids = is_array($sids) ? $sids : array();
    if (intval(POST('pluginid')) > 0) {
        $sids[POST('pluginid')] = "0";
    }
    foreach ($sids as $plugin => $sids_str) {
        if ($sids_str !== '') {
            list($valid, $data) = Plugin_sid::validate_sids_str($sids_str);
            if (!$valid) {
                ossim_set_error(_("Error for data source ") . $plugin . ': ' . $data);
                break;
            }
            if ($sids_str == "ANY") {
                $sids_str = "0";
            } else {
                $aux = count(explode(',', $sids_str));
                $total = Plugin_sid::get_sidscount_by_id($conn, $plugin);
                $sids_str = $aux == $total ? "0" : $sids_str;
            }
            $plugins[$plugin] = $sids_str;
        }
    }
    if (!count($plugins) && !count($imported_sids)) {
        ossim_set_error(_("No Data Sources or Event Types selected"));
    }
    if (ossim_error()) {
        die(ossim_error());
    }
    return array($name, $descr, $plugins);
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:35,代码来源:modifyplugingroups.php

示例3: die_error

function die_error($msg = null, $append = null)
{
    ?>
    <!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 gettext("OSSIM Framework");
    ?>
 </title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
        <meta http-equiv="Pragma" content="no-cache"/>
        <link rel="stylesheet" type="text/css" href="../style/style.css"/>
    </head>
    <body>
    <?php 
    if ($msg) {
        ossim_set_error($msg);
    }
    echo ossim_error();
    echo '<table class="noborder transparent" align="center">
				<tr>
					<td class="nobborder"><input type="button" value="' . _("Back") . '" class="button" onclick="javascript:history.back()"/></td>
				</tr>
			  </table>';
    echo $append;
    ?>
    </body>
    </html>
    <?php 
    exit;
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:32,代码来源:manageincident.php

示例4: 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

示例5: draw_error

function draw_error($error)
{
    global $config, $login;
    $resp = new xajaxResponse();
    //return xajax_debug($error, $resp);
    $html = ossim_error($error);
    $resp->addAssign("errors", "innerHTML", $html);
    return $resp;
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:9,代码来源:configure_event_viewer.php

示例6: 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

示例7: get_pulse_detail

function get_pulse_detail()
{
    $data = POST('data');
    ossim_valid($data['pulse_id'], OSS_HEX, 'illegal: Pulse ID');
    if (ossim_error()) {
        return array();
    }
    $otx = new Otx();
    $pulse = $otx->get_pulse_detail($data['pulse_id']);
    //Converting indicator hash to array to use it in the datatables.
    $pulse['indicators'] = array_values($pulse['indicators']);
    return $pulse;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:13,代码来源:otx_pulse.php

示例8: get_pulse_detail_from_id

function get_pulse_detail_from_id($conn)
{
    $type = POST('type');
    $pulse = POST('pulse');
    $id = POST('id');
    ossim_valid($type, 'alarm|event|alarm_event', 'illegal:' . _('Type'));
    ossim_valid($pulse, OSS_HEX, 'illegal:' . _('Pulse'));
    ossim_valid($id, OSS_HEX, 'illegal:' . _('ID'));
    if (ossim_error()) {
        Av_exception::throw_error(Av_exception::USER_ERROR, ossim_get_error_clean());
    }
    if ($type == 'alarm') {
        $pulse = Alarm::get_pulse_data_from_alarm($conn, $id, $pulse, TRUE);
    } elseif ($type == 'event') {
        $pulse = Siem::get_pulse_data_from_event($conn, $id, $pulse, FALSE, TRUE);
    } elseif ($type == 'alarm_event') {
        $pulse = Siem::get_pulse_data_from_event($conn, $id, $pulse, TRUE, TRUE);
    }
    return array('name' => $pulse['name'], 'descr' => $pulse['descr'], 'iocs' => array_values($pulse['iocs']));
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:20,代码来源:otx_reputation_info.php

示例9: 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

示例10: 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

示例11: ossim_db

require_once 'av_init.php';
Session::logcheck('configuration-menu', 'PolicyServers');
$db = new ossim_db();
$conn = $db->connect();
$id = GET('id');
$ip = GET('ip');
$sname = GET('name');
$update = intval(GET('update'));
$opensource = Session::is_pro() ? FALSE : TRUE;
$mssp = intval($conf->get_conf("alienvault_mssp"));
$local_id = $conf->get_conf("server_id");
ossim_valid($ip, OSS_IP_ADDR, OSS_NULLABLE, 'illegal:' . _('Server IP'));
ossim_valid($sname, OSS_ALPHA, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _('Server Name'));
ossim_valid($id, OSS_HEX, OSS_NULLABLE, 'illegal:' . _('Server ID'));
if (ossim_error()) {
    die(ossim_error());
}
$action = 'newserver.php';
$all_rservers = Server::get_server_hierarchy($conn, $id);
$error_forward = FALSE;
$can_i_modify_elem = TRUE;
if (!empty($id)) {
    $server = Server::get_object($conn, $id);
    $role_list = Role::get_list($conn, $id);
    if (!empty($server) && !empty($role_list)) {
        $role = $role_list[0];
        $sname = $server->get_name();
        $ip = $server->get_ip();
        $port = $server->get_port();
        $descr = $server->get_descr();
        $correlate = $role->get_correlate();
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:newserverform.php

示例12: array

* 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');
//CPE Types
$_cpe_types = array('os' => 'o', 'hardware' => 'h', 'software' => 'a');
$_cpe = GET('q');
$_cpe_type = GET('cpe_type');
ossim_valid($_cpe, OSS_NULLABLE, OSS_ALPHA, OSS_PUNC_EXT, 'illegal:' . _('CPE'));
ossim_valid($_cpe_type, 'os | software | hardware', 'illegal:' . _('CPE Type'));
if (ossim_error() || !array_key_exists($_cpe_type, $_cpe_types)) {
    exit;
}
$db = new Ossim_db();
$conn = $db->connect();
$_cpe = escape_sql($_cpe, $conn);
$filters = array('where' => "`cpe` LIKE 'cpe:/" . $_cpe_types[$_cpe_type] . "%' AND `line` LIKE '%{$_cpe}%'", 'limit' => 20);
$software = new Software($conn, $filters);
$db->close();
foreach ($software->get_software() as $cpe_info) {
    echo $cpe_info['cpe'] . '###' . $cpe_info['line'] . "\n";
}
/* End of file search_cpe.php */
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:search_cpe.php

示例13: GET

* 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", "ReportsWireless");
require_once 'Wireless.inc';
$sensor = GET('sensor');
$file = str_replace("../", "", GET('file'));
ossim_valid($sensor, OSS_IP_ADDR, 'illegal: sensor');
ossim_valid($file, OSS_TEXT, 'illegal: file');
if (ossim_error()) {
    die(ossim_error());
}
# sensor list with perms
require_once 'ossim_db.inc';
$db = new ossim_db();
$conn = $db->connect();
if (!validate_sensor_perms($conn, $sensor, ", sensor_properties WHERE sensor.id=sensor_properties.sensor_id AND sensor_properties.has_kismet=1")) {
    echo ossim_error($_SESSION["_user"] . " have not privileges for {$sensor}");
    $db->close();
    exit;
}
$db->close();
#
$path = "/var/ossim/kismet/parsed/{$sensor}/{$file}";
if (file_exists($path)) {
    header('Content-Type: application/xml');
    echo file_get_contents($path);
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:viewxml.php

示例14: ossim_error

			width: 90%;
		}
		
	</style>
</head>

<body>

<div class='c_back_button'>
    <input type='button' class="av_b_back"/>
</div>

<div id='av_info'>
	<?php 
if (!empty($error_msg)) {
    echo ossim_error($error_msg);
}
?>
</div>

<table id='t_ref'>
	
	<tr>
		<td class='sec_title'><?php 
echo _("Reference Types");
?>
</td>
		<td class='sec_title'><?php 
echo _("New Reference");
?>
</td>
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:manage_references.php

示例15: dirname

 * @autor      AlienVault INC
 * @license    http://www.gnu.org/licenses/gpl-2.0.txt
 * @copyright  2003-2006 ossim.net
 * @copyright  2007-2013 AlienVault
 * @link       https://www.alienvault.com/
 */
require_once dirname(__FILE__) . '/../../conf/config.inc';
session_write_close();
Session::logcheck('environment-menu', 'EventsHidsConfig');
$events_hids_config = Session::menu_perms('environment-menu', 'EventsHidsConfig');
try {
    $db = new ossim_db();
    $conn = $db->connect();
    $sensor_id = POST('sensor_id');
    ossim_valid($sensor_id, OSS_HEX, 'illegal:' . _('Sensor ID'));
    if (!ossim_error()) {
        if (!Ossec_utilities::is_sensor_allowed($conn, $sensor_id)) {
            $e_msg = _('Error! Sensor not allowed');
            Av_exception::throw_error(Av_exception::USER_ERROR, $e_msg);
        }
    } else {
        $e_msg = ossim_get_error_clean();
        Av_exception::throw_error(Av_exception::USER_ERROR, $e_msg);
    }
    $agents = Ossec_agent::get_list($sensor_id);
    $data = array();
    if (is_array($agents) && !empty($agents)) {
        foreach ($agents as $agent_id => $a_data) {
            if (empty($a_data)) {
                continue;
            }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:dt_agents.php


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