2012-12-12 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_ui.php include/javascript/jquery.pandora.controls.js godmode/groups/configure_group.php godmode/groups/group_list.php godmode/alerts/configure_alert_template.php godmode/alerts/alert_templates.php godmode/alerts/configure_alert_action.php godmode/alerts/configure_alert_command.php godmode/alerts/alert_actions.php godmode/alerts/alert_commands.php godmode/users/configure_user.php godmode/modules/manage_network_components_form.php godmode/modules/manage_nc_groups_form.php godmode/modules/manage_network_components_form_common.php godmode/modules/manage_network_components_form_network.php godmode/modules/manage_network_components_form_wmi.php godmode/modules/manage_network_components.php godmode/modules/manage_nc_groups.php godmode/modules/manage_network_components_form_plugin.php: New editors for metaconsole: alerts, components, users and groups. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7272 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
6c48aa56d0
commit
54ec4d03b6
|
@ -1,3 +1,26 @@
|
|||
2012-12-12 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||
|
||||
* include/functions_ui.php
|
||||
include/javascript/jquery.pandora.controls.js
|
||||
godmode/groups/configure_group.php
|
||||
godmode/groups/group_list.php
|
||||
godmode/alerts/configure_alert_template.php
|
||||
godmode/alerts/alert_templates.php
|
||||
godmode/alerts/configure_alert_action.php
|
||||
godmode/alerts/configure_alert_command.php
|
||||
godmode/alerts/alert_actions.php
|
||||
godmode/alerts/alert_commands.php
|
||||
godmode/users/configure_user.php
|
||||
godmode/modules/manage_network_components_form.php
|
||||
godmode/modules/manage_nc_groups_form.php
|
||||
godmode/modules/manage_network_components_form_common.php
|
||||
godmode/modules/manage_network_components_form_network.php
|
||||
godmode/modules/manage_network_components_form_wmi.php
|
||||
godmode/modules/manage_network_components.php
|
||||
godmode/modules/manage_nc_groups.php
|
||||
godmode/modules/manage_network_components_form_plugin.php: New
|
||||
editors for metaconsole: alerts, components, users and groups.
|
||||
|
||||
2012-12-12 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* godmode/reporting/reporting_builder.list_items.php: Fixed the
|
||||
|
|
|
@ -16,9 +16,10 @@
|
|||
// Load global vars
|
||||
global $config;
|
||||
|
||||
require_once ("include/functions_alerts.php");
|
||||
require_once ('include/functions_users.php');
|
||||
require_once ('include/functions_groups.php');
|
||||
require_once ($config['homedir'] . "/include/functions_alerts.php");
|
||||
require_once ($config['homedir'] . '/include/functions_users.php');
|
||||
require_once ($config['homedir'] . '/include/functions_groups.php');
|
||||
enterprise_include_once ('meta/include/functions_alerts_meta.php');
|
||||
|
||||
check_login ();
|
||||
|
||||
|
@ -45,10 +46,24 @@ $update_action = (bool) get_parameter ('update_action');
|
|||
$create_action = (bool) get_parameter ('create_action');
|
||||
$delete_action = (bool) get_parameter ('delete_action');
|
||||
$copy_action = (bool) get_parameter ('copy_action');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if ((!$copy_action) && (!$delete_action) && (!$update_action))
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
if (defined('METACONSOLE')) {
|
||||
$sec = 'advanced';
|
||||
}
|
||||
else {
|
||||
$sec = 'galertas';
|
||||
}
|
||||
|
||||
if ((!$copy_action) && (!$delete_action) && (!$update_action)) {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
}
|
||||
}
|
||||
|
||||
if ($copy_action) {
|
||||
$id = get_parameter ('id');
|
||||
|
@ -66,8 +81,13 @@ if ($copy_action) {
|
|||
exit;
|
||||
}
|
||||
else {
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true);
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
}
|
||||
}
|
||||
} // If user tries to copy an action of others groups
|
||||
else {
|
||||
|
@ -78,9 +98,15 @@ if ($copy_action) {
|
|||
$own_groups = array_keys(users_get_groups($config['id_user'], "LM", false));
|
||||
$is_in_group = in_array($al_action['id_group'], $own_groups);
|
||||
// Then action group have to be in his own groups
|
||||
if ($is_in_group)
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true);
|
||||
if ($is_in_group) {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
|
@ -88,11 +114,15 @@ if ($copy_action) {
|
|||
exit;
|
||||
}
|
||||
}
|
||||
}else
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true);
|
||||
|
||||
|
||||
} else {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
}
|
||||
}
|
||||
$result = alerts_clone_alert_action ($id);
|
||||
|
||||
if ($result) {
|
||||
|
@ -133,8 +163,8 @@ if ($create_action) {
|
|||
$values);
|
||||
|
||||
$info = 'Name: ' . $name . ' ID alert Command: ' . $id_alert_command .
|
||||
$info_fields . ' Group: ' . $group .
|
||||
' Action threshold: ' . $action_threshold;
|
||||
$info_fields . ' Group: ' . $values['id_group'] .
|
||||
' Action threshold: ' . $values['action_threshold'];
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
|
@ -162,13 +192,25 @@ if ($update_action) {
|
|||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true);
|
||||
else {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true);
|
||||
} else {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$name = (string) get_parameter ('name');
|
||||
|
@ -227,9 +269,15 @@ if ($delete_action) {
|
|||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true);
|
||||
else {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
}
|
||||
}
|
||||
// If user tries to delete an action of others groups
|
||||
}
|
||||
else {
|
||||
|
@ -240,9 +288,15 @@ if ($delete_action) {
|
|||
$own_groups = array_keys(users_get_groups($config['id_user'], "LM", false));
|
||||
$is_in_group = in_array($al_action['id_group'], $own_groups);
|
||||
// Then action group have to be in his own groups
|
||||
if ($is_in_group)
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true);
|
||||
if ($is_in_group) {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "alert_action", true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
|
@ -304,13 +358,13 @@ foreach ($actions as $action) {
|
|||
|
||||
$data = array ();
|
||||
|
||||
$data[0] = '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'">'.
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'&pure='.$pure.'">'.
|
||||
$action['name'].'</a>';
|
||||
$data[1] = ui_print_group_icon ($action["id_group"], true) .' ';
|
||||
$data[2] = '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_actions&copy_action=1&id='.$action['id'].'"
|
||||
$data[2] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&copy_action=1&id='.$action['id'].'&pure='.$pure.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
|
||||
html_print_image("images/copy.png", true) . '</a>';
|
||||
$data[3] = '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_actions&delete_action=1&id='.$action['id'].'"
|
||||
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&delete_action=1&id='.$action['id'].'&pure='.$pure.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.
|
||||
html_print_image("images/cross.png", true) . '</a>';
|
||||
|
||||
|
@ -324,7 +378,7 @@ else {
|
|||
}
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
html_print_submit_button (__('Create'), 'create', false, 'class="sub next"');
|
||||
html_print_input_hidden ('create_alert', 1);
|
||||
echo '</form>';
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
// Load global vars
|
||||
global $config;
|
||||
|
||||
require_once ("include/functions_alerts.php");
|
||||
require_once ($config['homedir'] . "/include/functions_alerts.php");
|
||||
enterprise_include_once ('meta/include/functions_alerts_meta.php');
|
||||
|
||||
check_login ();
|
||||
|
||||
|
@ -28,6 +29,13 @@ if (! check_acl ($config['id_user'], 0, "LM")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
if (defined('METACONSOLE'))
|
||||
$sec = 'advanced';
|
||||
else
|
||||
$sec = 'galertas';
|
||||
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if (is_ajax ()) {
|
||||
$get_alert_command = (bool) get_parameter ('get_alert_command');
|
||||
if ($get_alert_command) {
|
||||
|
@ -94,7 +102,10 @@ if (is_ajax ()) {
|
|||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert commands'), "images/god2.png", false, "alert_command", true);
|
||||
if (defined('METACONSOLE'))
|
||||
alerts_meta_print_header();
|
||||
else
|
||||
ui_print_page_header (__('Alerts').' » '.__('Alert commands'), "images/god2.png", false, "alert_command", true);
|
||||
|
||||
$update_command = (bool) get_parameter ('update_command');
|
||||
$create_command = (bool) get_parameter ('create_command');
|
||||
|
@ -104,7 +115,7 @@ if ($create_command) {
|
|||
$name = (string) get_parameter ('name');
|
||||
$command = (string) get_parameter ('command');
|
||||
$description = (string) get_parameter ('description');
|
||||
|
||||
|
||||
$fields_descriptions = array();
|
||||
$fields_values = array();
|
||||
$info_fields = '';
|
||||
|
@ -112,7 +123,7 @@ if ($create_command) {
|
|||
for($i=1;$i<=10;$i++) {
|
||||
$fields_descriptions[] = (string) get_parameter ('field'.$i.'_description');
|
||||
$fields_values[] = (string) get_parameter ('field'.$i.'_values');
|
||||
$info_fields .= ' Field'.$i.': ' . $values['field'.$i];
|
||||
$info_fields .= ' Field'.$i.': ' . $fields_values[$i - 1];
|
||||
}
|
||||
|
||||
$values['fields_values'] = json_encode($fields_values);
|
||||
|
@ -163,7 +174,7 @@ if ($update_command) {
|
|||
for($i=1;$i<=10;$i++) {
|
||||
$fields_descriptions[] = (string) get_parameter ('field'.$i.'_description');
|
||||
$fields_values[] = (string) get_parameter ('field'.$i.'_values');
|
||||
$info_fields .= ' Field'.$i.': ' . $values['field'.$i];
|
||||
$info_fields .= ' Field'.$i.': ' . $fields_values[$i - 1];
|
||||
}
|
||||
|
||||
$values['fields_values'] = json_encode($fields_values);
|
||||
|
@ -243,7 +254,7 @@ foreach ($commands as $command) {
|
|||
|
||||
$data[0] = '<span style="font-size: 7.5pt">';
|
||||
if (! $command['internal'])
|
||||
$data[0] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_command&id='.$command['id'].'">'.
|
||||
$data[0] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&id='.$command['id'].'&pure='.$pure.'">'.
|
||||
$command['name'].'</a>';
|
||||
else
|
||||
$data[0] .= $command['name'];
|
||||
|
@ -252,7 +263,7 @@ foreach ($commands as $command) {
|
|||
$data[2] = str_replace("\r\n","<br>",io_safe_output($command['description']));
|
||||
$data[3] = '';
|
||||
if (! $command['internal'])
|
||||
$data[3] = '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'"
|
||||
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.
|
||||
html_print_image("images/cross.png", true) . '</a>';
|
||||
|
||||
|
@ -267,7 +278,7 @@ else {
|
|||
}
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_command">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
||||
html_print_submit_button (__('Create'), 'create', false, 'class="sub next"');
|
||||
html_print_input_hidden ('create_alert', 1);
|
||||
echo '</form>';
|
||||
|
|
|
@ -16,9 +16,10 @@
|
|||
// Load global vars
|
||||
global $config;
|
||||
|
||||
require_once ('include/functions_alerts.php');
|
||||
require_once ('include/functions_users.php');
|
||||
require_once ('include/functions_groups.php');
|
||||
require_once ($config['homedir'] . '/include/functions_alerts.php');
|
||||
require_once ($config['homedir'] . '/include/functions_users.php');
|
||||
require_once ($config['homedir'] . '/include/functions_groups.php');
|
||||
enterprise_include_once ('meta/include/functions_alerts_meta.php');
|
||||
|
||||
check_login ();
|
||||
|
||||
|
@ -110,12 +111,25 @@ if (! check_acl ($config['id_user'], 0, "LM")) {
|
|||
|
||||
$update_template = (bool) get_parameter ('update_template');
|
||||
$delete_template = (bool) get_parameter ('delete_template');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$sec = 'advanced';
|
||||
}
|
||||
else {
|
||||
$sec = 'galertas';
|
||||
}
|
||||
|
||||
// This prevents to duplicate the header in case delete_templete action is performed
|
||||
if (!$delete_template)
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "alert_template", true);
|
||||
|
||||
if (!$delete_template) {
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "alert_template", true);
|
||||
}
|
||||
}
|
||||
if ($update_template) {
|
||||
$id = (int) get_parameter ('id');
|
||||
|
||||
|
@ -148,10 +162,14 @@ if ($delete_template) {
|
|||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true);
|
||||
|
||||
else {
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "alert_template", true);
|
||||
}
|
||||
}
|
||||
} // If user tries to delete a template of others groups
|
||||
else {
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
|
@ -161,9 +179,14 @@ if ($delete_template) {
|
|||
$own_groups = array_keys(users_get_groups($config['id_user'], "LM", false));
|
||||
$is_in_group = in_array($al_template['id_group'], $own_groups);
|
||||
// Then template group have to be is his own groups
|
||||
if ($is_in_group)
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true);
|
||||
if ($is_in_group) {
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "alert_template", true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
|
@ -173,8 +196,12 @@ if ($delete_template) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true);
|
||||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header ();
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "alert_template", true);
|
||||
}
|
||||
}
|
||||
|
||||
$result = alerts_delete_alert_template ($id);
|
||||
|
@ -262,13 +289,13 @@ foreach ($templates as $template) {
|
|||
|
||||
$data = array ();
|
||||
|
||||
$data[0] = '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&id='.$template['id'].'">'.
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&id='.$template['id'].'&pure='.$pure.'">'.
|
||||
$template['name'].'</a>';
|
||||
|
||||
$data[1] = ui_print_group_icon ($template["id_group"], true);
|
||||
$data[3] = alerts_get_alert_templates_type_name ($template['type']);
|
||||
|
||||
$data[4] = '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template" style="display: inline; float: left">';
|
||||
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" style="display: inline; float: left">';
|
||||
$data[4] .= html_print_input_hidden ('duplicate_template', 1, true);
|
||||
$data[4] .= html_print_input_hidden ('source_id', $template['id'], true);
|
||||
$data[4] .= html_print_input_image ('dup', 'images/copy.png', 1, '', true, array ('title' => __('Duplicate')));
|
||||
|
@ -291,7 +318,7 @@ else {
|
|||
echo "<div class='nf'>".__('No alert templates defined')."</div>";
|
||||
}
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
||||
html_print_submit_button (__('Create'), 'create', false, 'class="sub next"');
|
||||
html_print_input_hidden ('create_alert', 1);
|
||||
echo '</form>';
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
// Load global vars
|
||||
global $config;
|
||||
|
||||
require_once ('include/functions_alerts.php');
|
||||
require_once ('include/functions_users.php');
|
||||
require_once ($config['homedir'] . '/include/functions_alerts.php');
|
||||
require_once ($config['homedir'] . '/include/functions_users.php');
|
||||
enterprise_include_once ('meta/include/functions_alerts_meta.php');
|
||||
|
||||
check_login ();
|
||||
|
||||
|
@ -31,6 +32,12 @@ if (! check_acl ($config['id_user'], 0, "LM")) {
|
|||
$id = (int) get_parameter ('id');
|
||||
|
||||
$al_action = alerts_get_alert_action ($id);
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if (defined('METACONSOLE'))
|
||||
$sec = 'advanced';
|
||||
else
|
||||
$sec = 'galertas';
|
||||
|
||||
if ($al_action !== false){
|
||||
// If user tries to edit an action with group=ALL
|
||||
|
@ -42,9 +49,13 @@ if ($al_action !== false){
|
|||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else {
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert action'), "images/god2.png", false, "", true);
|
||||
if (defined('METACONSOLE'))
|
||||
alerts_meta_print_header();
|
||||
else
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert action'), "images/god2.png", false, "", true);
|
||||
}
|
||||
} // If user tries to edit an action of others groups
|
||||
else {
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
|
@ -54,9 +65,13 @@ if ($al_action !== false){
|
|||
$own_groups = array_keys(users_get_groups($config['id_user'], "LM", false));
|
||||
$is_in_group = in_array($al_action['id_group'], $own_groups);
|
||||
// Then action group have to be in his own groups
|
||||
if ($is_in_group)
|
||||
if ($is_in_group) {
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert action'), "images/god2.png", false, "", true);
|
||||
if (defined('METACONSOLE'))
|
||||
alerts_meta_print_header();
|
||||
else
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert action'), "images/god2.png", false, "", true);
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
|
@ -65,9 +80,13 @@ if ($al_action !== false){
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert action'), "images/god2.png", false, "", true);
|
||||
if (defined('METACONSOLE'))
|
||||
alerts_meta_print_header();
|
||||
else
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert action'), "images/god2.png", false, "", true);
|
||||
}
|
||||
|
||||
$name = '';
|
||||
$id_command = '';
|
||||
|
@ -109,14 +128,14 @@ $table->data[2][1] = html_print_select_from_sql ('SELECT id, name FROM talert_co
|
|||
$table->data[2][1] .= ' ';
|
||||
if (check_acl ($config['id_user'], 0, "PM")){
|
||||
$table->data[2][1] .= html_print_image ('images/add.png', true);
|
||||
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_command">';
|
||||
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
||||
$table->data[2][1] .= __('Create Command');
|
||||
$table->data[2][1] .= '</a>';
|
||||
}
|
||||
$table->data[2][1] .= '<div id="command_description" style=""></div>';
|
||||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_input_text ('action_threshold', $action_threshold, '', 5, 7, true);
|
||||
$table->data[3][1] .= ' '.__('seconds') . ui_print_help_icon ('action_threshold', true);
|
||||
$table->data[3][1] .= ' '.__('seconds') . ui_print_help_icon ('action_threshold', true, ui_get_full_url(false, false, false, false));
|
||||
$table->data[4][0] = __('Command preview');
|
||||
$table->data[4][1] = html_print_textarea ('command_preview', 10, 30, '', 'disabled="disabled"', true);
|
||||
$row = 5;
|
||||
|
@ -127,7 +146,7 @@ for($i=1;$i<=10;$i++) {
|
|||
$table->data['field'.$i][1] .= html_print_input_hidden('field'.$i.'_value', isset($action['field'.$i]) ? $action['field'.$i] : '', true);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_actions">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'">';
|
||||
html_print_table ($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
@ -172,7 +191,7 @@ $(document).ready (function () {
|
|||
value: "1"});
|
||||
values.push ({name: "id",
|
||||
value: this.value});
|
||||
jQuery.get ("ajax.php",
|
||||
jQuery.get (<?php echo "'" . ui_get_full_url(false, false, false, false) . "'"; ?> + "ajax.php",
|
||||
values,
|
||||
function (data, status) {
|
||||
original_command = js_html_entity_decode (data["command"]);
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
|
||||
// Load global vars
|
||||
global $config;
|
||||
require_once ("include/functions_alerts.php");
|
||||
require_once ($config['homedir'] . "/include/functions_alerts.php");
|
||||
enterprise_include_once ('meta/include/functions_alerts_meta.php');
|
||||
|
||||
check_login ();
|
||||
|
||||
|
@ -27,6 +28,7 @@ if (! check_acl ($config['id_user'], 0, "LM")) {
|
|||
}
|
||||
|
||||
$id = (int) get_parameter ('id');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
$name = '';
|
||||
$command = '';
|
||||
|
@ -52,8 +54,11 @@ if(!empty($fields_values)) {
|
|||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts') . ' » ' .
|
||||
__('Configure alert command'), "images/god2.png", false, "", true);
|
||||
if (defined('METACONSOLE'))
|
||||
alerts_meta_print_header();
|
||||
else
|
||||
ui_print_page_header (__('Alerts') . ' » ' .
|
||||
__('Configure alert command'), "images/god2.png", false, "", true);
|
||||
|
||||
$table->width = '98%';
|
||||
$table->style = array ();
|
||||
|
@ -69,7 +74,7 @@ $table->data[0][2] = html_print_input_text ('name', $name, '', 35, 255, true);
|
|||
|
||||
$table->colspan[1][1] = 3;
|
||||
$table->data[1][0] = __('Command');
|
||||
$table->data[1][0] .= ui_print_help_icon ('alert_macros', true);
|
||||
$table->data[1][0] .= ui_print_help_icon ('alert_macros', true, ui_get_full_url(false, false, false, false));
|
||||
$table->data[1][1] = html_print_input_text ('command', $command, '', 80, 255, true);
|
||||
|
||||
$table->colspan[2][1] = 3;
|
||||
|
@ -82,7 +87,7 @@ for($i=1;$i<=10;$i++) {
|
|||
|
||||
// Only show help on first row
|
||||
if($i == 1) {
|
||||
$table->data['field'.$i][0] .= ui_print_help_icon ('alert_fields_description', true);
|
||||
$table->data['field'.$i][0] .= ui_print_help_icon ('alert_fields_description', true, ui_get_full_url(false, false, false, false));
|
||||
}
|
||||
|
||||
if(!empty($fields_descriptions)) {
|
||||
|
@ -97,7 +102,7 @@ for($i=1;$i<=10;$i++) {
|
|||
|
||||
// Only show help on first row
|
||||
if($i == 1) {
|
||||
$table->data['field'.$i][2] .= ui_print_help_icon ('alert_fields_values', true);
|
||||
$table->data['field'.$i][2] .= ui_print_help_icon ('alert_fields_values', true, ui_get_full_url(false, false, false, false));
|
||||
}
|
||||
|
||||
if(!empty($fields_values)) {
|
||||
|
@ -109,7 +114,7 @@ for($i=1;$i<=10;$i++) {
|
|||
$table->data['field'.$i][3] = html_print_input_text ('field'.$i.'_values', $field_values, '', 65, 255, true);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_commands">';
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_commands&pure='.$pure.'">';
|
||||
html_print_table ($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
|
|
@ -15,8 +15,9 @@
|
|||
|
||||
// Load global vars
|
||||
global $config;
|
||||
require_once ('include/functions_alerts.php');
|
||||
require_once ('include/functions_users.php');
|
||||
require_once ($config['homedir'] . '/include/functions_alerts.php');
|
||||
require_once ($config['homedir'] . '/include/functions_users.php');
|
||||
enterprise_include_once ('meta/include/functions_alerts_meta.php');
|
||||
|
||||
check_login ();
|
||||
|
||||
|
@ -30,6 +31,7 @@ if (! check_acl ($config['id_user'], 0, "LM")) {
|
|||
|
||||
$duplicate_template = (bool) get_parameter ('duplicate_template');
|
||||
$id = (int) get_parameter ('id');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
// If user tries to duplicate/edit a template with group=ALL then must have "PM" access privileges
|
||||
if ($duplicate_template) {
|
||||
|
@ -40,6 +42,15 @@ else {
|
|||
$a_template = alerts_get_alert_template($id);
|
||||
}
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
$sec = 'advanced';
|
||||
}
|
||||
else {
|
||||
|
||||
$sec = 'galertas';
|
||||
}
|
||||
|
||||
if ($a_template !== false) {
|
||||
// If user tries to duplicate/edit a template with group=ALL
|
||||
if ($a_template['id_group'] == 0){
|
||||
|
@ -50,9 +61,19 @@ if ($a_template !== false) {
|
|||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else {
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert template'), "", false, "", true);
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
alerts_meta_print_header();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert template'), "", false, "", true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} // If user tries to duplicate/edit a template of others groups
|
||||
else {
|
||||
|
@ -63,9 +84,19 @@ if ($a_template !== false) {
|
|||
$own_groups = array_keys(users_get_groups($config['id_user'], "LM", false));
|
||||
$is_in_group = in_array($a_template['id_group'], $own_groups);
|
||||
// Then template group have to be in his own groups
|
||||
if ($is_in_group)
|
||||
if ($is_in_group) {
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert template'), "", false, "", true);
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
alerts_meta_print_header();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert template'), "", false, "", true);
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
db_pandora_audit("ACL Violation",
|
||||
"Trying to access Alert Management");
|
||||
|
@ -74,9 +105,19 @@ if ($a_template !== false) {
|
|||
}
|
||||
}
|
||||
// This prevents to duplicate the header in case duplicate/edit_template action is performed
|
||||
} else
|
||||
} else {
|
||||
// Header
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert template'), "", false, "", true);
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
alerts_meta_print_header();
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert template'), "", false, "", true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($duplicate_template) {
|
||||
|
@ -100,6 +141,17 @@ if ($duplicate_template) {
|
|||
function print_alert_template_steps ($step, $id) {
|
||||
echo '<ol class="steps">';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
$sec = 'advanced';
|
||||
}
|
||||
else {
|
||||
|
||||
$sec = 'galertas';
|
||||
}
|
||||
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
/* Step 1 */
|
||||
if ($step == 1)
|
||||
echo '<li class="first current">';
|
||||
|
@ -109,7 +161,7 @@ function print_alert_template_steps ($step, $id) {
|
|||
echo '<li class="first">';
|
||||
|
||||
if ($id) {
|
||||
echo '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&id='.$id.'">';
|
||||
echo '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&id='.$id.'&pure='.$pure.'">';
|
||||
echo __('Step').' 1 » ';
|
||||
echo '<span>'.__('Conditions').'</span>';
|
||||
echo '</a>';
|
||||
|
@ -129,7 +181,7 @@ function print_alert_template_steps ($step, $id) {
|
|||
echo '<li>';
|
||||
|
||||
if ($id) {
|
||||
echo '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&id='.$id.'&step=2">';
|
||||
echo '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&id='.$id.'&step=2&pure='.$pure.'">';
|
||||
echo __('Step').' 2 » ';
|
||||
echo '<span>'.__('Firing').'</span>';
|
||||
echo '</a>';
|
||||
|
@ -149,7 +201,7 @@ function print_alert_template_steps ($step, $id) {
|
|||
echo '<li class="last">';
|
||||
|
||||
if ($id) {
|
||||
echo '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&id='.$id.'&step=3">';
|
||||
echo '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&id='.$id.'&step=3&pure='.$pure.'">';
|
||||
echo __('Step').' 3 » ';
|
||||
echo '<span>'.__('Recovery').'</span>';
|
||||
echo '</a>';
|
||||
|
@ -170,6 +222,15 @@ function update_template ($step) {
|
|||
|
||||
if (empty ($id))
|
||||
return false;
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
$sec = 'advanced';
|
||||
}
|
||||
else {
|
||||
|
||||
$sec = 'galertas';
|
||||
}
|
||||
|
||||
if ($step == 1) {
|
||||
$name = (string) get_parameter ('name');
|
||||
|
@ -229,9 +290,6 @@ function update_template ($step) {
|
|||
'special_day' => $special_day,
|
||||
'time_threshold' => $threshold,
|
||||
'id_alert_action' => $default_action,
|
||||
'field1' => $field1,
|
||||
'field2' => $field2,
|
||||
'field3' => $field3,
|
||||
'max_alerts' => $max_alerts,
|
||||
'min_alerts' => $min_alerts
|
||||
);
|
||||
|
@ -319,6 +377,7 @@ $field2_recovery = '';
|
|||
$field3_recovery = '';
|
||||
$matches = true;
|
||||
$id_group = 0;
|
||||
$wizard_level = -1;
|
||||
|
||||
if ($create_template) {
|
||||
$name = (string) get_parameter ('name');
|
||||
|
@ -491,8 +550,8 @@ if ($step == 2) {
|
|||
$table->colspan['field'.$i][1] = 3;
|
||||
$table->rowclass['field'.$i] = 'row_field';
|
||||
|
||||
$table->data['field'.$i][0] = sprintf(__('Field %s'), $i) . ui_print_help_icon ('alert_macros', true);
|
||||
$table->data['field'.$i][1] = html_print_textarea ('field'.$i, 1, 1, isset($fields[$i]) ? $fields[$i] : '', 'style="min-height:40px" class="fields"', true);
|
||||
$table->data['field'.$i][0] = sprintf(__('Field %s'), $i) . ui_print_help_icon ('alert_macros', true, ui_get_full_url(false, false, false, false));
|
||||
$table->data['field'.$i][1] = html_print_textarea ('field'.$i, 1, 1, isset($fields[$i]) ? $fields[$i] : '', 'style="min-height:40px;" class="fields"', true);
|
||||
}
|
||||
|
||||
$table->data[4][0] = __('Default action');
|
||||
|
@ -632,7 +691,7 @@ else {
|
|||
|
||||
/* If it's the last step it will redirect to template lists */
|
||||
if ($step >= LAST_STEP) {
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_templates">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_templates&pure='.$pure.'">';
|
||||
}
|
||||
else {
|
||||
echo '<form method="post">';
|
||||
|
@ -664,19 +723,19 @@ ui_require_jquery_file ("ui-timepicker-addon");
|
|||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
var matches = "<?php echo __('The alert would fire when the value matches <span id=\"value\"></span>');?>";
|
||||
var matches_not = "<?php echo __('The alert would fire when the value doesn\'t match <span id=\"value\"></span>');?>";
|
||||
var is = "<?php echo __('The alert would fire when the value is <span id=\"value\"></span>');?>";
|
||||
var is_not = "<?php echo __('The alert would fire when the value is not <span id=\"value\"></span>');?>";
|
||||
var between = "<?php echo __('The alert would fire when the value is between <span id=\"min\"></span> and <span id=\"max\"></span>');?>";
|
||||
var between_not = "<?php echo __('The alert would fire when the value is not between <span id=\"min\"></span> and <span id=\"max\"></span>');?>";
|
||||
var under = "<?php echo __('The alert would fire when the value is below <span id=\"min\"></span>');?>";
|
||||
var over = "<?php echo __('The alert would fire when the value is above <span id=\"max\"></span>');?>";
|
||||
var warning = "<?php echo __('The alert would fire when the module is in warning status');?>";
|
||||
var critical = "<?php echo __('The alert would fire when the module is in critical status');?>";
|
||||
var onchange = "<?php echo __('The alert would fire when the module value changes');?>";
|
||||
var onchange_not = "<?php echo __('The alert would fire when the module value does not change');?>";
|
||||
var unknown = "<?php echo __('The alert would fire when the module is in unknown status');?>";
|
||||
var matches = <?php echo "'" . __("The alert would fire when the value matches <span id=\"value\"></span>") . "'";?>;
|
||||
var matches_not = <?php echo "'" . __("The alert would fire when the value doesn\'t match <span id=\"value\"></span>") . "'";?>;
|
||||
var is = <?php echo "'" . __("The alert would fire when the value is <span id=\"value\"></span>") . "'";?>;
|
||||
var is_not = <?php echo "'" . __("The alert would fire when the value is not <span id=\"value\"></span>") . "'";?>;
|
||||
var between = <?php echo "'" . __("The alert would fire when the value is between <span id=\"min\"></span> and <span id=\"max\"></span>") . "'";?>;
|
||||
var between_not = <?php echo "'" . __("The alert would fire when the value is not between <span id=\"min\"></span> and <span id=\"max\"></span>") . "'";?>;
|
||||
var under = <?php echo "'" . __("The alert would fire when the value is below <span id=\"min\"></span>") . "'";?>;
|
||||
var over = <?php echo "'" . __("The alert would fire when the value is above <span id=\"max\"></span>") . "'";?>;
|
||||
var warning = <?php echo "'" . __("The alert would fire when the module is in warning status") . "'";?>;
|
||||
var critical = <?php echo "'" . __("The alert would fire when the module is in critical status") . "'";?>;
|
||||
var onchange_msg = <?php echo "'" . __("The alert would fire when the module value changes") . "'";?>;
|
||||
var onchange_not = <?php echo "'" . __("The alert would fire when the module value does not change") . "'";?>;
|
||||
var unknown = <?php echo "'" . __("The alert would fire when the module is in unknown status") . "'";?>;
|
||||
|
||||
function check_regex () {
|
||||
if ($("#type").attr ('value') != 'regex') {
|
||||
|
@ -724,11 +783,23 @@ function render_example () {
|
|||
}
|
||||
}
|
||||
|
||||
// Fix for metaconsole toggle
|
||||
$('.row_field').css("display", "none");
|
||||
var hided = true;
|
||||
|
||||
function toggle_fields() {
|
||||
$('.row_field').toggle();
|
||||
if (hided) {
|
||||
$('.row_field').css("display", "");
|
||||
hided = false;
|
||||
}
|
||||
else {
|
||||
$('.row_field').css("display", "none");
|
||||
hided = true;
|
||||
}
|
||||
}
|
||||
|
||||
toggle_fields();
|
||||
//toggle_fields();
|
||||
|
||||
$(document).ready (function () {
|
||||
<?php
|
||||
|
@ -810,7 +881,7 @@ if ($step == 1) {
|
|||
|
||||
/* Show example */
|
||||
if ($("#checkbox-matches_value")[0].checked)
|
||||
$("span#example").empty ().append (onchange);
|
||||
$("span#example").empty ().append (onchange_msg);
|
||||
else
|
||||
$("span#example").empty ().append (onchange_not);
|
||||
break;
|
||||
|
@ -850,7 +921,7 @@ if ($step == 1) {
|
|||
}
|
||||
else if (type == "onchange") {
|
||||
if (enabled) {
|
||||
$("span#example").empty ().append (onchange);
|
||||
$("span#example").empty ().append (onchange_msg);
|
||||
}
|
||||
else {
|
||||
$("span#example").empty ().append (onchange_not);
|
||||
|
|
|
@ -26,6 +26,7 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
|
||||
include_once($config['homedir'] . "/include/functions_groups.php");
|
||||
include_once($config['homedir'] . '/include/functions_users.php');
|
||||
enterprise_include_once ('meta/include/functions_users_meta.php');
|
||||
|
||||
// Init vars
|
||||
$icon = "";
|
||||
|
@ -37,6 +38,7 @@ $propagate = 0;
|
|||
$skin = 0;
|
||||
$contact = "";
|
||||
$other = "";
|
||||
$description = "";
|
||||
|
||||
$create_group = (bool) get_parameter ('create_group');
|
||||
$id_group = (int) get_parameter ('id_group');
|
||||
|
@ -70,11 +72,21 @@ if ($id_group) {
|
|||
}
|
||||
|
||||
// Header
|
||||
if ($id_group) {
|
||||
ui_print_page_header (__("Update group"), "images/god1.png", false, "", true, "");
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
user_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__("Create group"), "images/god1.png", false, "", true, "");
|
||||
if ($id_group)
|
||||
$title_in_header = __("Update group");
|
||||
else
|
||||
$title_in_header = __("Create group");
|
||||
|
||||
ui_print_page_header ($title_in_header, "images/god1.png", false, "", true, "");
|
||||
$sec = 'gagente';
|
||||
|
||||
}
|
||||
|
||||
$table->width = '98%';
|
||||
|
|
|
@ -19,9 +19,10 @@ global $config;
|
|||
|
||||
check_login();
|
||||
|
||||
require_once("include/functions_groups.php");
|
||||
require_once($config['homedir'] . "/include/functions_groups.php");
|
||||
require_once($config['homedir'] . "/include/functions_agents.php");
|
||||
require_once($config['homedir'] . '/include/functions_users.php');
|
||||
enterprise_include_once ('meta/include/functions_users_meta.php');
|
||||
|
||||
if (is_ajax ()) {
|
||||
if (! check_acl($config['id_user'], 0, "AR")) {
|
||||
|
@ -133,11 +134,23 @@ if (! check_acl($config['id_user'], 0, "PM")) {
|
|||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__("Groups defined in Pandora"), "images/god1.png", false, "", true, "");
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
user_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
ui_print_page_header (__("Groups defined in Pandora"), "images/god1.png", false, "", true, "");
|
||||
$sec = 'gagente';
|
||||
|
||||
}
|
||||
|
||||
$create_group = (bool) get_parameter ('create_group');
|
||||
$update_group = (bool) get_parameter ('update_group');
|
||||
$delete_group = (bool) get_parameter ('delete_group');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
/* Create group */
|
||||
if ($create_group) {
|
||||
|
@ -363,10 +376,10 @@ if (!empty($groups)) {
|
|||
$data[5] = '';
|
||||
}
|
||||
else {
|
||||
$data[5] = '<a href="index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'].'">' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0'));
|
||||
$data[5] = '<a href="index.php?sec='.$sec.'&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'].'&pure='.$pure.'">' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0'));
|
||||
//Check if there is only a group to unable delete it
|
||||
if ((count($groups) > 3) || (count($groups) <= 3 && $group['parent'] != 0)) {
|
||||
$data[5] .= ' <a href="index.php?sec=gagente&sec2=godmode/groups/group_list&id_group='.$id_group.'&delete_group=1" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "border" => '0'));
|
||||
$data[5] .= ' <a href="index.php?sec='.$sec.'&sec2=godmode/groups/group_list&id_group='.$id_group.'&delete_group=1&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "border" => '0'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -380,7 +393,7 @@ else {
|
|||
echo "<div class='nf'>".__('There are no defined groups')."</div>";
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/groups/configure_group">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/configure_group&pure='.$pure.'">';
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button (__('Create group'), 'crt', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
|
|
|
@ -25,11 +25,18 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
return;
|
||||
}
|
||||
|
||||
enterprise_include_once ('meta/include/functions_components_meta.php');
|
||||
require_once ($config['homedir'] . '/include/functions_network_components.php');
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('Module management').' » '. __('Component group management'), "", false, "component_groups", true);
|
||||
|
||||
|
||||
require_once ('include/functions_network_components.php');
|
||||
if (defined('METACONSOLE')) {
|
||||
components_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Module management').' » '. __('Component group management'), "", false, "component_groups", true);
|
||||
$sec = 'gmodules';
|
||||
}
|
||||
|
||||
$create = (bool) get_parameter ('create');
|
||||
$update = (bool) get_parameter ('update');
|
||||
|
@ -37,6 +44,7 @@ $delete = (bool) get_parameter ('delete');
|
|||
$new = (bool) get_parameter ('new');
|
||||
$id = (int) get_parameter ('id');
|
||||
$multiple_delete = (bool)get_parameter('multiple_delete', 0);
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if ($create) {
|
||||
$name = (string) get_parameter ('name');
|
||||
|
@ -193,12 +201,12 @@ ui_pagination ($total_groups, $url);
|
|||
foreach ($groups as $group) {
|
||||
$data = array ();
|
||||
|
||||
$data[0] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&id='.$group['id_sg'].'">'.$group['name'].'</a>';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_nc_groups&id='.$group['id_sg'].'">'.$group['name'].'</a>';
|
||||
|
||||
$data[1] = network_components_get_group_name ($group['parent']);
|
||||
|
||||
$data[2] = "<a onclick='if(confirm(\"" . __('Are you sure?') . "\")) return true; else return false;'
|
||||
href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&delete=1&id=".$group['id_sg']."&offset=0'>" .
|
||||
href='index.php?sec=".$sec."&sec2=godmode/modules/manage_nc_groups&delete=1&id=".$group['id_sg']."&offset=0'>" .
|
||||
html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "</a>" .
|
||||
html_print_checkbox_extended ('delete_multiple[]', $group['id_sg'], false, false, '', 'class="check_delete"', true);
|
||||
|
||||
|
@ -206,7 +214,7 @@ foreach ($groups as $group) {
|
|||
}
|
||||
|
||||
if(isset($data)) {
|
||||
echo "<form method='post' action='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups'>";
|
||||
echo "<form method='post' action='index.php?sec=".$sec."&sec2=godmode/modules/manage_nc_groups'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table ($table);
|
||||
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
|
||||
|
|
|
@ -25,10 +25,15 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
require_once ('include/functions_network_components.php');
|
||||
require_once ($config['homedir'] . '/include/functions_network_components.php');
|
||||
|
||||
$id = (int) get_parameter ('id');
|
||||
|
||||
if (defined('METACONSOLE'))
|
||||
$sec = 'advanced';
|
||||
else
|
||||
$sec = 'gmodules';
|
||||
|
||||
if ($id) {
|
||||
$group = network_components_get_group ($id);
|
||||
$name = $group['name'];
|
||||
|
@ -51,7 +56,7 @@ $table->data[1][0] = __('Parent');
|
|||
$table->data[1][1] = html_print_select (network_components_get_groups (),
|
||||
'parent', $parent, false, __('None'), 0, true, false, false);
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_nc_groups">';
|
||||
html_print_table ($table);
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
if ($id) {
|
||||
|
|
|
@ -25,11 +25,19 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('Module management').' » '.__('Network component management'), "", false, "network_component", true);
|
||||
require_once ($config['homedir'] . '/include/functions_network_components.php');
|
||||
include_once($config['homedir'] . "/include/functions_categories.php");
|
||||
enterprise_include_once ('meta/include/functions_components_meta.php');
|
||||
|
||||
require_once ('include/functions_network_components.php');
|
||||
include_once("include/functions_categories.php");
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
components_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
}
|
||||
else {
|
||||
ui_print_page_header (__('Module management').' » '.__('Network component management'), "", false, "network_component", true);
|
||||
$sec = 'gmodules';
|
||||
}
|
||||
|
||||
$type = (int) get_parameter ('type');
|
||||
$name = (string) get_parameter ('name');
|
||||
|
@ -84,6 +92,7 @@ $critical_inverse = (int) get_parameter('critical_inverse');
|
|||
$warning_inverse = (int) get_parameter('warning_inverse');
|
||||
$id_category = (int) get_parameter('id_category');
|
||||
$id_tag_selected = (array) get_parameter('id_tag_selected');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if(count($id_tag_selected) == 1 && empty($id_tag_selected[0])) {
|
||||
$tags = '';
|
||||
|
@ -338,7 +347,7 @@ if ($multiple_delete) {
|
|||
}
|
||||
|
||||
if ($id || $new_component || $create_network_from_module) {
|
||||
include_once ('godmode/modules/manage_network_components_form.php');
|
||||
include_once ($config['homedir'] . '/godmode/modules/manage_network_components_form.php');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -453,7 +462,7 @@ foreach ($components as $component) {
|
|||
$component['max'] = $component['min'] = __('N/A');
|
||||
}
|
||||
|
||||
$data[0] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'">';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&pure='.$pure.'">';
|
||||
$data[0] .= io_safe_output($component['name']);
|
||||
$data[0] .= '</a>';
|
||||
$data[1] = ui_print_moduletype_icon ($component['type'], true);
|
||||
|
@ -474,7 +483,7 @@ foreach ($components as $component) {
|
|||
}
|
||||
|
||||
if (isset($data)) {
|
||||
echo "<form method='post' action='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&search_id_group=0search_string='>";
|
||||
echo "<form method='post' action='index.php?sec=".$sec."&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure=".$pure."'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table ($table);
|
||||
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
|
||||
|
|
|
@ -26,6 +26,7 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
}
|
||||
|
||||
$create_network_from_module = get_parameter('create_network_from_module');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if ($create_network_from_module) {
|
||||
|
||||
|
@ -189,18 +190,18 @@ if (isset ($id)) {
|
|||
|
||||
if ($id_component_type == 6) {
|
||||
$categories = array (0, 1, 2);
|
||||
require ("godmode/modules/manage_network_components_form_common.php");
|
||||
require ("godmode/modules/manage_network_components_form_wmi.php");
|
||||
require ($config['homedir'] . "/godmode/modules/manage_network_components_form_common.php");
|
||||
require ($config['homedir'] . "/godmode/modules/manage_network_components_form_wmi.php");
|
||||
}
|
||||
else if ($id_component_type == 4) {
|
||||
$categories = array (0, 1, 2);
|
||||
require ("godmode/modules/manage_network_components_form_common.php");
|
||||
require ("godmode/modules/manage_network_components_form_plugin.php");
|
||||
require ($config['homedir'] . "/godmode/modules/manage_network_components_form_common.php");
|
||||
require ($config['homedir'] . "/godmode/modules/manage_network_components_form_plugin.php");
|
||||
}
|
||||
else if ($id_component_type == 2 || $create_network_from_module) {
|
||||
$categories = array (3, 4, 5);
|
||||
require ("godmode/modules/manage_network_components_form_common.php");
|
||||
require ("godmode/modules/manage_network_components_form_network.php");
|
||||
require ($config['homedir'] . "/godmode/modules/manage_network_components_form_common.php");
|
||||
require ($config['homedir'] . "/godmode/modules/manage_network_components_form_network.php");
|
||||
}
|
||||
else {
|
||||
return;
|
||||
|
|
|
@ -62,7 +62,7 @@ if(enterprise_installed()) {
|
|||
$table->data[0][3] .= html_print_checkbox('only_metaconsole',1,(int)$only_metaconsole,true).__('Only for metaconsole');
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Type') . ' ' . ui_print_help_icon ('module_type', true);
|
||||
$table->data[1][0] = __('Type') . ' ' . ui_print_help_icon ('module_type', true, ui_get_full_url(false, false, false, false));
|
||||
$sql = sprintf ('SELECT id_tipo, descripcion
|
||||
FROM ttipo_modulo
|
||||
WHERE categoria IN (%s)
|
||||
|
@ -109,7 +109,7 @@ $table->data[3][3] .= html_print_input_text ('str_critical', $str_critical,
|
|||
$table->data[3][3] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table->data[3][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
|
||||
|
||||
$table->data[4][0] = __('FF threshold') . ' ' . ui_print_help_icon ('ff_threshold', true);
|
||||
$table->data[4][0] = __('FF threshold') . ' ' . ui_print_help_icon ('ff_threshold', true, ui_get_full_url(false, false, false, false));
|
||||
$table->data[4][1] = html_print_input_text ('ff_event', $ff_event,
|
||||
'', 5, 15, true);
|
||||
$table->data[4][2] = __('Historical data');
|
||||
|
|
|
@ -79,7 +79,7 @@ $data[3] = html_print_select(array('noAuthNoPriv' => __('Not auth and not privac
|
|||
push_table_row($data, 'field_snmpv3_row3');
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Post process') . ' ' . ui_print_help_icon ('postprocess', true);
|
||||
$data[0] = __('Post process') . ' ' . ui_print_help_icon ('postprocess', true, ui_get_full_url(false, false, false, false));
|
||||
$data[1] = html_print_input_text ('post_process', $post_process, '', 12, 25, true);
|
||||
$data[2] = $data[3] = '';
|
||||
push_table_row($data, 'field_process');
|
||||
|
@ -88,7 +88,7 @@ push_table_row($data, 'field_process');
|
|||
|
||||
/* Advanced stuff */
|
||||
$data = array ();
|
||||
$data[0] = __('TCP send') . ' ' . ui_print_help_icon ("tcp_send", true);
|
||||
$data[0] = __('TCP send') . ' ' . ui_print_help_icon ("tcp_send", true, ui_get_full_url(false, false, false, false));
|
||||
$data[1] = html_print_textarea ('tcp_send', 2, 65, $tcp_send, '', true);
|
||||
$table->colspan['tcp_send'][1] = 3;
|
||||
|
||||
|
|
|
@ -18,15 +18,13 @@ global $config;
|
|||
|
||||
check_login ();
|
||||
|
||||
echo "<h3>".__('Plugin component').'</h3>';
|
||||
|
||||
$data = array ();
|
||||
$data[0] = __('Plugin');
|
||||
$data[1] = html_print_select_from_sql ('SELECT id, name FROM tplugin ORDER BY name',
|
||||
'id_plugin', $id_plugin, 'javascript: load_plugin_macros_fields(\'network_component-macro\')', __('None'), 0, true, false, false);
|
||||
// Store the macros in base64 into a hidden control to move between pages
|
||||
$data[1] .= html_print_input_hidden('macros',base64_encode($macros),true);
|
||||
$data[2] = __('Post process') . ' ' . ui_print_help_icon ('postprocess', true);
|
||||
$data[2] = __('Post process') . ' ' . ui_print_help_icon ('postprocess', true, ui_get_full_url(false, false, false, false));
|
||||
$data[3] = html_print_input_text ('post_process', $post_process, '', 12, 25, true);
|
||||
|
||||
push_table_row ($data, 'plugin_1');
|
||||
|
|
|
@ -28,20 +28,18 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
|
||||
include_once($config['homedir'] . "/include/functions_modules.php");
|
||||
|
||||
echo "<h3>".__('WMI component management').'</h3>';
|
||||
|
||||
$data = array ();
|
||||
$data[0] = __('WMI query');
|
||||
$data[1] = html_print_input_text ('snmp_oid', $snmp_oid, '', 25, 255, true);
|
||||
$data[2] = __('Key string') . ' ' . ui_print_help_icon ('wmikey', true);
|
||||
$data[2] = __('Key string') . ' ' . ui_print_help_icon ('wmikey', true, ui_get_full_url(false, false, false, false));
|
||||
$data[3] = html_print_input_text ('snmp_community', $snmp_community, '', 25, 255, true);
|
||||
|
||||
push_table_row ($data, 'wmi_1');
|
||||
|
||||
$data = array ();
|
||||
$data[0] = __('Field number') . ' ' . ui_print_help_icon ('wmifield', true);
|
||||
$data[0] = __('Field number') . ' ' . ui_print_help_icon ('wmifield', true, ui_get_full_url(false, false, false, false));
|
||||
$data[1] = html_print_input_text ('tcp_port', $tcp_port, '', 5, 25, true);
|
||||
$data[2] = __('Namespace') . ' ' . ui_print_help_icon ('wminamespace', true);
|
||||
$data[2] = __('Namespace') . ' ' . ui_print_help_icon ('wminamespace', true, ui_get_full_url(false, false, false, false));
|
||||
$data[3] = html_print_input_text ('tcp_send', $tcp_send, '', 25, 255, true);
|
||||
|
||||
push_table_row ($data, 'wmi_2');
|
||||
|
@ -55,7 +53,7 @@ $data[3] = html_print_input_password ('plugin_pass', $plugin_pass, '', 25, 255,
|
|||
push_table_row ($data, 'wmi_3');
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Post process') . ' ' . ui_print_help_icon ('postprocess', true);
|
||||
$data[0] = __('Post process') . ' ' . ui_print_help_icon ('postprocess', true, ui_get_full_url(false, false, false, false));
|
||||
$data[1] = html_print_input_text ('post_process', $post_process, '', 12, 25, true);
|
||||
$data[2] = $data[3] = '';
|
||||
push_table_row($data, 'field_process');
|
||||
|
@ -150,7 +148,7 @@ echo '</td></tr>';
|
|||
|
||||
// WMI Query
|
||||
echo '<tr><td class="datos">' . __('WMI query') ;
|
||||
ui_print_help_icon("wmiquery");
|
||||
ui_print_help_icon("wmiquery", true, ui_get_full_url(false, false, false, false));
|
||||
echo '</td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="snmp_oid" size="25" value="' . $snmp_oid . '">';
|
||||
|
@ -158,7 +156,7 @@ echo '</td>';
|
|||
|
||||
// Key string
|
||||
echo '<td class="datos">' . __('Key string');
|
||||
ui_print_help_icon("wmikey");
|
||||
ui_print_help_icon("wmikey", true, ui_get_full_url(false, false, false, false));
|
||||
echo '</td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<input type="text" name="snmp_community" size="25" value="' . $snmp_community . '">';
|
||||
|
@ -166,7 +164,7 @@ echo '</td></tr>';
|
|||
|
||||
// Field
|
||||
echo '<td class="datos2">' . __('Field number');
|
||||
ui_print_help_icon("wmifield");
|
||||
ui_print_help_icon("wmifield", true, ui_get_full_url(false, false, false, false));
|
||||
echo '</td>';
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="tcp_port" size="5" value="' . $tcp_port . '">';
|
||||
|
@ -174,7 +172,7 @@ echo '</td>';
|
|||
|
||||
// Namespace
|
||||
echo '<td class="datos2">' . __('Namespace');
|
||||
ui_print_help_icon("wminamespace");
|
||||
ui_print_help_icon("wminamespace", true, ui_get_full_url(false, false, false, false));
|
||||
echo '</td>';
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="tcp_send" size="25" value="' . $tcp_send . '">';
|
||||
|
|
|
@ -522,10 +522,14 @@ foreach ($result as $profile) {
|
|||
|
||||
$data = array ();
|
||||
|
||||
$data[0] = '<a href="index.php?sec=gusaurios&sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.profile_get_name ($profile['id_perfil']).'</a>';
|
||||
$data[1] = ui_print_group_icon($profile["id_grupo"], true) .
|
||||
' <a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$profile['id_grupo'].'&pure='.$pure.'">' .
|
||||
ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT).'</a>';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.profile_get_name ($profile['id_perfil']).'</a>';
|
||||
$data[1] = ui_print_group_icon($profile["id_grupo"], true);
|
||||
if (!defined('METACONSOLE'))
|
||||
$data[1] .= '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$profile['id_grupo'].'&pure='.$pure.'">';
|
||||
|
||||
$data[1] .= ' ' . ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT);
|
||||
if (!defined('METACONSOLE'))
|
||||
$data[1] .= '</a>';
|
||||
$data[2] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
$data[2] .= html_print_input_hidden ('delete_profile', 1, true);
|
||||
$data[2] .= html_print_input_hidden ('id_user_profile', $profile['id_up'], true);
|
||||
|
|
|
@ -483,6 +483,11 @@ function ui_print_group_icon ($id_group, $return = false, $path = "groups_small"
|
|||
$style = 'width: 16px; height: 16px;';
|
||||
|
||||
$output = '';
|
||||
|
||||
// Don't show link in metaconsole
|
||||
if (defined('METACONSOLE'))
|
||||
$link = false;
|
||||
|
||||
if ($link)
|
||||
$output = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$id_group.'">';
|
||||
|
||||
|
|
|
@ -212,9 +212,15 @@
|
|||
$(this).change (function () {
|
||||
var id_os = this.value;
|
||||
|
||||
var home_url;
|
||||
if (typeof(settings) == 'undefined')
|
||||
home_url = './';
|
||||
else
|
||||
home_url = settings.home_url;
|
||||
|
||||
$(config.spanPreview).fadeOut ('fast', function () {
|
||||
$("img", config.spanPreview).remove ();
|
||||
jQuery.post ('ajax.php',
|
||||
jQuery.post (home_url + 'ajax.php',
|
||||
{"page": "godmode/setup/setup",
|
||||
"get_os_icon": 1,
|
||||
"id_os": id_os
|
||||
|
|
Loading…
Reference in New Issue