2013-02-05 Miguel de Dios <miguel.dedios@artica.es>

* godmode/agentes/module_manager.php,
	godmode/agentes/configurar_agente.php: fixed the load the module
	editor form into the policies.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7583 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-05 09:13:41 +00:00
parent 178af809d6
commit aa51e3015d
3 changed files with 43 additions and 18 deletions

View File

@ -1,3 +1,9 @@
2013-02-05 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager.php,
godmode/agentes/configurar_agente.php: fixed the load the module
editor form into the policies.
2013-02-05 Sancho Lerena <slerena@artica.es> 2013-02-05 Sancho Lerena <slerena@artica.es>
* pandoradb_data.sql: Improved default config values. * pandoradb_data.sql: Improved default config values.

View File

@ -82,8 +82,22 @@ if (strstr($sec2, "enterprise/godmode/policies/policies") !== false) {
unset($modules['predictionserver']); unset($modules['predictionserver']);
} }
if (isset($agent)) { global $policy_page;
if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
if (!isset($policy_page))
$policy_page = false;
if (($policy_page) || (isset($agent))) {
$show_creation = false;
if ($policy_page) {
$show_creation = true;
}
else {
if (check_acl ($config['id_user'], $agent['id_grupo'], "AW"))
$show_creation = true;
}
if ($show_creation) {
// Create module/type combo // Create module/type combo
echo '<form id="create_module_type" method="post" action="'.$url.'">'; echo '<form id="create_module_type" method="post" action="'.$url.'">';
html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' ); html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' );
@ -152,13 +166,17 @@ if ($multiple_delete) {
if ($module !== false) { if ($module !== false) {
if ($module['estado'] == 0) { if ($module['estado'] == 0) {
db_process_sql ('UPDATE tagente SET normal_count=normal_count-1 WHERE id_agente=' . $module['id_agente']); db_process_sql ('UPDATE tagente SET normal_count=normal_count-1 WHERE id_agente=' . $module['id_agente']);
} else if ($module['estado'] == 1) { }
else if ($module['estado'] == 1) {
db_process_sql ('UPDATE tagente SET critical_count=critical_count-1 WHERE id_agente=' . $module['id_agente']); db_process_sql ('UPDATE tagente SET critical_count=critical_count-1 WHERE id_agente=' . $module['id_agente']);
} else if ($module['estado'] == 2) { }
else if ($module['estado'] == 2) {
db_process_sql ('UPDATE tagente SET warning_count=warning_count-1 WHERE id_agente=' . $module['id_agente']); db_process_sql ('UPDATE tagente SET warning_count=warning_count-1 WHERE id_agente=' . $module['id_agente']);
} else if ($module['estado'] == 3) { }
else if ($module['estado'] == 3) {
db_process_sql ('UPDATE tagente SET unknown_count=unknown_count-1 WHERE id_agente=' . $module['id_agente']); db_process_sql ('UPDATE tagente SET unknown_count=unknown_count-1 WHERE id_agente=' . $module['id_agente']);
} else if ($module['estado'] == 4) { }
else if ($module['estado'] == 4) {
db_process_sql ('UPDATE tagente SET notinit_count=notinit_count-1 WHERE id_agente=' . $module['id_agente']); db_process_sql ('UPDATE tagente SET notinit_count=notinit_count-1 WHERE id_agente=' . $module['id_agente']);
} }
@ -508,8 +526,9 @@ foreach ($modules as $module) {
} }
$data[0] = ""; $data[0] = "";
if ($module['quiet']) { if ($module['quiet']) {
$data[0] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) $data[0] .= html_print_image("images/dot_green.disabled.png",
. "&nbsp;"; true, array("border" => '0', "title" => __('Quiet'),
"alt" => "")) . "&nbsp;";
} }
if(check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { if(check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
@ -649,7 +668,7 @@ foreach ($modules as $module) {
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if(check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module" echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module"
onsubmit="if (! confirm (\''.__('Are you sure?').'\')) return false">'; onsubmit="if (! confirm (\''.__('Are you sure?').'\')) return false">';
@ -657,7 +676,7 @@ if(check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
html_print_table ($table); html_print_table ($table);
if(check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden ('multiple_delete', 1); html_print_input_hidden ('multiple_delete', 1);
html_print_submit_button (__('Delete'), 'multiple_delete', false, 'class="sub delete"'); html_print_submit_button (__('Delete'), 'multiple_delete', false, 'class="sub delete"');