コード例 #1
0
ファイル: new_scan.php プロジェクト: jackpf/ossim-arc
 // 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 {
         if ($type == 'group') {
             // load assets groups
             $sql = "SELECT hex(uf.asset_id) as gid FROM user_component_filter uf\n                    WHERE uf.session_id=? AND uf.asset_type='group'";
コード例 #2
0
                            "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 
}
?>