2012-07-10 Miguel de Dios <miguel.dedios@artica.es>

* install.php, operation/reporting/reporting_xml.php,
	operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
	operation/tree.php, operation/agentes/gis_view.php,
	operation/agentes/estado_monitores.php,
	operation/agentes/networkmap.php,
	operation/agentes/datos_agente.php,
	operation/agentes/alerts_status.php, operation/menu.php,
	operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
	godmode/groups/configure_group.php,
	godmode/groups/configure_modu_group.php,
	godmode/agentes/module_manager_editor_prediction.php,
	godmode/servers/manage_recontask.php,
	godmode/alerts/alert_compounds.php,
	godmode/alerts/configure_alert_template.php,
	godmode/alerts/alert_special_days.php, godmode/setup/links.php,
	godmode/setup/os.php, godmode/users/configure_profile.php,
	godmode/events/events.php,
	godmode/massive/massive_delete_modules.php,
	godmode/massive/massive_edit_modules.php,
	godmode/massive/massive_standby_alerts.php,
	godmode/massive/massive_add_action_alerts.php,
	godmode/massive/massive_enable_disable_alerts.php,
	godmode/massive/massive_operations.php,
	godmode/massive/massive_delete_profiles.php,
	godmode/modules/manage_network_components.php,
	godmode/modules/manage_nc_groups.php,
	godmode/reporting/graph_builder.php,
	godmode/reporting/reporting_builder.item_editor.php,
	include/functions_menu.php, include/functions_visual_map.php,
	include/functions_db.php: cleaned source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-07-10 10:38:02 +00:00
parent ae4a12872c
commit f2c0c0762f
39 changed files with 643 additions and 565 deletions

View File

@ -1,3 +1,36 @@
2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* install.php, operation/reporting/reporting_xml.php,
operation/netflow/nf_live_view.php, operation/netflow/nf_view.php,
operation/tree.php, operation/agentes/gis_view.php,
operation/agentes/estado_monitores.php,
operation/agentes/networkmap.php,
operation/agentes/datos_agente.php,
operation/agentes/alerts_status.php, operation/menu.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/servers/manage_recontask.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_special_days.php, godmode/setup/links.php,
godmode/setup/os.php, godmode/users/configure_profile.php,
godmode/events/events.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/graph_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
include/functions_menu.php, include/functions_visual_map.php,
include/functions_db.php: cleaned source code style.
2012-07-10 Miguel de Dios <miguel.dedios@artica.es> 2012-07-10 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/net_tools.php, * extensions/agents_alerts.php, extensions/net_tools.php,

View File

@ -63,6 +63,7 @@ if ($row !== false && is_array($row)) {
break; break;
default: default:
$prediction_module = $custom_integer_1; $prediction_module = $custom_integer_1;
break;
} }
} }
else { else {
@ -173,5 +174,4 @@ $(document).ready(function() {
enterprise_hook('setup_services_synth', array($is_service, $is_synthetic, $is_synthetic_avg, $is_netflow, $ops)); enterprise_hook('setup_services_synth', array($is_service, $is_synthetic, $is_synthetic_avg, $is_netflow, $ops));
?> ?>
}); });
</script> </script>

View File

@ -223,7 +223,8 @@ foreach ($id_alerts as $alert) {
if ($alert['disabled']) { if ($alert['disabled']) {
$data[0] .= html_print_input_image ('enable', 'images/lightbulb_off.png', 1, '', true); $data[0] .= html_print_input_image ('enable', 'images/lightbulb_off.png', 1, '', true);
$data[0] .= html_print_input_hidden ('enable_alert', 1, true); $data[0] .= html_print_input_hidden ('enable_alert', 1, true);
} else { }
else {
$data[0] .= html_print_input_image ('disable', 'images/lightbulb.png', 1, '', true); $data[0] .= html_print_input_image ('disable', 'images/lightbulb.png', 1, '', true);
$data[0] .= html_print_input_hidden ('disable_alert', 1, true); $data[0] .= html_print_input_hidden ('disable_alert', 1, true);
} }
@ -244,7 +245,8 @@ foreach ($id_alerts as $alert) {
if (isset($data)){ if (isset($data)){
html_print_table ($table); html_print_table ($table);
} else { }
else {
echo "<div class='nf'>".__('No alerts found')."</div>"; echo "<div class='nf'>".__('No alerts found')."</div>";
} }

View File

@ -511,7 +511,8 @@ if ($step == 2) {
$table->data[4][1] = html_print_select_from_sql ($sql_query, $table->data[4][1] = html_print_select_from_sql ($sql_query,
'default_action', $default_action, '', __('None'), 0, 'default_action', $default_action, '', __('None'), 0,
true, false, false).ui_print_help_tip (__('In case you fill any Field 1, Field 2 or Field 3 above, those will replace the corresponding fields of this associated "Default action".'), true); true, false, false).ui_print_help_tip (__('In case you fill any Field 1, Field 2 or Field 3 above, those will replace the corresponding fields of this associated "Default action".'), true);
} else if ($step == 3) { }
else if ($step == 3) {
/* Alert recover */ /* Alert recover */
if (! $recovery_notify) { if (! $recovery_notify) {
$table->rowstyle = array (); $table->rowstyle = array ();
@ -531,7 +532,8 @@ if ($step == 2) {
$table->data['field3'][0] = __('Field 3'); $table->data['field3'][0] = __('Field 3');
$table->data['field3'][1] = html_print_textarea ('field3_recovery', 10, 30, $table->data['field3'][1] = html_print_textarea ('field3_recovery', 10, 30,
$field3_recovery, '', true); $field3_recovery, '', true);
} else { }
else {
/* Step 1 by default */ /* Step 1 by default */
$table->size = array (); $table->size = array ();
$table->size[0] = '20%'; $table->size[0] = '20%';
@ -621,7 +623,8 @@ if ($step == 2) {
/* If it's the last step it will redirect to template lists */ /* If it's the last step it will redirect to template lists */
if ($step >= LAST_STEP) { 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=galertas&sec2=godmode/alerts/alert_templates">';
} else { }
else {
echo '<form method="post">'; echo '<form method="post">';
} }
html_print_table ($table); html_print_table ($table);
@ -630,13 +633,15 @@ echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id) { if ($id) {
html_print_input_hidden ('id', $id); html_print_input_hidden ('id', $id);
html_print_input_hidden ('update_template', 1); html_print_input_hidden ('update_template', 1);
} else { }
else {
html_print_input_hidden ('create_template', 1); html_print_input_hidden ('create_template', 1);
} }
if ($step >= LAST_STEP) { if ($step >= LAST_STEP) {
html_print_submit_button (__('Finish'), 'finish', false, 'class="sub upd"'); html_print_submit_button (__('Finish'), 'finish', false, 'class="sub upd"');
} else { }
else {
html_print_input_hidden ('step', $step + 1); html_print_input_hidden ('step', $step + 1);
html_print_submit_button (__('Next'), 'next', false, 'class="sub next"'); html_print_submit_button (__('Next'), 'next', false, 'class="sub next"');
} }
@ -685,7 +690,8 @@ function render_example () {
vmax = parseInt ($("input#text-max").attr ("value")); vmax = parseInt ($("input#text-max").attr ("value"));
if (isNaN (vmax) || vmax == "") { if (isNaN (vmax) || vmax == "") {
$("span#max").empty ().append ("0"); $("span#max").empty ().append ("0");
} else { }
else {
$("span#max").empty ().append (vmax); $("span#max").empty ().append (vmax);
} }
@ -693,7 +699,8 @@ function render_example () {
vmin = parseInt ($("input#text-min").attr ("value")); vmin = parseInt ($("input#text-min").attr ("value"));
if (isNaN (vmin) || vmin == "") { if (isNaN (vmin) || vmin == "") {
$("span#min").empty ().append ("0"); $("span#min").empty ().append ("0");
} else { }
else {
$("span#min").empty ().append (vmin); $("span#min").empty ().append (vmin);
} }
@ -701,7 +708,8 @@ function render_example () {
vvalue = $("input#text-value").attr ("value"); vvalue = $("input#text-value").attr ("value");
if (vvalue == "") { if (vvalue == "") {
$("span#value").empty ().append ("<em><?php echo __('Empty');?></em>"); $("span#value").empty ().append ("<em><?php echo __('Empty');?></em>");
} else { }
else {
$("span#value").empty ().append (vvalue); $("span#value").empty ().append (vvalue);
} }
} }

View File

@ -43,15 +43,19 @@ $buttons = array(
); );
switch ($section) { switch ($section) {
case 'filter': $buttons['filter']['active'] = true; case 'filter':
$buttons['filter']['active'] = true;
$subpage = ' - ' . __('Filters'); $subpage = ' - ' . __('Filters');
break; break;
case 'fields': $buttons['fields']['active'] = true; case 'fields':
$buttons['fields']['active'] = true;
$subpage = ' - ' . __('Custom fields'); $subpage = ' - ' . __('Custom fields');
break; break;
case 'view': $buttons['view']['active'] = true; case 'view':
$buttons['view']['active'] = true;
break; break;
default: $buttons['filter']['active'] = true; default:
$buttons['filter']['active'] = true;
$subpage = ' - ' . __('Filters'); $subpage = ' - ' . __('Filters');
break; break;
} }

View File

@ -42,7 +42,8 @@ if ($id_group) {
$group = db_get_row ('tmodule_group', 'id_mg', $id_group); $group = db_get_row ('tmodule_group', 'id_mg', $id_group);
if ($group) { if ($group) {
$name = $group["name"]; $name = $group["name"];
} else { }
else {
echo "<h3 class='error'>".__('There was a problem loading group')."</h3>"; echo "<h3 class='error'>".__('There was a problem loading group')."</h3>";
echo "</table>"; echo "</table>";
echo '</div>'; echo '</div>';
@ -71,11 +72,11 @@ if ($id_group) {
html_print_input_hidden ('update_group', 1); html_print_input_hidden ('update_group', 1);
html_print_input_hidden ('id_group', $id_group); html_print_input_hidden ('id_group', $id_group);
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
} else { }
else {
html_print_input_hidden ('create_group', 1); html_print_input_hidden ('create_group', 1);
html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"'); html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"');
} }
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';
?> ?>

View File

@ -220,7 +220,8 @@ $(document).ready (function () {
$("option", $select_template).remove (); $("option", $select_template).remove ();
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "godmode/massive/massive_add_action_alerts", {
"page" : "godmode/massive/massive_add_action_alerts",
"get_alerts" : 1, "get_alerts" : 1,
"id_agents[]" : idAgents "id_agents[]" : idAgents
}, },
@ -249,6 +250,7 @@ $(document).ready (function () {
actions = $(this).parents ("div").children ("span.advanced_actions") actions = $(this).parents ("div").children ("span.advanced_actions")
$("#advanced_actions").removeClass("advanced_actions invisible"); $("#advanced_actions").removeClass("advanced_actions invisible");
$(this).remove (); $(this).remove ();
return false; return false;
}); });

View File

@ -69,7 +69,6 @@ if ($delete_profiles) {
$result = profile_delete_user_profile ($user, $id_up); $result = profile_delete_user_profile ($user, $id_up);
} }
} }
} }
} }

View File

@ -205,7 +205,8 @@ $(document).ready (function () {
if (this.value != 0) { if (this.value != 0) {
$("#id_enabled_alerts").enable (); $("#id_enabled_alerts").enable ();
$("#id_disabled_alerts").enable (); $("#id_disabled_alerts").enable ();
} else { }
else {
$("#id_enabled_alerts").disable (); $("#id_enabled_alerts").disable ();
$("#id_disabled_alerts").disable (); $("#id_disabled_alerts").disable ();
} }
@ -307,7 +308,6 @@ $(document).ready (function () {
$("option", $select_enabled).remove (); $("option", $select_enabled).remove ();
$("option", $select_disabled).remove (); $("option", $select_disabled).remove ();
} }
}); });
/* ]]> */ /* ]]> */
</script> </script>

View File

@ -45,7 +45,8 @@ else {
$options_users = array(); $options_users = array();
} }
$options_modules = array('delete_modules' => __('Massive modules deletion'), 'edit_modules' => __('Massive modules edition'), $options_modules = array('delete_modules' => __('Massive modules deletion'),
'edit_modules' => __('Massive modules edition'),
'copy_modules' => __('Massive modules copy')); 'copy_modules' => __('Massive modules copy'));
$options_policies = array(); $options_policies = array();
@ -160,7 +161,6 @@ echo '</div>';
$(document).ready (function () { $(document).ready (function () {
$('#manage_config_form').submit( function() { $('#manage_config_form').submit( function() {
confirm = confirm(" <?php echo __('Are you sure?'); ?> "); confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
if (confirm) if (confirm)

View File

@ -309,7 +309,6 @@ $(document).ready (function () {
$("option", $select_not_standby).remove (); $("option", $select_not_standby).remove ();
$("option", $select_standby).remove (); $("option", $select_standby).remove ();
} }
}); });
/* ]]> */ /* ]]> */
</script> </script>

View File

@ -67,7 +67,8 @@ if ($update) {
if ($name == '') { if ($name == '') {
ui_print_error_message (__('Not updated. Blank name')); ui_print_error_message (__('Not updated. Blank name'));
} else { }
else {
$result = db_process_sql_update ('tnetwork_component_group', $result = db_process_sql_update ('tnetwork_component_group',
array ('name' => $name, array ('name' => $name,
'parent' => $parent), 'parent' => $parent),
@ -96,7 +97,8 @@ if ($delete) {
if ($result) { if ($result) {
db_pandora_audit( "Module management", "Delete component group #$id"); db_pandora_audit( "Module management", "Delete component group #$id");
} else { }
else {
db_pandora_audit( "Module management", "Fail try to delete component group #$id"); db_pandora_audit( "Module management", "Fail try to delete component group #$id");
} }
@ -132,7 +134,8 @@ if ($multiple_delete) {
$str_ids = implode (',', $ids); $str_ids = implode (',', $ids);
if ($result) { if ($result) {
db_pandora_audit( "Module management", "Multiple delete component group: $str_ids"); db_pandora_audit( "Module management", "Multiple delete component group: $str_ids");
} else { }
else {
db_pandora_audit( "Module management", "Fail try to delete component group: $str_ids"); db_pandora_audit( "Module management", "Fail try to delete component group: $str_ids");
} }
ui_print_result_message ($result, ui_print_result_message ($result,

View File

@ -166,6 +166,7 @@ if ($update_component) {
$custom_string_1 = ''; $custom_string_1 = '';
$custom_string_2 = ''; $custom_string_2 = '';
$custom_string_3 = ''; $custom_string_3 = '';
//$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name); //$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
if ($type >= 15 && $type <= 18) { if ($type >= 15 && $type <= 18) {
// New support for snmp v3 // New support for snmp v3
@ -238,7 +239,8 @@ if ($delete_component) {
if ($result) { if ($result) {
db_pandora_audit( "Module management", "Delete network component #$id"); db_pandora_audit( "Module management", "Delete network component #$id");
} else { }
else {
db_pandora_audit( "Module management", "Fail try to delete network component #$id"); db_pandora_audit( "Module management", "Fail try to delete network component #$id");
} }
@ -265,7 +267,8 @@ if ($multiple_delete) {
$str_ids = implode (',', $ids); $str_ids = implode (',', $ids);
if ($result) { if ($result) {
db_pandora_audit( "Module management", "Multiple delete network component: $str_ids"); db_pandora_audit( "Module management", "Multiple delete network component: $str_ids");
} else { }
else {
db_pandora_audit( "Module management", "Fail try to delete network component: $str_ids"); db_pandora_audit( "Module management", "Fail try to delete network component: $str_ids");
} }

View File

@ -205,12 +205,15 @@ if (isset($_GET["create"])) {
// -------------------------------- // --------------------------------
//Pandora Admin must see all columns //Pandora Admin must see all columns
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl ($config['id_user'], 0, "PM")) {
$sql = sprintf('SELECT * FROM trecon_task RT, tusuario_perfil UP WHERE $sql = sprintf('SELECT *
FROM trecon_task RT, tusuario_perfil UP
WHERE
UP.id_usuario = "%s" AND UP.id_grupo = RT.id_group', UP.id_usuario = "%s" AND UP.id_grupo = RT.id_group',
$config['id_user']); $config['id_user']);
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql);
} else { }
else {
$result = db_get_all_rows_in_table('trecon_task'); $result = db_get_all_rows_in_table('trecon_task');
} }
$color=1; $color=1;
@ -226,7 +229,6 @@ if ($result !== false) {
$table->style[8] = 'text-align: center;'; $table->style[8] = 'text-align: center;';
foreach ($result as $row) { foreach ($result as $row) {
$data = array(); $data = array();
$data[0] = '<a href="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&crt=update&update='.$row["id_rt"].'&upd='.$row["id_rt"].'"><b>'.$row["name"].'</b></a>'; $data[0] = '<a href="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&crt=update&update='.$row["id_rt"].'&upd='.$row["id_rt"].'"><b>'.$row["name"].'</b></a>';
@ -240,7 +242,8 @@ if ($result !== false) {
// Network recon task // Network recon task
$data[2] = html_print_image ("images/network.png", true, array ("title" => __('Network recon task')))."&nbsp;&nbsp;"; $data[2] = html_print_image ("images/network.png", true, array ("title" => __('Network recon task')))."&nbsp;&nbsp;";
$data[2] .= network_profiles_get_name ($row["id_network_profile"]); $data[2] .= network_profiles_get_name ($row["id_network_profile"]);
} else { }
else {
// APP recon task // APP recon task
$data[2] = html_print_image ("images/plugin.png", true). "&nbsp;&nbsp;"; $data[2] = html_print_image ("images/plugin.png", true). "&nbsp;&nbsp;";
$data[2] .= db_get_sql (sprintf("SELECT name FROM trecon_script WHERE id_recon_script = %d", $row["id_recon_script"])); $data[2] .= db_get_sql (sprintf("SELECT name FROM trecon_script WHERE id_recon_script = %d", $row["id_recon_script"]));
@ -250,7 +253,8 @@ if ($result !== false) {
// GROUP // GROUP
if ($row["id_recon_script"] == 0) { if ($row["id_recon_script"] == 0) {
$data[3] = ui_print_group_icon ($row["id_group"], true); $data[3] = ui_print_group_icon ($row["id_group"], true);
} else { }
else {
$data[3] = "-"; $data[3] = "-";
} }
@ -260,7 +264,8 @@ if ($result !== false) {
// OS // OS
if ($row["id_recon_script"] == 0) { if ($row["id_recon_script"] == 0) {
$data[5] =(($row["id_os"] > 0) ? ui_print_os_icon ($row["id_os"], false, true) : __('Any')); $data[5] =(($row["id_os"] > 0) ? ui_print_os_icon ($row["id_os"], false, true) : __('Any'));
} else { }
else {
$data[5] = "-"; $data[5] = "-";
} }
// INTERVAL // INTERVAL
@ -272,7 +277,8 @@ if ($result !== false) {
// PORTS // PORTS
if ($row["id_recon_script"] == 0) { if ($row["id_recon_script"] == 0) {
$data[7] = substr($row["recon_ports"],0,15); $data[7] = substr($row["recon_ports"],0,15);
} else { }
else {
$data[7] = "-"; $data[7] = "-";
} }
@ -292,7 +298,8 @@ if ($result !== false) {
html_print_table ($table); html_print_table ($table);
unset ($table); unset ($table);
} else { }
else {
echo '<div class="nf">'.__('There are no recon task configured').'</div>'; echo '<div class="nf">'.__('There are no recon task configured').'</div>';
} }
@ -301,5 +308,4 @@ echo '<form method="post" action="index.php?sec=gservers&sec2=godmode/servers/ma
echo html_print_submit_button (__('Create'),"crt",false,'class="sub next"',true); echo html_print_submit_button (__('Create'),"crt",false,'class="sub next"',true);
echo '</form>'; echo '</form>';
echo "</div>"; echo "</div>";
?> ?>

View File

@ -128,8 +128,8 @@ else { // Main list view for Links editor
if (empty($rows)) { if (empty($rows)) {
echo '<div class="nf">'.__("There isn't links").'</div>'; echo '<div class="nf">'.__("There isn't links").'</div>';
}
} else { else {
echo "<table cellpadding='4' cellspacing='4' class='databox' style='width:98%'>"; echo "<table cellpadding='4' cellspacing='4' class='databox' style='width:98%'>";
echo "<th width='180px'>".__('Link name')."</th>"; echo "<th width='180px'>".__('Link name')."</th>";
echo "<th width='80px'>".__('Delete')."</th>"; echo "<th width='80px'>".__('Delete')."</th>";

View File

@ -133,7 +133,6 @@ $buttons = array(
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=builder">' . 'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=builder">' .
html_print_image ("images/config.png", true, array ("title" => __('Builder OS'))) .'</a>')); html_print_image ("images/config.png", true, array ("title" => __('Builder OS'))) .'</a>'));
$buttons[$tab]['active'] = true; $buttons[$tab]['active'] = true;
// Header // Header

View File

@ -75,6 +75,7 @@ if ($id_profile || $new_profile) {
require ("general/footer.php"); require ("general/footer.php");
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
exit; exit;
} }
@ -143,12 +144,12 @@ if ($id_profile || $new_profile) {
if ($new_profile) { if ($new_profile) {
html_print_submit_button (__('Add'), "crt", false, 'class="sub wand"'); html_print_submit_button (__('Add'), "crt", false, 'class="sub wand"');
html_print_input_hidden ('create_profile', 1); html_print_input_hidden ('create_profile', 1);
} else { }
else {
html_print_input_hidden ('id', $id_profile); html_print_input_hidden ('id', $id_profile);
html_print_input_hidden ('update_profile', 1); html_print_input_hidden ('update_profile', 1);
html_print_submit_button (__('Update'), "upd", false, 'class="sub upd"'); html_print_submit_button (__('Update'), "upd", false, 'class="sub upd"');
} }
echo "</div></form>"; echo "</div></form>";
} }
?> ?>

View File

@ -393,6 +393,7 @@ function menu_get_sec_pages($sec,$menu_hash = false) {
else { else {
$menu = json_decode(base64_decode($menu_hash),true); $menu = json_decode(base64_decode($menu_hash),true);
} }
// Get the sec2 of the main section // Get the sec2 of the main section
$sec2_array[$menu[$sec]['sec2']] = $menu[$sec]['text']; $sec2_array[$menu[$sec]['sec2']] = $menu[$sec]['text'];

View File

@ -1314,7 +1314,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
break; break;
default: default:
enterprise_hook("enterprise_visual_map_print_item", enterprise_hook("enterprise_visual_map_print_item",
array($layout_data, $status, $colorStatus)); array($layout_data, $status, $colorStatus, 'operation'));
break; break;
} }

View File

@ -317,7 +317,6 @@ function parse_oracle_dump($connection, $url, $debug = false) {
} }
function oracle_drop_all_objects ($connection) { function oracle_drop_all_objects ($connection) {
//Drop all objects of the current installation //Drop all objects of the current installation
$stmt = oci_parse($connection, $stmt = oci_parse($connection,
"BEGIN " . "BEGIN " .
@ -625,8 +624,7 @@ function install_step3() {
if (!$error) { if (!$error) {
echo "<div align='right'><br> echo "<div align='right'><br>
<input type='image' src='images/arrow_next.png' value='Step #4' id='step4'> <input type='image' src='images/arrow_next.png' value='Step #4' id='step4'>
</div> </div>";
";
} }
echo "</form> echo "</form>
</div>"; </div>";

View File

@ -85,7 +85,6 @@ if ($idAgent != 0) {
$idGroup = false; $idGroup = false;
$print_agent = false; $print_agent = false;
} }
else { else {
if (!check_acl ($config["id_user"], 0, "AR")) { if (!check_acl ($config["id_user"], 0, "AR")) {

View File

@ -77,23 +77,24 @@ if ($moduletype_name == "log4x") {
if ($selection_mode == "fromnow") { if ($selection_mode == "fromnow") {
$sql_body = sprintf ("FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND message like '%s' AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, get_system_time () - $period); $sql_body = sprintf ("FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND message like '%s' AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, get_system_time () - $period);
} else { }
else {
$sql_body = sprintf ("FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND message like '%s' AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, $datetime_from, $datetime_to); $sql_body = sprintf ("FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND message like '%s' AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, $datetime_from, $datetime_to);
} }
$columns = array( $columns = array(
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ), "Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ),
"Sev" => array("severity", "modules_format_data", "align" => "center", "width" => "70px"), "Sev" => array("severity", "modules_format_data", "align" => "center", "width" => "70px"),
"Message"=> array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"), "Message"=> array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"),
"StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%") "StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%")
); );
}
} else if (preg_match ("/string/", $moduletype_name)) { else if (preg_match ("/string/", $moduletype_name)) {
$sql_freestring = '%' . $freestring . '%'; $sql_freestring = '%' . $freestring . '%';
if ($selection_mode == "fromnow") { if ($selection_mode == "fromnow") {
$sql_body = sprintf (" FROM tagente_datos_string WHERE id_agente_modulo = %d AND datos like '%s' AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, get_system_time () - $period); $sql_body = sprintf (" FROM tagente_datos_string WHERE id_agente_modulo = %d AND datos like '%s' AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, get_system_time () - $period);
} else { }
else {
$sql_body = sprintf (" FROM tagente_datos_string WHERE id_agente_modulo = %d AND datos like '%s' AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, $datetime_from, $datetime_to); $sql_body = sprintf (" FROM tagente_datos_string WHERE id_agente_modulo = %d AND datos like '%s' AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, $datetime_from, $datetime_to);
} }
@ -102,10 +103,12 @@ if ($moduletype_name == "log4x") {
"Data" => array("datos", "modules_format_data", "align" => "left"), "Data" => array("datos", "modules_format_data", "align" => "left"),
"Time" => array("utimestamp", "modules_format_time", "align" => "center") "Time" => array("utimestamp", "modules_format_time", "align" => "center")
); );
} else { }
else {
if ($selection_mode == "fromnow") { if ($selection_mode == "fromnow") {
$sql_body = sprintf (" FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, get_system_time () - $period); $sql_body = sprintf (" FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, get_system_time () - $period);
} else { }
else {
$sql_body = sprintf (" FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $datetime_from, $datetime_to); $sql_body = sprintf (" FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $datetime_from, $datetime_to);
} }

View File

@ -106,7 +106,8 @@ if ($save != '' && check_acl ($config["id_user"], 0, "AW")) {
if ($filter_id === false) { if ($filter_id === false) {
$filter_id = 0; $filter_id = 0;
echo '<h3 class="error">'.__ ('Error creating filter').'</h3>'; echo '<h3 class="error">'.__ ('Error creating filter').'</h3>';
} else { }
else {
echo '<h3 class="suc">'.__ ('Filter created successfully').'</h3>'; echo '<h3 class="suc">'.__ ('Filter created successfully').'</h3>';
} }
} }

View File

@ -46,7 +46,8 @@ if($update_date){
$date = get_parameter_post ('date'); $date = get_parameter_post ('date');
$time = get_parameter_post ('time'); $time = get_parameter_post ('time');
$interval = get_parameter('period','86400'); $interval = get_parameter('period','86400');
} else { }
else {
$date = date ("Y/m/d", get_system_time ()); $date = date ("Y/m/d", get_system_time ());
$time = date ("H:i:s", get_system_time ()); $time = date ("H:i:s", get_system_time ());
$interval ='86400'; $interval ='86400';

View File

@ -113,6 +113,7 @@ if (! $id_report) {
db_pandora_audit("HACK Attempt", db_pandora_audit("HACK Attempt",
"Trying to access graph viewer without valid ID"); "Trying to access graph viewer without valid ID");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
} }
@ -273,7 +274,8 @@ foreach ($contents as $content) {
$sla_value = reporting_get_agentmodule_sla ($sla['id_agent_module'], $content['period'], $sla['sla_min'], $sla['sla_max'], $datetime, $content, $content['time_from'], $content['time_to']); $sla_value = reporting_get_agentmodule_sla ($sla['id_agent_module'], $content['period'], $sla['sla_min'], $sla['sla_max'], $datetime, $content, $content['time_from'], $content['time_to']);
if ($sla_value === false) { if ($sla_value === false) {
$sla_data["error"] = __('Unknown'); $sla_data["error"] = __('Unknown');
} else { }
else {
if ($sla_value < $sla['sla_limit']) { if ($sla_value < $sla['sla_limit']) {
$sla_data["failed"] = true; $sla_data["failed"] = true;
} }
@ -288,7 +290,8 @@ foreach ($contents as $content) {
$monitor_value = reporting_get_agentmodule_sla ($content['id_agent_module'], $content['period'], 1, false, $datetime); $monitor_value = reporting_get_agentmodule_sla ($content['id_agent_module'], $content['period'], 1, false, $datetime);
if ($monitor_value === false) { if ($monitor_value === false) {
$monitor_value = __('Unknown'); $monitor_value = __('Unknown');
} else { }
else {
$monitor_value = format_numeric ($monitor_value); $monitor_value = format_numeric ($monitor_value);
} }
$data["objdata"]["good"] = $monitor_value; $data["objdata"]["good"] = $monitor_value;
@ -303,7 +306,8 @@ foreach ($contents as $content) {
$data["objdata"] = reporting_get_agentmodule_data_average ($content['id_agent_module'], $content['period'], $datetime); $data["objdata"] = reporting_get_agentmodule_data_average ($content['id_agent_module'], $content['period'], $datetime);
if ($data["objdata"] === false) { if ($data["objdata"] === false) {
$data["objdata"] = __('Unknown'); $data["objdata"] = __('Unknown');
} else { }
else {
$data["objdata"] = format_numeric ($data["objdata"]); $data["objdata"] = format_numeric ($data["objdata"]);
} }
break; break;
@ -313,7 +317,8 @@ foreach ($contents as $content) {
$data["objdata"] = reporting_get_agentmodule_data_max ($content['id_agent_module'], $content['period'], $datetime); $data["objdata"] = reporting_get_agentmodule_data_max ($content['id_agent_module'], $content['period'], $datetime);
if ($data["objdata"] === false) { if ($data["objdata"] === false) {
$data["objdata"] = __('Unknown'); $data["objdata"] = __('Unknown');
} else { }
else {
$data["objdata"] = format_numeric ($data["objdata"]); $data["objdata"] = format_numeric ($data["objdata"]);
} }
break; break;
@ -323,7 +328,8 @@ foreach ($contents as $content) {
$data["objdata"] = reporting_get_agentmodule_data_min ($content['id_agent_module'], $content['period'], $datetime); $data["objdata"] = reporting_get_agentmodule_data_min ($content['id_agent_module'], $content['period'], $datetime);
if ($data["objdata"] === false) { if ($data["objdata"] === false) {
$data["objdata"] = __('Unknown'); $data["objdata"] = __('Unknown');
} else { }
else {
$data["objdata"] = format_numeric ($data["objdata"]); $data["objdata"] = format_numeric ($data["objdata"]);
} }
break; break;
@ -333,7 +339,8 @@ foreach ($contents as $content) {
$data["objdata"] = reporting_get_agentmodule_data_sum ($content['id_agent_module'], $content['period'], $datetime); $data["objdata"] = reporting_get_agentmodule_data_sum ($content['id_agent_module'], $content['period'], $datetime);
if ($data["objdata"] === false) { if ($data["objdata"] === false) {
$data["objdata"] = __('Unknown'); $data["objdata"] = __('Unknown');
} else { }
else {
$data["objdata"] = format_numeric ($data["objdata"]); $data["objdata"] = format_numeric ($data["objdata"]);
} }
break; break;
@ -580,7 +587,8 @@ foreach ($contents as $content) {
$ttr = reporting_get_agentmodule_ttr ($content['id_agent_module'], $content['period'], $report["datetime"]); $ttr = reporting_get_agentmodule_ttr ($content['id_agent_module'], $content['period'], $report["datetime"]);
if ($ttr === false) { if ($ttr === false) {
$ttr = __('Unknown'); $ttr = __('Unknown');
} else if ($ttr != 0) { }
else if ($ttr != 0) {
$ttr = human_time_description_raw ($ttr); $ttr = human_time_description_raw ($ttr);
} }
@ -591,7 +599,8 @@ foreach ($contents as $content) {
$tto = reporting_get_agentmodule_tto ($content['id_agent_module'], $content['period'], $report["datetime"]); $tto = reporting_get_agentmodule_tto ($content['id_agent_module'], $content['period'], $report["datetime"]);
if ($tto === false) { if ($tto === false) {
$tto = __('Unknown'); $tto = __('Unknown');
} else if ($tto != 0) { }
else if ($tto != 0) {
$tto = human_time_description_raw ($tto); $tto = human_time_description_raw ($tto);
} }
@ -602,7 +611,8 @@ foreach ($contents as $content) {
$mtbf = reporting_get_agentmodule_mtbf ($content['id_agent_module'], $content['period'], $report["datetime"]); $mtbf = reporting_get_agentmodule_mtbf ($content['id_agent_module'], $content['period'], $report["datetime"]);
if ($mtbf === false) { if ($mtbf === false) {
$mtbf = __('Unknown'); $mtbf = __('Unknown');
} else if ($mtbf != 0) { }
else if ($mtbf != 0) {
$mtbf = human_time_description_raw ($mtbf); $mtbf = human_time_description_raw ($mtbf);
} }
@ -613,7 +623,8 @@ foreach ($contents as $content) {
$mttr = reporting_get_agentmodule_mttr ($content['id_agent_module'], $content['period'], $report["datetime"]); $mttr = reporting_get_agentmodule_mttr ($content['id_agent_module'], $content['period'], $report["datetime"]);
if ($mttr === false) { if ($mttr === false) {
$mttr = __('Unknown'); $mttr = __('Unknown');
} else if ($mttr != 0) { }
else if ($mttr != 0) {
$mttr = human_time_description_raw ($mttr); $mttr = human_time_description_raw ($mttr);
} }

View File

@ -441,7 +441,8 @@ if ($traps !== false) {
//Status //Status
if ($trap["status"] == 0) { if ($trap["status"] == 0) {
$data[0] = html_print_image("images/pixel_red.png", true, array("title" => __('Not validated'), "width" => "20", "height" => "20")); $data[0] = html_print_image("images/pixel_red.png", true, array("title" => __('Not validated'), "width" => "20", "height" => "20"));
} else { }
else {
$data[0] = html_print_image("images/pixel_green.png", true, array("title" => __('Validated'), "width" => "20", "height" => "20")); $data[0] = html_print_image("images/pixel_green.png", true, array("title" => __('Validated'), "width" => "20", "height" => "20"));
} }
@ -452,7 +453,8 @@ if ($traps !== false) {
continue; continue;
} }
$data[1] = '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&new_agent=1&direccion='.$trap["source"].'" title="'.__('Create agent').'">'.$trap["source"].'</a>'; $data[1] = '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&new_agent=1&direccion='.$trap["source"].'" title="'.__('Create agent').'">'.$trap["source"].'</a>';
} else { }
else {
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR")) { if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR")) {
continue; continue;
} }
@ -541,19 +543,26 @@ if ($traps !== false) {
$trap_types = array(-1 => __('None'), 0 => __('Cold start (0)'), 1 => __('Warm start (1)'), 2 => __('Link down (2)'), 3 => __('Link up (3)'), 4 => __('Authentication failure (4)'), 5 => __('Other')); $trap_types = array(-1 => __('None'), 0 => __('Cold start (0)'), 1 => __('Warm start (1)'), 2 => __('Link down (2)'), 3 => __('Link up (3)'), 4 => __('Authentication failure (4)'), 5 => __('Other'));
switch ($trap["type"]) { switch ($trap["type"]) {
case -1: $desc_trap_type = __('None'); case -1:
$desc_trap_type = __('None');
break; break;
case 0: $desc_trap_type = __('Cold start (0)'); case 0:
$desc_trap_type = __('Cold start (0)');
break; break;
case 1: $desc_trap_type = __('Warm start (1)'); case 1:
$desc_trap_type = __('Warm start (1)');
break; break;
case 2: $desc_trap_type = __('Link down (2)'); case 2:
$desc_trap_type = __('Link down (2)');
break; break;
case 3: $desc_trap_type = __('Link up (3)'); case 3:
$desc_trap_type = __('Link up (3)');
break; break;
case 4: $desc_trap_type = __('Authentication failure (4)'); case 4:
$desc_trap_type = __('Authentication failure (4)');
break; break;
default: $desc_trap_type = __('Other'); default:
$desc_trap_type = __('Other');
break; break;
} }
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Type:') . '</td><td align="left">' . $desc_trap_type . '</td></tr>'; $string .= '<tr><td align="left" valign="top">' . '<b>' . __('Type:') . '</td><td align="left">' . $desc_trap_type . '</td></tr>';
@ -575,7 +584,8 @@ $trap_types = array(-1 => __('None'), 0 => __('Cold start (0)'), 1 => __('Warm s
// No matching traps // No matching traps
if ($idx == 0) { if ($idx == 0) {
echo '<div class="nf">'.__('No matching traps found').'</div>'; echo '<div class="nf">'.__('No matching traps found').'</div>';
} else { }
else {
html_print_table ($table); html_print_table ($table);
} }

View File

@ -646,7 +646,6 @@ if (is_ajax ())
if ($row["estado"] == 0 AND $row["utimestamp"] == 0 AND ($row["id_tipo_modulo"] >= 21 AND $row["id_tipo_modulo"] <= 23)){ if ($row["estado"] == 0 AND $row["utimestamp"] == 0 AND ($row["id_tipo_modulo"] >= 21 AND $row["id_tipo_modulo"] <= 23)){
$status = STATUS_MODULE_NO_DATA; $status = STATUS_MODULE_NO_DATA;
$title = __('UNKNOWN'); $title = __('UNKNOWN');
} // Else checks module status } // Else checks module status
elseif ($row["estado"] == 1) { elseif ($row["estado"] == 1) {
$status = STATUS_MODULE_CRITICAL; $status = STATUS_MODULE_CRITICAL;

View File

@ -113,7 +113,8 @@ if (isset ($_GET["modified"]) && !$view_mode) {
$pass_ok = login_validate_pass($password_new, $id, true); $pass_ok = login_validate_pass($password_new, $id, true);
if ($pass_ok != 1) { if ($pass_ok != 1) {
ui_print_error_message($pass_ok); ui_print_error_message($pass_ok);
} else { }
else {
$return = update_user_password ($id, $password_new); $return = update_user_password ($id, $password_new);
if ($return) { if ($return) {
$return2 = save_pass_history($id, $password_new); $return2 = save_pass_history($id, $password_new);
@ -122,14 +123,16 @@ if (isset ($_GET["modified"]) && !$view_mode) {
__('Password successfully updated'), __('Password successfully updated'),
__('Error updating passwords: %s', $config['auth_error'])); __('Error updating passwords: %s', $config['auth_error']));
} }
} else { }
else {
$return = update_user_password ($id, $password_new); $return = update_user_password ($id, $password_new);
ui_print_result_message ($return, ui_print_result_message ($return,
__('Password successfully updated'), __('Password successfully updated'),
__('Error updating passwords: %s', $config['auth_error'])); __('Error updating passwords: %s', $config['auth_error']));
} }
} elseif ($password_new !== "NON-INIT") { }
elseif ($password_new !== "NON-INIT") {
ui_print_error_message (__('Passwords didn\'t match or other problem encountered while updating passwords')); ui_print_error_message (__('Passwords didn\'t match or other problem encountered while updating passwords'));
} }
} }
@ -145,14 +148,6 @@ if (isset ($_GET["modified"]) && !$view_mode) {
__('Error updating user info')); __('Error updating user info'));
} }
// Reload page to update skin
/* if ($return){
header ('location:' . $config['homeurl'] . '/index.php?sec=workspace&sec2=operation/users/user_edit&status=1');
}
else{
header ('location:' . $config['homeurl'] . '/index.php?sec=workspace&sec2=operation/users/user_edit&status=0');
}*/
$user_info = $upd_info; $user_info = $upd_info;
} }