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


PHP Asset_host::is_allowed方法代码示例

本文整理汇总了PHP中Asset_host::is_allowed方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset_host::is_allowed方法的具体用法?PHP Asset_host::is_allowed怎么用?PHP Asset_host::is_allowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Asset_host的用法示例。


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

示例1: get_asset_tags

/**
 * @param $conn
 * @param $asset_id
 *
 * @return array
 */
function get_asset_tags($conn, $asset_id)
{
    if (!Asset_host::is_allowed($conn, $asset_id)) {
        $error = _('Asset Not Allowed');
        Util::response_bad_request($error);
    }
    return get_tags($conn, $asset_id);
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:14,代码来源:get_asset_tags.php

示例2: get_asset_groups

function get_asset_groups($conn, $asset_id)
{
    if (!Asset_host::is_allowed($conn, $asset_id)) {
        $error = _('Asset Not Allowed');
        Util::response_bad_request($error);
    }
    try {
        $asset = Asset_host::get_object($conn, $asset_id);
        $num = $asset->get_num_group($conn);
    } catch (Exception $e) {
        $num = '-';
    }
    return $num;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:14,代码来源:get_status_groups.php

示例3: validate_form_fields

$conn = $db->connect();
$validation_errors = validate_form_fields('POST', $validate);
switch ($action) {
    case 'select_os':
        $os_windows = POST('os_windows');
        break;
    case 'deploy_agent':
        $sensor_id = POST('sensor_id');
        $ip_address = POST('ip_address');
        $user = POST('user');
        $pass = POST('pass');
        $domain = POST('domain');
        //Extra validations
        if (empty($validation_errors)) {
            //Checking Asset ID
            if (Asset_host::is_allowed($conn, $asset_id) == FALSE) {
                $validation_errors['asset_id'] = _('You do not have permission to deploy HIDS agent to this asset. Please check with your account admin for more information');
            }
            //Checking HIDS Sensor
            $cnd_1 = Ossec_utilities::is_sensor_allowed($conn, $sensor_id) == FALSE;
            $asset_sensors = Asset_host_sensors::get_sensors_by_id($conn, $asset_id);
            $cnd_2 = empty($asset_sensors[$sensor_id]);
            if ($cnd_1 || $cnd_2) {
                $validation_errors['sensor_id'] = sprintf(_("Sensor %s not allowed. Please check with your account admin for more information"), Av_sensor::get_name_by_id($conn, $sensor_id));
            }
            //Checking IP Address
            $aux_asset_ips = Asset_host_ips::get_ips_to_string($conn, $asset_id);
            if (preg_match('/' . $ip_address . '/', $aux_asset_ips) == FALSE) {
                $validation_errors['ip_address'] = _("The IP address you enter is not valid. Please check your asset and network settings and try again");
            }
        }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:deploy_hids.php

示例4: AND

    $inserts[] = "REPLACE INTO datawarehouse.ssi_user SELECT *,'{$user}' FROM datawarehouse.ssi \n        WHERE 1 AND (source IN ('" . implode("','", array_keys($srcs)) . "') OR destination IN ('" . implode("','", array_keys($dsts)) . "'))";
    $sql = "SELECT source, destination FROM datawarehouse.incidents_ssi WHERE 1 {$ips_filter}";
    // AND month=$month
    //echo $sql;
    // INCIDENTS_SSI
    if (!($rs =& $conn->Execute($sql))) {
        Av_exception::throw_error(Av_exception::DB_ERROR, $conn->ErrorMsg());
    }
    // test perms for source or destination ips
    while (!$rs->EOF) {
        $ip_src = $rs->fields['source'];
        $ip_dst = $rs->fields['destination'];
        if (isset($srcs[$ip_src]) || Asset_host::is_allowed($conn, $ip_src)) {
            $srcs[$ip_src]++;
        }
        if (isset($dsts[$ip_dst]) || Asset_host::is_allowed($conn, $ip_dst)) {
            $dsts[$ip_dst]++;
        }
        $rs->MoveNext();
    }
    $inserts[] = "REPLACE INTO datawarehouse.incidents_ssi_user SELECT *,'{$user}' FROM datawarehouse.incidents_ssi \n        WHERE 1 AND (source IN ('" . implode("','", array_keys($srcs)) . "') OR destination IN ('" . implode("','", array_keys($dsts)) . "'))";
} else {
    $inserts[] = "REPLACE INTO datawarehouse.ssi_user SELECT *,'{$user}' FROM datawarehouse.ssi WHERE 1 {$ips_filter}";
    $inserts[] = "REPLACE INTO datawarehouse.incidents_ssi_user SELECT *,'{$user}' FROM datawarehouse.incidents_ssi WHERE 1 {$ips_filter}";
}
// Delete first and fill only with permited data
$conn->Execute("DELETE FROM datawarehouse.ssi_user WHERE user = '{$user}'");
$conn->Execute("DELETE FROM datawarehouse.incidents_ssi_user WHERE user = '{$user}'");
foreach ($inserts as $insert) {
    if (!$conn->Execute($insert)) {
        Av_exception::throw_error(Av_exception::DB_ERROR, $conn->ErrorMsg());
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:updateBd.php

示例5: GET

$asset_id = GET('asset_id');
$asset_type = GET('asset_type');
$response['session_updated'] = FALSE;
$reloaded = FALSE;
ossim_valid($asset_id, OSS_HEX, 'illegal: ' . _('Asset ID'));
ossim_valid($asset_type, OSS_ALPHA, 'illegal: ' . _('Asset Type'));
if (ossim_error()) {
    echo json_encode($response);
    exit;
}
$db = new ossim_db();
$conn = $db->connect();
// Load the current asset object in session same as in index.php
// Host
if (Asset_host::is_in_db($conn, $asset_id)) {
    if (Asset_host::is_allowed($conn, $asset_id)) {
        $asset_object = Asset_host::get_object($conn, $asset_id);
        $reloaded = TRUE;
    }
} elseif (Asset_net::is_in_db($conn, $asset_id)) {
    if (Asset_net::is_allowed($conn, $asset_id)) {
        $asset_object = Asset_net::get_object($conn, $asset_id);
        $reloaded = TRUE;
    }
} elseif (Asset_group::is_in_db($conn, $asset_id)) {
    $asset_object = Asset_group::get_object($conn, $asset_id);
    $reloaded = TRUE;
}
// Save session object only if is already saved (it means the user has perms)
if (!empty($_SESSION['asset_detail'][$asset_id]) && $reloaded) {
    $_SESSION['asset_detail'][$asset_id] = serialize($asset_object);
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:reload_session_object.php


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