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


PHP ossim_db::custom_connect方法代码示例

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


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

示例1: trim

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
require_once 'av_init.php';
Session::logcheck("analysis-menu", "EventsForensics");
$search = trim(GET('q'));
$max = intval(GET('limit'));
if (!$max) {
    $max = 50;
}
ossim_valid($search, OSS_NULLABLE, OSS_NOECHARS, OSS_ALPHA, OSS_SCORE, OSS_PUNC, 'illegal:' . _("search"));
if (ossim_error()) {
    die;
}
$db = new ossim_db(TRUE);
if (is_array($_SESSION['server']) && $_SESSION['server'][0] != '') {
    $conn = $db->custom_connect($_SESSION["server"][0], $_SESSION["server"][2], $_SESSION["server"][3]);
} else {
    $conn = $db->connect();
}
$params = array();
$filter = '';
if (!empty($search)) {
    $filter = 'WHERE INET6_NTOA(device_ip) LIKE CONCAT("%",?,"%")';
    $params[] = $search;
}
$query = "SELECT DISTINCT INET6_NTOA(device_ip) as ip FROM alienvault_siem.device {$filter}";
$rs = $conn->Execute($query, $params);
if ($rs) {
    while (!$rs->EOF) {
        echo $rs->fields['ip'] . "\n";
        $rs->MoveNext();
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:base_devices.php

示例2: catch

}
if (is_array($_SESSION['server']) && $_SESSION["server"][0] != '') {
    // Change connect variables
    $alert_host = $_SESSION['server'][0];
    $alert_port = $_SESSION['server'][1];
    $alert_user = $_SESSION['server'][2];
    $alert_password = $_SESSION['server'][3];
    $alert_ext_dbname = $_SESSION['server'][4];
    $alert_dbname = preg_match("/\\_restore/", $alert_ext_dbname) ? $alert_ext_dbname : 'alienvault_siem';
    $db_connect_method = DB_PCONNECT;
    $dbo = new ossim_db();
    error_reporting(E_ERROR | E_PARSE);
    // Try to connect
    try {
        $dbo->enable_cache();
        $conn_aux = $dbo->custom_connect($alert_port == "" ? $alert_host : $alert_host . ":" . $alert_port, $alert_user, $alert_password);
    } catch (Exception $e) {
        unset($_SESSION['server']);
        $w_html = sprintf(_('Warning! Unable to connect to <strong>%s (%s)</strong>.'), Util::htmlentities($alert_ext_dbname), Util::htmlentities($alert_host));
        //$w_html .= '&nbsp;&nbsp;'._('Connection has been restored to')." <a style='color: #9f6000; font-weight: bold;' href='base_qry_main.php?clear_allcriteria=1&num_result_rows=-1&submit=Query+DB&current_view=-1&sort_order=time_d'>"._('local')."</a>.";
        $w_html .= '<div style="padding: 3px 0px;">' . _('In order to connect to the selected database, go to the <i>External Databases</i> section and follow the instructions provided by the help icon.') . '</div>';
        $warning = new Av_warning('<div style="padding: 2px;">' . $w_html . '</div>');
        $warning->display();
        exit;
    }
    $dbo->close();
    unset($dbo);
    error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
}
$current_url = Util::get_ossim_url();
$events_report_type = 33;
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:vars_session.php

示例3:

<HR>

<FORM METHOD="POST" ACTION="base_stat_ipaddr.php">

<?php 
if ($debug_mode == 1) {
    echo '<TABLE BORDER=1>
             <TR><TD>action</TD><TD>submit</TD><TD>ip</TD><TD>netmask</TD></TR>
             <TR><TD>' . $action . '</TD><TD>' . $submit . '</TD>
                 <TD>' . $ip . '</TD><TD>' . $netmask . '</TD></TR>
           </TABLE>';
}
/* Print the Statistics the IP address */
$db_object = new ossim_db();
if (is_array($_SESSION["server"]) && $_SESSION["server"][0] != "") {
    $conn_object = $db_object->custom_connect($_SESSION["server"][0], $_SESSION["server"][2], $_SESSION["server"][3]);
} else {
    $conn_object = $db_object->connect();
}
//$conn_object = $db_object->connect();
echo '<CENTER><B>' . $ip . '</B> ( ';
?>
 
  <a href="<?php 
echo Sensor::get_sensor_link($conn_object, $ip) . "/{$ip}.html";
?>
">See host Detail</a>
  <?php 
$db_object->close($conn_object);
echo ') <BR>FQDN: <B>';
if ($resolve_IP == 0) {
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:base_stat_ipaddr.php


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