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


PHP Av_sensor::load_from_db方法代码示例

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


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

示例1: array

            </div>
        </td>
    </tr>
    </table>
<?php 
}
$commands = array("play_task", "pause_task", "stop_task", "resume_task", "delete_task");
// OMP commands
if (in_array($disp, $commands)) {
    // get server info to manage tasks
    $uuid = Util::get_system_uuid();
    $result_server = $dbconn->Execute("SELECT meth_Wcheck FROM vuln_jobs WHERE id=" . $job_id);
    preg_match("/.*\\s(\\d+\\.\\d+\\.\\d+\\.\\d+)<.*/", $result_server->fields['meth_Wcheck'], $found);
    $sensor_id = Av_sensor::get_id_by_ip($dbconn, $found[1]);
    $sensor_object = new Av_sensor($sensor_id);
    $sensor_object->load_from_db($dbconn);
    $ov_credentials = $sensor_object->get_vs_credentials($dbconn);
    $port = $ov_credentials['port'];
    $user = $ov_credentials['user'];
    $password = $ov_credentials['password'];
    $omp = new Omp($sensor_object->get_ip(), $port, $user, $password);
}
switch ($disp) {
    case "kill":
        $schedid = intval($schedid);
        if ($schedid > 0) {
            system("sudo /usr/share/ossim/scripts/vulnmeter/cancel_scan.pl {$schedid}");
        }
        break;
    case "play_task":
        $omp->play_task($job_id);
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:manage_jobs.php

示例2: count

                $ng_selected = count($sensors_nagios);
            }
            $sensors_nagios[] = array('id' => $sid, 'ip' => $s['ip'], 'name' => $s['name'], 'selected' => $option);
        }
    }
}
//If we have permissions to see any sensor...
if (!empty($sensors_nagios)) {
    if ($ng_selected == -1) {
        $ng_selected = 0;
    }
    $_ip = $sensors_nagios[$ng_selected]['ip'];
    //Remote ossim sensors and remote nagios...
    if ($_ip != '' && $_ip != 'localhost' && $_ip != Util::get_default_admin_ip() && $_ip != $_SERVER['SERVER_NAME']) {
        $_sensor = new Av_sensor($sensors_nagios[$ng_selected]['id']);
        $_sensor->load_from_db($conn);
        $nagios_options = $_sensor->get_nagios_credentials($conn);
        $_s_user = $nagios_options['user'];
        $_s_pass = $nagios_options['password'];
        try {
            $nagios_url = $_sensor->get_nagios_url($_s_user, $_s_pass);
            $nagios = $nagios_url['url'];
            $nagios_opts = $nagios_url['s_context'];
            if (preg_match('/^http:\\/\\//', $nagios) && $_s_user != '' && $_s_pass != '') {
                $nagios = str_replace('http://', "http://{$_s_user}:{$_s_pass}@", $nagios);
            } elseif (preg_match('/^https:\\/\\//', $nagios) && $nagios_opts['http']['header'] != '') {
                $flag_login = TRUE;
                $_login = base64_encode(Util::encrypt($_s_user . "####" . md5($_s_pass), $conf->get_conf('remote_key')));
                $_SESSION['_remote_nagios_credential'] = array($_ip, $_login);
            }
        } catch (Exception $e) {
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:menu.php


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