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


PHP Inventory::modify方法代码示例

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


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

示例1: _

     if (!Inventory::delete($conn, $task_id)) {
         $config_nt['options']['type'] = 'nf_error';
         $config_nt['content'] = _('Error! Inventory task could not be deleted');
     } else {
         $config_nt['options']['type'] = 'nf_success';
         $config_nt['content'] = _('Inventory task deleted successfully');
     }
 } elseif ($submit == _('Save Task')) {
     if (is_array($nmap_options) && count($nmap_options) > 0) {
         $task_params = $task_params . '#' . implode(' ', $nmap_options);
     }
     // Clean $task_params for OCS tasks
     if ($task_type == 3) {
         $task_params = '';
     }
     if (!Inventory::modify($conn, $task_id, $sensor_id, $task_name, $task_type, $task_period, $task_params, $task_nets)) {
         $config_nt['options']['type'] = 'nf_error';
         $config_nt['content'] = _('Error! Inventory task could not be updated');
     } else {
         $config_nt['options']['type'] = 'nf_success';
         $config_nt['content'] = _('Inventory task updated successfully');
     }
 } elseif ($submit == _('Enable / Disable')) {
     if (!Inventory::toggle_scan($conn, $task_id)) {
         $config_nt['options']['type'] = 'nf_error';
         $config_nt['content'] = _('Error! Inventory task could not be updated');
     } else {
         $config_nt['options']['type'] = 'nf_success';
         $config_nt['content'] = _('Inventory task updated successfully');
     }
 }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:interfaces.php

示例2: elseif

            $nt->show();
            Util::make_form("POST", "index.php");
            exit;
        } else {
            if (POST('mode') == 'insert') {
                $id = Inventory::insert($conn, $sensor_id, $name, $s_type_ids[$s_type], $period, $params, $enable, $nets);
                Web_indicator::set_on('Reload_tasks');
                ?>
			<script type="text/javascript">document.location.href = "index.php?s_type=<?php 
                echo $s_type;
                ?>
&msg=saved"</script>
			<?php 
                exit;
            } elseif (POST('mode') == 'update') {
                Inventory::modify($conn, $id, $sensor_id, $name, $s_type_ids[$s_type], $period, $params, $enable, $nets);
                Web_indicator::set_on('Reload_tasks');
                ?>
			<script type="text/javascript">document.location.href = "index.php?s_type=<?php 
                echo $s_type;
                ?>
&msg=saved"</script>
			<?php 
                exit;
            }
        }
    }
}
//Get Data
$id = intval(GET('id'));
$s_type = GET('s_type');
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:task_edit.php

示例3: preg_match

        case 'wmi':
            preg_match('/wmipass:(.*)/', $params, $matches);
            if ($matches[1] != '' && preg_match('/^\\*+$/', $matches[1]) && $_SESSION['wmi_pass'] != '') {
                $params = preg_replace('/wmipass:(.*)/', '', $params);
                $params = $params . 'wmipass:' . $_SESSION['wmi_pass'];
            }
            break;
        default:
            $targets = NULL;
            $params = NULL;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    try {
        if ($task_id != '') {
            Inventory::modify($conn, $task_id, $sensor_id, $name, $scan_types[$s_type], $frequency, $params, $targets);
        } else {
            $task_id = Inventory::insert($conn, $sensor_id, $name, $scan_types[$s_type], $frequency, $params, $targets);
        }
    } catch (Exception $e) {
        $data['status'] = 'error';
        $data['data'] = array('php_exception' => $e->getMessage());
    }
    $db->close();
}
if ($data['status'] == 'error') {
    $txt_error = '<div>' . _('The following errors occurred') . ":</div>\n                      <div style='padding: 10px;'>" . implode('<br/>', $data['data']) . '</div>';
    $config_nt = array('content' => $txt_error, 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto; text-align: left;');
    $nt = new Notification('nt_1', $config_nt);
    $nt->show();
} else {
开发者ID:alienfault,项目名称:ossim,代码行数:31,代码来源:save_schedule.php


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