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


PHP Asset_host::get_perms_where方法代码示例

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


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

示例1: array

     $smb_arr[$cred_key]['selected'] = $cred_key == $smb_credential ? 'selected="selected"' : '';
     $smb_arr[$cred_key]['name'] = $cred['name'] . ' (' . $login_text . ')';
 }
 // fill targets
 // array to fill the hidden field with the targets
 $targets_list = array();
 // array to fill the message when the window is closed
 $asset_list = array();
 if (empty($targets) == FALSE) {
     $select_targets = get_targets($conn, $targets);
 } else {
     // load selected hosts and nets
     if ($type == 'asset' || $type == 'network') {
         $params = array(session_id());
         if ($type == 'asset') {
             $host_perms_where = Asset_host::get_perms_where('h.', TRUE);
             $sql = "SELECT hex(hi.host_id) as id, INET6_NTOA(hi.ip) as ip FROM user_component_filter uf, host h, host_ip hi\n                WHERE uf.session_id=? AND h.id=hi.host_id AND uf.asset_id=hi.host_id AND uf.asset_type='asset' {$host_perms_where}";
         } else {
             $net_perms_where = Asset_net::get_perms_where('n.', TRUE);
             $sql = "SELECT hex(n.id) as id, nc.cidr as ip FROM user_component_filter uf, net n, net_cidrs nc\n                WHERE uf.session_id=? AND uf.asset_id=n.id AND n.id=nc.net_id AND uf.asset_type='network' {$net_perms_where}";
         }
         $rs = $conn->Execute($sql, $params);
         if (!$rs) {
             Av_exception::throw_error(Av_exception::DB_ERROR, $conn->ErrorMsg());
         }
         while (!$rs->EOF) {
             $targets_list[] = $rs->fields['id'] . '#' . $rs->fields['ip'];
             $asset_list[] = array('id' => $rs->fields['id'], 'ip' => $rs->fields['ip']);
             $rs->MoveNext();
         }
     } else {
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:new_scan.php

示例2: function

                            "dataType": 'json',
                            "type": "POST",
                            "url": sSource,
                            "data": aoData,
                            "beforeSend": function()
                            {
                                datatables_loading(true);
                            },
                            "success": function (json) 
                            {
                                datatables_loading(false);

                                <?php 
// Modify the 'Delete' button status
// This option will be disable if the user has host or net permissions
$host_perm_where = Asset_host::get_perms_where();
$net_perm_where = Asset_net::get_perms_where();
if (empty($host_perm_where) && empty($net_perm_where)) {
    ?>
                                
                                if (json.iTotalDisplayRecords > 0)
                                {
                                    $('#delete_all').removeClass('disabled');
                                }
                                else
                                {
                                    $('#delete_all').addClass('disabled');
                                }
                                
                                <?php 
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:list_view.php

示例3: list_results


//.........这里部分代码省略.........
            echo "s";
        } else {
        }
        echo " " . _("found matching search criteria") . " | ";
        echo " <a href='index.php' alt='" . _("View All Reports") . "'>" . _("View All Reports") . "</a></p>";
    }
    echo "<p>";
    echo $stext;
    echo "</p>";
    echo "</div></td></tr></table>";
    $result = array();
    // get the hosts to display
    $result = $dbconn->GetArray($querys . $queryw . $queryl);
    // main query
    //echo $querys.$queryw.$queryl;
    $delete_ids = array();
    if (count($result) > 0) {
        foreach ($result as $rpt) {
            $delete_ids[] = $dreport_id = $rpt["report_id"];
        }
    }
    $_SESSION["_dreport_ids"] = implode(",", $delete_ids);
    //echo "$querys$queryw$queryl";
    if ($result === false) {
        $errMsg[] = _("Error getting results") . ": " . $dbconn->ErrorMsg();
        $error++;
        dispSQLError($errMsg, $error);
    } else {
        $data['vInfo'] = 0;
        $data['vLow'] = 0;
        $data['vMed'] = 0;
        $data['vHigh'] = 0;
        $data['vSerious'] = 0;
        $perms_where = Asset_host::get_perms_where('host.', TRUE);
        if (!empty($perms_where)) {
            $queryt = "SELECT count(lr.result_id) AS total, lr.risk, lr.hostIP, HEX(lr.ctx) AS ctx\n                        FROM vuln_nessus_latest_results lr, host, host_ip hi\n                        WHERE host.id=hi.host_id AND inet6_ntoa(hi.ip)=lr.hostIP {$perms_where} AND falsepositive='N'\n                        GROUP BY risk, hostIP, ctx";
        } else {
            $queryt = "SELECT count(lr.result_id) AS total, risk, lr.hostIP, HEX(lr.ctx) AS ctx\n                        FROM vuln_nessus_latest_results lr\n                        WHERE falsepositive='N'\n                        GROUP BY risk, hostIP, ctx";
        }
        //echo "$queryt<br>";
        $resultt = $dbconn->Execute($queryt);
        while (!$resultt->EOF) {
            $riskcount = $resultt->fields['total'];
            $risk = $resultt->fields['risk'];
            if ($risk == 7) {
                $data['vInfo'] += $riskcount;
            } else {
                if ($risk == 6) {
                    $data['vLow'] += $riskcount;
                } else {
                    if ($risk == 3) {
                        $data['vMed'] += $riskcount;
                    } else {
                        if ($risk == 2) {
                            $data['vHigh'] += $riskcount;
                        } else {
                            if ($risk == 1) {
                                $data['vSerious'] += $riskcount;
                            }
                        }
                    }
                }
            }
            $resultt->MoveNext();
        }
        if ($data['vInfo'] == 0 && $data['vLow'] == 0 && $data['vMed'] == 0 && $data['vHigh'] == 0 && $data['vSerious'] == 0) {
开发者ID:jackpf,项目名称:ossim-arc,代码行数:67,代码来源:index.php

示例4: global_score

function global_score($conn)
{
    global $conf_threshold;
    $perms_where = Asset_host::get_perms_where("h.", TRUE);
    //
    $sql = "SELECT sum(compromise) as compromise, sum(attack) as attack FROM host_qualification hq, host h WHERE ( hq.attack>0 OR hq.compromise>0 ) AND hq.host_id=h.id {$perms_where}";
    if (!($rs =& $conn->CacheExecute($sql))) {
        die($conn->ErrorMsg());
    }
    $score_a = $rs->fields['attack'];
    $score_c = $rs->fields['compromise'];
    $risk_a = round($score_a / $conf_threshold * 100);
    $risk_c = round($score_c / $conf_threshold * 100);
    $risk = $risk_a > $risk_c ? $risk_a : $risk_c;
    $img = 'green';
    // 'off'
    if ($risk > 500) {
        $img = 'red';
    } elseif ($risk > 300) {
        $img = 'yellow';
    } elseif ($risk > 100) {
        $img = 'green';
    }
    $alt = "{$risk} " . _("metric/threshold");
    return array($img, $alt);
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:26,代码来源:mobile_option.php


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