本文整理汇总了PHP中Plugin::get_list方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin::get_list方法的具体用法?PHP Plugin::get_list怎么用?PHP Plugin::get_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::get_list方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_plugin_list
function get_plugin_list($conn, $product_type)
{
$list = "";
$product_types = implode(",", $product_type);
$plugin_list = Plugin::get_list($conn, "WHERE product_type IN ({$product_types})");
foreach ($plugin_list as $plugin) {
$list .= $list != "" ? "," . $plugin->get_id() : $plugin->get_id();
}
if ($list == "") {
$list = "0";
}
return $list;
}
示例2: plugin_select
function plugin_select($conn)
{
$plugins = Plugin::get_list($conn, 'ORDER BY name');
$select = "<select style='width:300px' onchange='change_type(\"sid\", \$(this).val())'>";
if (is_array($plugins) && count($plugins) > 0) {
foreach ($plugins as $plugin) {
$plugin_title = strlen($plugin->get_description()) > 0 ? $plugin->get_name() . ': ' . $plugin->get_description() : $plugin->get_name();
$plugin_name = strlen($plugin_title) > 36 ? substr($plugin_title, 0, 39) . '...' : $plugin_title;
$select .= "<option title='" . $plugin_title . "' value='" . $plugin->get_id() . "' >" . $plugin_name . "</option>";
}
$select .= "</select>";
$select .= "<div id='sidselect'></div>";
} else {
$select .= "<option value=''>" . _('No items found') . "</option>";
$select .= "</select>";
}
return $select;
}
示例3: ossim_valid
if ($plugin_id1 != '' || $plugin_id2 != '' || $plugin_sid1 != '' || $plugin_sid2 != '') {
$action = 'modify';
$url_form = 'modifypluginref.php';
$button_text = Util::js_entities(_('Save rule'));
ossim_valid($plugin_id1, OSS_DIGIT, 'illegal:' . _('Plugin ID1'));
ossim_valid($plugin_id2, OSS_DIGIT, 'illegal:' . _('Plugin ID2'));
ossim_valid($plugin_sid1, OSS_DIGIT, 'illegal:' . _('Plugin SID1'));
ossim_valid($plugin_sid2, OSS_DIGIT, 'illegal:' . _('Plugin SID2'));
if (ossim_error()) {
echo ossim_error();
exit;
}
}
$db = new ossim_db();
$conn = $db->connect();
$plugin_list = Plugin::get_list($conn, 'ORDER BY name', 0);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php
echo _("Cross-Correlation");
?>
</title>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php
echo Util::get_css_id();
?>
"/>
<script type="text/javascript" src="../js/jquery.min.js"></script>
示例4: ossim_error
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck("analysis-menu", "EventsForensics");
if (!Session::am_i_admin()) {
echo ossim_error(_("You don't have permission to see this page"));
exit;
}
$db = new ossim_db();
$conn = $db->connect();
$plugin_list = Plugin::get_list($conn, "ORDER BY name", 0);
require 'base_conf.php';
include_once $BASE_path . "includes/base_db.inc.php";
include_once "{$BASE_path}/includes/base_state_query.inc.php";
include_once "{$BASE_path}/includes/base_state_common.inc.php";
/* Connect to the Alert database */
$db_snort = NewBASEDBConnection($DBlib_path, $DBtype);
$db_snort->baseDBConnect($db_connect_method, $alert_dbname, $alert_host, $alert_port, $alert_user, $alert_password, 1);
$qs = new QueryState();
$newref = GET('newref');
$delete = GET('deleteref');
$error_msg = null;
if ($newref != "") {
ossim_valid($newref, OSS_ALPHA, OSS_NULLABLE, 'illegal:' . _("New Reference"));
if (!ossim_error()) {
$sql = "INSERT INTO reference_system (ref_system_name) VALUES (\"{$newref}\")";
示例5: array
require_once 'classes/Sensor.inc';
$sensor_list = Sensor::get_list($conn);
$sensors[] = array("value" => ANY, "name" => "ANY");
foreach ($sensor_list as $s) {
$sensors[] = array("value" => $s->get_ip(), "name" => $s->get_name() . " (" . $s->get_ip() . ")");
}
/* ports */
require_once 'classes/Port_group.inc';
$port_list = Port_group::get_list($conn);
$ports[] = array("value" => ANY, "name" => "ANY");
foreach ($port_list as $p) {
$ports[] = array("value" => $p->get_name(), "name" => $p->get_name() . " (" . $p->get_descr() . ")");
}
/* plugins */
require_once 'classes/Plugin.inc';
$plugin_list = Plugin::get_list($conn);
$plugins[] = array("value" => ANY, "name" => "ANY");
foreach ($plugin_list as $p) {
$plugins[] = array("value" => $p->get_id(), "name" => $p->get_name() . " (" . $p->get_id() . ")");
}
/* actions */
require_once 'classes/Action.inc';
$action_list = Action::get_list($conn);
if (is_array($action_list)) {
foreach ($action_list as $a) {
$actions[] = array("value" => $a->get_id(), "name" => $a->get_descr());
}
}
function select_response_object($title, $objects, $id)
{
?>
示例6: foreach
$xml .= "<cell><![CDATA[" . $host->get_threshold_c() . "]]></cell>";
$xml .= "<cell><![CDATA[" . $host->get_threshold_a() . "]]></cell>";
$sensors = "";
if ($sensor_list = $host->get_sensors($conn)) {
foreach ($sensor_list as $sensor) {
$sensors .= $sensor->get_sensor_name() . '<br/>';
}
}
$xml .= "<cell><![CDATA[" . utf8_encode($sensors) . "]]></cell>";
$scantype = gettext("None");
if ($scan_list = Host_scan::get_list($conn, "WHERE host_ip = inet_aton('{$ip}')")) {
$scantype = "";
foreach ($scan_list as $scan) {
$id = $scan->get_plugin_id();
$plugin_name = "";
if ($plugin_list = Plugin::get_list($conn, "WHERE id = {$id}")) {
$plugin_name .= $plugin_list[0]->get_name();
$scantype .= ucfirst($plugin_name) . "<br>";
} else {
$scantype .= "{$id}<BR>";
}
}
}
$xml .= "<cell><![CDATA[" . $scantype . "]]></cell>";
if ($os_data = Host_os::get_ip_data($conn, $host->get_ip())) {
$os = $os_data["os"];
$host_os = $os . " " . Host_os::get_os_pixmap_nodb($os);
} else {
$host_os = "";
}
$xml .= "<cell><![CDATA[" . $host_os . "]]></cell>";
示例7: gettext
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<link rel="stylesheet" type="text/css" href="../style/style.css"/>
</head>
<body>
<h1> <?php
echo gettext("Insert new host scan configuration");
?>
</h1>
<?php
require_once 'ossim_db.inc';
require_once 'classes/Plugin.inc';
$db = new ossim_db();
$conn = $db->connect();
$plugin_list = Plugin::get_list($conn, "WHERE id >= 3000 AND id < 4000");
?>
<table align="center">
<form method="post" action="newhostscan.php">
<input type="hidden" name="insert" value="insert">
<tr>
<th><?php
echo gettext("host IP");
?>
</th>
<td class="left"><input type="text" name="host_ip"></td>
</tr>
<tr>
<th><?php
示例8: foreach
foreach ($protocol_list as $proto) {
//$_SESSION[$id] = $plugin->get_name();
echo "protocols['proto_" . $proto['id'] . "'] = '" . $proto['name'] . "'\n";
//Load available protocols (Autocompleted)
$p_list .= '{ txt: "Protocol:' . $proto['name'] . '", id: "' . $proto['id'] . '" },';
}
}
//Port list (Autocompleted)
if ($port_list = Port::get_list($conn, " AND protocol_name='tcp'")) {
foreach ($port_list as $port) {
$prt_list .= '{ txt:"' . $port->get_port_number() . " - " . $port->get_service() . '", id: "' . $port->get_port_number() . '" },';
}
}
// Plugin list
$sids = array();
if ($plugin_list = Plugin::get_list($conn, "")) {
echo "var plugins = new Array(" . count($plugin_list) . ")\n";
foreach ($plugin_list as $plugin) {
$sids[$plugin->get_name()] = $plugin->get_id();
//$_SESSION[$id] = $plugin->get_name();
echo "plugins['id_" . $plugin->get_id() . "'] = '" . $plugin->get_name() . "';\n";
echo "plugins['id_" . $plugin->get_name() . "'] = '" . $plugin->get_name() . "';\n";
}
}
// Device list
$devices = array();
$query = "SELECT name,inet6_ntoa(ip) as ip,device.id FROM sensor,alienvault_siem.device WHERE device.sensor_id=sensor.id";
$rs = $conn->Execute($query);
while (!$rs->EOF) {
$devices[] = $rs->fields;
$rs->MoveNext();
示例9: print_rule
//.........这里部分代码省略.........
echo gettext("Click to modify this rule");
?>
"><?php
echo $this->name;
?>
</a></td>
<?php
}
?>
<td><?php
echo $this->reliability;
?>
</td>
<td><?php
echo $this->time_out;
?>
</td>
<td><?php
echo $this->occurrence;
?>
</td>
<td><?php
echo $this->from;
?>
</td>
<td><?php
echo $this->to;
?>
</td>
<td><?php
echo $this->port_from;
?>
</td>
<td><?php
echo $this->port_to;
?>
</td>
<td><?php
echo $this->sensor;
?>
</td>
<td>
<?php
if ($this->plugin_id != "") {
$plugin_id = $this->plugin_id;
if ($plugin_list = Plugin::get_list($conn, "WHERE id = {$plugin_id}")) {
$name = $plugin_list[0]->get_name();
echo "<a href=\"../../conf/pluginsid.php?id={$plugin_id}&" . "name={$name}\">{$name}</a> ({$plugin_id})";
}
}
?>
</td>
<td>
<?php
if ($this->plugin_id != "") {
$plugin_sid = $this->plugin_sid;
$plugin_sid_list = split(',', $plugin_sid);
if (count($plugin_sid_list) > 30) {
?>
<a style="cursor:pointer;" TITLE="<?php
echo gettext("To view or hide the list of plugin sid click here");
?>
" onclick="Menus('plugsid')"> <?php
echo gettext("Expand / Collapse");
?>
</a>
<div id="plugsid" class="menuhide">
<?php
}
foreach ($plugin_sid_list as $sid_negate) {
$sid = $sid_negate;
if (!strncmp($sid_negate, "!", 1)) {
$sid = substr($sid_negate, 1);
}
/* sid == ANY */
if (!strcmp($sid, "ANY")) {
echo gettext("ANY");
} elseif (strpos($sid, "PLUGIN_SID")) {
echo gettext("{$sid}");
} elseif ($plugin_list = Plugin_sid::get_list($conn, "WHERE plugin_id = {$plugin_id} AND sid = {$sid}")) {
$name = $plugin_list[0]->get_name();
echo "<a title=\"{$name}\">{$sid_negate}</a> ";
} else {
echo "<a title=\"" . gettext("Invalid plugin sid") . "\" style=\"color:red\">{$sid_negate}</a> ";
}
}
if (count($plugin_sid_list) > 30) {
?>
</div>
<?php
}
}
?>
</td>
</tr>
<?php
}
}
示例10: rule_table
//.........这里部分代码省略.........
</td>
<!-- end expand -->
<td><?php
echo $rule->get_attribute('name');
?>
</td>
<td><?php
echo $rule->get_attribute('reliability');
?>
</td>
<td><?php
echo $rule->get_attribute('time_out');
?>
</td>
<td><?php
echo $rule->get_attribute('occurrence');
?>
</td>
<td><?php
echo $rule->get_attribute('from');
?>
</td>
<td><?php
echo $rule->get_attribute('to');
?>
</td>
<td><?php
echo $rule->get_attribute('port_from');
?>
</td>
<td><?php
echo $rule->get_attribute('port_to');
?>
</td>
<td><?php
echo $rule->get_attribute('sensor');
?>
</td>
<td>
<?php
$plugin_id = $rule->get_attribute('plugin_id');
if ($plugin_list = Plugin::get_list($conn, "WHERE id = {$plugin_id}")) {
$name = $plugin_list[0]->get_name();
echo "<a href=\"../conf/pluginsid.php?id={$plugin_id}&" . "name={$name}\">{$name}</a> ({$plugin_id})";
}
?>
</td>
<td>
<?php
$plugin_sid = $rule->get_attribute('plugin_sid');
$plugin_sid_list = split(',', $plugin_sid);
if (count($plugin_sid_list) > 30) {
?>
<a style="cursor:hand;" TITLE="To view or hide the list of plugin sid click here." onclick="Menus('plugsid')"> <?php
echo gettext("Expand / Collapse");
?>
</a>
<div id="plugsid" class="menucache">
<?php
}
foreach ($plugin_sid_list as $sid_negate) {
$sid = $sid_negate;
if (!strncmp($sid_negate, "!", 1)) {
$sid = substr($sid_negate, 1);
}
/* sid == ANY */
if (!strcmp($sid, "ANY")) {
echo gettext("ANY");
} elseif (strpos($sid, "PLUGIN_SID")) {
echo gettext("{$sid}");
} elseif ($plugin_list = Plugin_sid::get_list($conn, "WHERE plugin_id = {$plugin_id} AND sid = {$sid}")) {
$name = $plugin_list[0]->get_name();
echo "<a title=\"{$name}\">{$sid_negate}</a> ";
}
}
if (count($plugin_sid_list) > 30) {
?>
</div>
<?php
}
?>
</td>
</tr>
<?php
if ($level > 1) {
if ($rule->has_child_nodes()) {
$rules = $rule->child_nodes();
foreach ($rules as $rule) {
rule_table($dom, $directive_id, $rule, $level - 1, $ilevel);
}
}
}
$branch++;
}
}
/* foreach */
}
}
示例11: getPluginType
function getPluginType($plugin_id)
{
global $conn;
if ($plugin_id != '') {
$plugins = Plugin::get_list($conn, 'WHERE id = ' . $plugin_id);
if ($plugins[0]->get_type() == '1') {
return 'detector';
} elseif ($plugins[0]->get_type() == '2') {
return 'monitor';
}
return 'other';
} else {
return '';
}
}
示例12: escape_sql
$type = escape_sql($type, $conn);
$pids = Plugin_sid::get_plugins_by_category($conn, $type, $subcategory_id);
$plugin_list = implode(",", $pids);
$plugin_list = $plugin_list != '' ? $plugin_list : "''";
$where .= " AND id in ({$plugin_list})";
break;
}
if (!empty($search)) {
$search = mb_detect_encoding($search . " ", 'UTF-8,ISO-8859-1') == 'UTF-8' ? Util::utf8entities($search) : $search;
$search = escape_sql($search, $conn);
$where .= " AND (name like '%{$search}%' OR id='{$search}' OR description like '%{$search}%') ";
}
/* LIMIT */
$limit = "LIMIT {$from}, {$maxrows}";
$results = array();
if ($plugin_list = Plugin::get_list($conn, "{$where} ORDER BY {$order} {$limit}")) {
$total = $plugin_list[0]->get_foundrows();
if ($total == 0) {
$total = count($plugin_list);
}
foreach ($plugin_list as $plugin) {
$_res = array();
$_id = $plugin->get_id();
$_res[] = $_id;
// DATA SOURCE ID
$_res[] = $plugin->get_name();
// NAME
$type = $plugin->get_type();
if ($type == '1') {
$type = "Detector ({$type})";
} elseif ($type == '2') {
示例13: foreach
foreach ($link_types as $k => $v) {
$selected = $k == $link_type ? "selected='selected'" : "";
echo "<option value='{$k}' {$selected}>{$v}</option>";
}
?>
</select>
</td>
<td valign="top" class="nobborder">
<?php
if ($link_type == "directive") {
?>
<input type="text" name="newlinkname" style='width:99%'/>
<?php
} elseif ($link_type == "plugin_sid") {
$plugins = Plugin::get_list($conn, "ORDER BY name");
echo "<select name='pid' onchange='document.flinks.submit()'>";
foreach ($plugins as $plugin) {
$sel = $plugin->get_id() == $pid ? "selected='selected'" : "";
echo "<option value='" . $plugin->get_id() . "' {$sel}>" . $plugin->get_name();
}
echo "</select><br>";
if ($pid != "" && $pid != "0") {
$sids = Plugin_sid::get_list($conn, "where plugin_id={$pid}");
echo "<select name='newlinkname' style='width:200px; margin-top:5px;'>";
foreach ($sids as $sid) {
echo "<option value='" . $sid->get_sid() . "####{$pid}'>" . $sid->get_name();
}
echo "</select>";
}
} else {
示例14: pclose
}
if (preg_match("/Top \\d+ matching plugins/", $line)) {
$plugins = 1;
}
}
pclose($f);
?>
<br/>
<?php
if (count($plugs) > 0) {
$db = new ossim_db();
$conn = $db->connect();
echo "<form action='detect.php' method='get'><input type='hidden' name='ip' value='{$ip}'><input type='hidden' name='activate' value='1'>\n";
foreach ($plugs as $plg => $perc) {
$plugin_name = str_replace(".cfg", "", $plg);
$rp = Plugin::get_list($conn, "WHERE name='{$plugin_name}'");
# syslog comment
$comment = "";
if (preg_match("/syslog/", $plugin_name)) {
$comment = "<br> <span style='color:gray;font-style:italic'>(*)" . _("This plugin does not categorize the events. It is only recommended for mass gathering events for compliance.") . "</span>";
}
if (isset($rp[0]) && $rp[0]->get_description() != "") {
echo "<input type='radio' name='{$plugin_name}' value='{$plg}'> " . $plugin_name . ": " . $rp[0]->get_description() . " {$comment} <br>\n";
} else {
echo "<input type='radio' name='{$plugin_name}' value='{$plg}'> {$plugin_name} {$comment}<br>\n";
}
}
echo "<br><input type='submit' class='lbutton' value='" . _("Activate selected plugins") . "'><br>\n";
echo "</form>\n";
$db->close($conn);
} else {