2010-08-20 Sergio Martin <sergio.martin@artica.es>

* godmode/agentes/massive_copy_modules.php
	godmode/agentes/massive_add_alerts.php
	godmode/agentes/massive_delete_agents.php
	godmode/agentes/massive_delete_action_alerts.php
	godmode/agentes/massive_delete_alerts.php
	godmode/agentes/massive_edit_modules.php
	godmode/agentes/massive_operations.php
	godmode/agentes/massive_delete_modules.php
	godmode/agentes/massive_add_action_alerts.php
	godmode/menu.php
	godmode/massive
	godmode/massive/massive_copy_modules.php
	godmode/massive/massive_add_alerts.php
	godmode/massive/massive_delete_agents.php
	godmode/massive/massive_operations.php
	godmode/massive/massive_delete_action_alerts.php
	godmode/massive/massive_delete_modules.php
	godmode/massive/massive_delete_alerts.php
	godmode/massive/massive_edit_modules.php
	godmode/massive/massive_add_action_alerts.php: Created
	a new section for massive operations and change the 
	structure of the files to new folder



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3164 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-08-20 10:30:36 +00:00
parent 9a39d75f52
commit 80d928a686
11 changed files with 74 additions and 34 deletions

View File

@ -1,3 +1,28 @@
2010-08-20 Sergio Martin <sergio.martin@artica.es>
* godmode/agentes/massive_copy_modules.php
godmode/agentes/massive_add_alerts.php
godmode/agentes/massive_delete_agents.php
godmode/agentes/massive_delete_action_alerts.php
godmode/agentes/massive_delete_alerts.php
godmode/agentes/massive_edit_modules.php
godmode/agentes/massive_operations.php
godmode/agentes/massive_delete_modules.php
godmode/agentes/massive_add_action_alerts.php
godmode/menu.php
godmode/massive
godmode/massive/massive_copy_modules.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_agents.php
godmode/massive/massive_operations.php
godmode/massive/massive_delete_action_alerts.php
godmode/massive/massive_delete_modules.php
godmode/massive/massive_delete_alerts.php
godmode/massive/massive_edit_modules.php
godmode/massive/massive_add_action_alerts.php: Created
a new section for massive operations and change the
structure of the files to new folder
2010-08-19 Sergio Martin <sergio.martin@artica.es> 2010-08-19 Sergio Martin <sergio.martin@artica.es>
* godmode/agentes/module_manager_editor_common.php * godmode/agentes/module_manager_editor_common.php

View File

@ -112,7 +112,7 @@ $table->data[2][1] .= print_input_text ('fires_max', 0, '', 4, 10, true);
$table->data[2][1] .= print_help_icon ("alert-matches", true); $table->data[2][1] .= print_help_icon ("alert-matches", true);
$table->data[2][1] .= '</span>'; $table->data[2][1] .= '</span>';
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&option=add_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">'; echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=add_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
print_table ($table); print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -117,7 +117,7 @@ $table->data[2][0] = __('Alert template');
$table->data[2][1] = print_select (index_array ($templates, 'id', 'name'), $table->data[2][1] = print_select (index_array ($templates, 'id', 'name'),
'id_alert_template', $id_alert_template, false, __('Select'), 0, true); 'id_alert_template', $id_alert_template, false, __('Select'), 0, true);
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&option=add_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">'; echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=add_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
print_table ($table); print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
@ -141,7 +141,7 @@ $(document).ready (function () {
$("option", $select).remove (); $("option", $select).remove ();
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "godmode/agentes/massive_add_alerts", {"page" : "godmode/massive/massive_add_alerts",
"get_agents" : 1, "get_agents" : 1,
"id_group" : this.value "id_group" : this.value
}, },

View File

@ -69,7 +69,7 @@ $table->data[0][3] = print_select (get_group_agents ($source_id_group, false, "n
// array('style' => 'background: url(images/lightning.png) no-repeat right;'), true) // array('style' => 'background: url(images/lightning.png) no-repeat right;'), true)
// . '<a href="#" class="tip">&nbsp;<span>' . __("Type two chars at least for search") . '</span></a>'; // . '<a href="#" class="tip">&nbsp;<span>' . __("Type two chars at least for search") . '</span></a>';
echo '<form action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&option=copy_modules" id="manage_config_form" method="post">'; echo '<form action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=copy_modules" id="manage_config_form" method="post">';
echo '<fieldset id="fieldset_source">'; echo '<fieldset id="fieldset_source">';
echo '<legend><span>'.__('Source'); echo '<legend><span>'.__('Source');
@ -199,7 +199,7 @@ $(document).ready (function () {
var no_alerts; var no_alerts;
/* Get modules */ /* Get modules */
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente", {"page" : "operation/massive/ver_agente",
"get_agent_modules_json" : 1, "get_agent_modules_json" : 1,
"id_agent" : this.value, "id_agent" : this.value,
"filter" : "disabled = 0", "filter" : "disabled = 0",

View File

@ -104,7 +104,7 @@ $actions = get_alert_actions ();
$table->data[2][0] = __('Action'); $table->data[2][0] = __('Action');
$table->data[2][1] = print_select ($actions, 'action', '', '', __('None'), 0, true); $table->data[2][1] = print_select ($actions, 'action', '', '', __('None'), 0, true);
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&option=delete_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">'; echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=delete_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
print_table ($table); print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -90,7 +90,7 @@ $table->data[1][0] .= '</span>';
$table->data[1][1] = print_select (get_group_agents ($id_group, false, "none"), $table->data[1][1] = print_select (get_group_agents ($id_group, false, "none"),
'id_agents[]', 0, false, '', '', true, true); 'id_agents[]', 0, false, '', '', true, true);
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&option=delete_agents" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">'; echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=delete_agents" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
print_table ($table); print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -111,7 +111,7 @@ $agents_alerts = get_agents_with_alert_template ($id_alert_template, $id_group,
$table->data[2][1] = print_select (index_array ($agents_alerts, 'id_agente', 'nombre'), $table->data[2][1] = print_select (index_array ($agents_alerts, 'id_agente', 'nombre'),
'id_agents[]', '', '', '', '', true, true, true, '', $id_alert_template == 0); 'id_agents[]', '', '', '', '', true, true, true, '', $id_alert_template == 0);
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&option=delete_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">'; echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
print_table ($table); print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
@ -144,7 +144,7 @@ $(document).ready (function () {
$("option", $select).remove (); $("option", $select).remove ();
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "godmode/agentes/massive_delete_alerts", {"page" : "godmode/massive/massive_delete_alerts",
"get_agents" : 1, "get_agents" : 1,
"id_group" : this.value, "id_group" : this.value,
"id_alert_template" : $("#id_alert_template").attr ("value") "id_alert_template" : $("#id_alert_template").attr ("value")

View File

@ -115,7 +115,7 @@ $agents = get_agents_with_module_name ($module_name, $id_group,
$table->data[2][1] = print_select (index_array ($agents, 'id_agente', 'nombre'), $table->data[2][1] = print_select (index_array ($agents, 'id_agente', 'nombre'),
'id_agents[]', 0, false, __('None'), 0, true, true, true, '', empty ($module_name)); 'id_agents[]', 0, false, __('None'), 0, true, true, true, '', empty ($module_name));
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&option=delete_modules" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">'; echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
print_table ($table); print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
@ -148,7 +148,7 @@ $(document).ready (function () {
$("option", $select).remove (); $("option", $select).remove ();
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "godmode/agentes/massive_delete_modules", {"page" : "godmode/massive/massive_delete_modules",
"get_agents" : 1, "get_agents" : 1,
"id_group" : this.value, "id_group" : this.value,
"module_name" : $("#module_name").attr ("value") "module_name" : $("#module_name").attr ("value")

View File

@ -218,7 +218,7 @@ $table->data['edit7'][1] = print_input_text ('min_ff_event', '', '', 5, 15, true
$table->data['edit7'][2] = __('Historical data'); $table->data['edit7'][2] = __('Historical data');
$table->data['edit7'][3] = print_select(array('' => '', '1' => __('Yes'), '0' => __('No')),'history_data','','','', '', true); $table->data['edit7'][3] = print_select(array('' => '', '1' => __('Yes'), '0' => __('No')),'history_data','','','', '', true);
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&option=edit_modules" id="form_edit" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">'; echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
print_table ($table); print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
@ -248,7 +248,7 @@ $(document).ready (function () {
$("#module_name").attr ("disabled", "disabled") $("#module_name").attr ("disabled", "disabled")
$("#module_name option[value!=0]").remove (); $("#module_name option[value!=0]").remove ();
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente", {"page" : "operation/massive/ver_agente",
"get_agent_modules_json" : 1, "get_agent_modules_json" : 1,
"filter" : filter, "filter" : filter,
"fields" : "DISTINCT(nombre)", "fields" : "DISTINCT(nombre)",
@ -281,7 +281,7 @@ $(document).ready (function () {
$("#groups_select").change ( $("#groups_select").change (
function () { function () {
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente", {"page" : "operation/massive/ver_agente",
"get_agents_group_json" : 1, "get_agents_group_json" : 1,
"id_group" : this.value, "id_group" : this.value,
}, },

View File

@ -27,7 +27,7 @@ require_once ('include/functions_agents.php');
require_once ('include/functions_alerts.php'); require_once ('include/functions_alerts.php');
require_once ('include/functions_modules.php'); require_once ('include/functions_modules.php');
enterprise_include ('godmode/agentes/massive_operations.php'); enterprise_include ('godmode/massive/massive_operations.php');
$tab = (string) get_parameter ('tab', 'massive_agents'); $tab = (string) get_parameter ('tab', 'massive_agents');
$option = (string) get_parameter ('option', ''); $option = (string) get_parameter ('option', '');
@ -88,16 +88,16 @@ if($option == ''){
$option = array_shift(array_keys($options)); $option = array_shift(array_keys($options));
} }
$alertstab = array('text' => '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=massive_alerts">' $alertstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts">'
. print_image ('images/bell.png', true, array ('title' => __('Massive alert actions'))) . print_image ('images/bell.png', true, array ('title' => __('Alerts operations')))
. '</a>', 'active' => $tab == 'massive_alerts'); . '</a>', 'active' => $tab == 'massive_alerts');
$agentstab = array('text' => '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=massive_agents">' $agentstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_agents">'
. print_image ('images/bricks.png', true, array ('title' => __('Massive agent actions'))) . print_image ('images/bricks.png', true, array ('title' => __('Agents operations')))
. '</a>', 'active' => $tab == 'massive_agents'); . '</a>', 'active' => $tab == 'massive_agents');
$modulestab = array('text' => '<a href="index.php?sec=gagente&sec2=godmode/agentes/massive_operations&tab=massive_modules">' $modulestab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'
. print_image ('images/brick.png', true, array ('title' => __('Massive module actions'))) . print_image ('images/brick.png', true, array ('title' => __('Modules operations')))
. '</a>', 'active' => $tab == 'massive_modules'); . '</a>', 'active' => $tab == 'massive_modules');
/* Collection */ /* Collection */
@ -112,7 +112,7 @@ $onheader = array('massive_agents' => $agentstab, 'massive_modules' => $modulest
print_page_header (__('Agent configuration'). ' &raquo; '. $options[$option], "images/god1.png", false, "", true, $onheader); print_page_header (__('Agent configuration'). ' &raquo; '. $options[$option], "images/god1.png", false, "", true, $onheader);
echo '<form method="post" id="form_options" action="index.php?sec=gagente&sec2=godmode/agentes/massive_operations">'; echo '<form method="post" id="form_options" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations">';
echo '<table border="0"><tr><td>'; echo '<table border="0"><tr><td>';
echo '<h3>'.__('Massive options').':</h3>'; echo '<h3>'.__('Massive options').':</h3>';
echo '</td><td>'; echo '</td><td>';
@ -122,32 +122,32 @@ echo '</form>';
switch ($option) { switch ($option) {
case 'delete_alerts': case 'delete_alerts':
require_once ('godmode/agentes/massive_delete_alerts.php'); require_once ('godmode/massive/massive_delete_alerts.php');
break; break;
case 'add_alerts': case 'add_alerts':
require_once ('godmode/agentes/massive_add_alerts.php'); require_once ('godmode/massive/massive_add_alerts.php');
break; break;
case 'delete_action_alerts': case 'delete_action_alerts':
require_once ('godmode/agentes/massive_delete_action_alerts.php'); require_once ('godmode/massive/massive_delete_action_alerts.php');
break; break;
case 'add_action_alerts': case 'add_action_alerts':
require_once ('godmode/agentes/massive_add_action_alerts.php'); require_once ('godmode/massive/massive_add_action_alerts.php');
break; break;
case 'delete_agents': case 'delete_agents':
require_once ('godmode/agentes/massive_delete_agents.php'); require_once ('godmode/massive/massive_delete_agents.php');
break; break;
case 'delete_modules': case 'delete_modules':
require_once ('godmode/agentes/massive_delete_modules.php'); require_once ('godmode/massive/massive_delete_modules.php');
break; break;
case 'edit_modules': case 'edit_modules':
require_once ('godmode/agentes/massive_edit_modules.php'); require_once ('godmode/massive/massive_edit_modules.php');
break; break;
case 'copy_modules': case 'copy_modules':
require_once ('godmode/agentes/massive_copy_modules.php'); require_once ('godmode/massive/massive_copy_modules.php');
break; break;
default: default:
if (!enterprise_hook('massive_operations', array($option))) { if (!enterprise_hook('massive_operations', array($option))) {
require_once ('godmode/agentes/massive_config.php'); require_once ('godmode/massive/massive_config.php');
} }
break; break;
} }

View File

@ -28,9 +28,7 @@ if (give_acl ($config['id_user'], 0, "AW")) {
$menu["gagente"]["sec2"] = "godmode/agentes/modificar_agente"; $menu["gagente"]["sec2"] = "godmode/agentes/modificar_agente";
$menu["gagente"]["id"] = "god-agents"; $menu["gagente"]["id"] = "god-agents";
$sub = array (); $sub = array ();
$sub["godmode/agentes/massive_operations"]["text"] = __('Massive operations');
$sub["godmode/agentes/manage_config_remote"]["text"] = __('Duplicate config'); $sub["godmode/agentes/manage_config_remote"]["text"] = __('Duplicate config');
if (give_acl ($config["id_user"], 0, "PM")) { if (give_acl ($config["id_user"], 0, "PM")) {
@ -44,6 +42,23 @@ if (give_acl ($config['id_user'], 0, "AW")) {
$menu["gagente"]["sub"] = $sub; $menu["gagente"]["sub"] = $sub;
} }
if (give_acl ($config['id_user'], 0, "AW")) {
$menu["gmassive"]["text"] = __('Massive operations');
$menu["gmassive"]["sec2"] = "godmode/massive/massive_operations";
$menu["gmassive"]["id"] = "god-massive";
$sub = array ();
$sub["godmode/massive/massive_operations&tab=massive_agents"]["text"] = __('Agents operations');
$sub["godmode/massive/massive_operations&tab=massive_modules"]["text"] = __('Modules operations');
$sub["godmode/massive/massive_operations&tab=massive_alerts"]["text"] = __('Alerts operations');
enterprise_hook('massivepolicies_submenu');
$menu["gmassive"]["sub"] = $sub;
}
if (give_acl ($config['id_user'], 0, "AW")) { if (give_acl ($config['id_user'], 0, "AW")) {
enterprise_hook ('services_godmenu'); enterprise_hook ('services_godmenu');
} }