本文整理汇总了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');
}
}
示例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');
示例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 {