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:
parent
ae4a12872c
commit
f2c0c0762f
|
@ -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>
|
||||
|
||||
* extensions/agents_alerts.php, extensions/net_tools.php,
|
||||
|
|
|
@ -44,10 +44,10 @@ if ($row !== false && is_array($row)) {
|
|||
case 3:
|
||||
$ops_json = enterprise_hook('modules_get_synthetic_operations', array($id_agente_modulo));
|
||||
$ops = json_decode($ops_json, true);
|
||||
|
||||
|
||||
$first_op = explode('_', reset(array_keys($ops)));
|
||||
|
||||
if(isset($first_op[1]) && $first_op[1] == 'avg') {
|
||||
if (isset($first_op[1]) && $first_op[1] == 'avg') {
|
||||
$is_synthetic_avg = true;
|
||||
}
|
||||
else {
|
||||
|
@ -63,6 +63,7 @@ if ($row !== false && is_array($row)) {
|
|||
break;
|
||||
default:
|
||||
$prediction_module = $custom_integer_1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -102,7 +103,7 @@ $sql = "SELECT id_agente, nombre FROM tagente";
|
|||
//Image src with skins
|
||||
$src_code = html_print_image('images/lightning.png', true, false, true);
|
||||
$data[1] .= html_print_input_text_extended ('agent_name',$agent_name, 'text_agent_name', '', 30, 100, $is_service, '',
|
||||
array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true, false);
|
||||
array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true, false);
|
||||
$data[1] .= '<a href="#" class="tip"> <span>' . __("Type at least two characters to search") . '</span></a> <br/>';
|
||||
$data[1] .= html_print_label(__("Module"),'prediction_module',true);
|
||||
if($id_agente) {
|
||||
|
@ -132,9 +133,9 @@ push_table_simple ($data, 'prediction_module');
|
|||
$selector_form = enterprise_hook('get_selector_form', array($custom_integer_1));
|
||||
if ($selector_form !== ENTERPRISE_NOT_HOOK) {
|
||||
$data = array();
|
||||
$data[0] = '';
|
||||
$data[1] = $selector_form;
|
||||
|
||||
$data[0] = '';
|
||||
$data[1] = $selector_form;
|
||||
|
||||
$table_simple->colspan['service_module'][1] = 3;
|
||||
push_table_simple ($data, 'service_module');
|
||||
}
|
||||
|
@ -173,5 +174,4 @@ $(document).ready(function() {
|
|||
enterprise_hook('setup_services_synth', array($is_service, $is_synthetic, $is_synthetic_avg, $is_netflow, $ops));
|
||||
?>
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
|
@ -56,16 +56,16 @@ ui_print_page_header (__('Alerts').' » '.__('Correlated alerts'), "images/
|
|||
|
||||
if ($update_compound) {
|
||||
$id = (int) get_parameter ('id');
|
||||
|
||||
|
||||
$recovery_notify = (bool) get_parameter ('recovery_notify');
|
||||
$field2_recovery = (string) get_parameter ('field2_recovery');
|
||||
$field3_recovery = (string) get_parameter ('field3_recovery');
|
||||
|
||||
|
||||
$result = alerts_update_alert_compound ($id,
|
||||
array ('recovery_notify' => $recovery_notify,
|
||||
'field2_recovery' => $field2_recovery,
|
||||
'field3_recovery' => $field3_recovery));
|
||||
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully updated'),
|
||||
__('Could not be updated'));
|
||||
|
@ -193,7 +193,7 @@ if (count($agents)) {
|
|||
case "oracle":
|
||||
$set = array();
|
||||
$set['offset'] = get_parameter ('offset');
|
||||
$set['limit'] = $config['block_size'];
|
||||
$set['limit'] = $config['block_size'];
|
||||
$sql = sprintf ('SELECT id FROM talert_compound
|
||||
WHERE id_agent in (%s)%s',
|
||||
implode (',', array_keys ($agents)), $where);
|
||||
|
@ -201,12 +201,12 @@ if (count($agents)) {
|
|||
break;
|
||||
}
|
||||
$id_alerts = db_get_all_rows_sql ($sql);
|
||||
|
||||
|
||||
if (($config["dbtype"] == 'oracle') && ($id_alerts !== false)) {
|
||||
for ($i=0; $i < count($id_alerts); $i++) {
|
||||
unset($id_alerts[$i]['rnum']);
|
||||
unset($id_alerts[$i]['rnum']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($id_alerts === false)
|
||||
|
@ -223,7 +223,8 @@ foreach ($id_alerts as $alert) {
|
|||
if ($alert['disabled']) {
|
||||
$data[0] .= html_print_input_image ('enable', 'images/lightbulb_off.png', 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_hidden ('disable_alert', 1, true);
|
||||
}
|
||||
|
@ -244,7 +245,8 @@ foreach ($id_alerts as $alert) {
|
|||
|
||||
if (isset($data)){
|
||||
html_print_table ($table);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo "<div class='nf'>".__('No alerts found')."</div>";
|
||||
}
|
||||
|
||||
|
|
|
@ -50,29 +50,29 @@ if ($create_special_day) {
|
|||
$date = (string) get_parameter ('date');
|
||||
$same_day = (string) get_parameter ('same_day');
|
||||
$description = (string) get_parameter ('description');
|
||||
|
||||
|
||||
list($year, $month, $day) = explode("-", $date);
|
||||
if ($year == '*') {
|
||||
if ($year == '*') {
|
||||
# '0001' means every year.
|
||||
$year = '0001';
|
||||
$date = $year . '-' . $month . '-' . $day;
|
||||
}
|
||||
|
||||
if (!checkdate ($month, $day, $year)) {
|
||||
$year = '0001';
|
||||
$date = $year . '-' . $month . '-' . $day;
|
||||
}
|
||||
|
||||
if (!checkdate ($month, $day, $year)) {
|
||||
$result = '';
|
||||
}
|
||||
else {
|
||||
$date_check = db_get_value ('date', 'talert_special_days', 'date
|
||||
', $date);
|
||||
if ($date_check == $date) {
|
||||
$result = '';
|
||||
}
|
||||
', $date);
|
||||
if ($date_check == $date) {
|
||||
$result = '';
|
||||
}
|
||||
else {
|
||||
$result = alerts_create_alert_special_day ($date, $same_day, array ('description' => $description));
|
||||
$info = 'Date: ' . $date . ' Same day of the week: ' . $same_day . ' Description: ' . $description;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($result) {
|
||||
db_pandora_audit("Command management", "Create special day " . $result, false, false, $info);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ if ($update_special_day) {
|
|||
$date = (string) get_parameter ('date');
|
||||
$same_day = (string) get_parameter ('same_day');
|
||||
$description = (string) get_parameter ('description');
|
||||
|
||||
|
||||
list($year, $month, $day) = explode("-", $date);
|
||||
if ($year == '*') {
|
||||
# '0001' means every year.
|
||||
|
@ -103,7 +103,7 @@ if ($update_special_day) {
|
|||
$values['date'] = $date;
|
||||
$values['same_day'] = $same_day;
|
||||
$values['description'] = $description;
|
||||
|
||||
|
||||
if (!checkdate ($month, $day, $year)) {
|
||||
$result = '';
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ if ($update_special_day) {
|
|||
$result = alerts_update_alert_special_day ($id, $values);
|
||||
$info = 'Date: ' . $date . ' Same day of the week: ' . $same_day . ' Description: ' . $description;
|
||||
}
|
||||
|
||||
|
||||
if ($result) {
|
||||
db_pandora_audit("Command management", "Update special day " . $id, false, false, $info);
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ foreach ($special_days as $special_day) {
|
|||
$data[0] = '<span style="font-size: 7.5pt">';
|
||||
# '0001' means every year.
|
||||
$data[0] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days&id='.$special_day['id'].'">'.
|
||||
str_replace('0001', '*', $special_day['date']) . '</a>';
|
||||
str_replace('0001', '*', $special_day['date']) . '</a>';
|
||||
$data[0] .= '</span>';
|
||||
switch ($special_day['same_day']) {
|
||||
case 'monday':
|
||||
|
|
|
@ -336,9 +336,9 @@ if ($create_template) {
|
|||
$matches = (bool) get_parameter ('matches_value');
|
||||
$priority = (int) get_parameter ('priority');
|
||||
$id_group = get_parameter ("id_group");
|
||||
$name_check = db_get_value ('name', 'talert_templates', 'name', $name);
|
||||
|
||||
switch ($config['dbtype']){
|
||||
$name_check = db_get_value ('name', 'talert_templates', 'name', $name);
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$values = array ('description' => $description,
|
||||
|
@ -511,7 +511,8 @@ if ($step == 2) {
|
|||
$table->data[4][1] = html_print_select_from_sql ($sql_query,
|
||||
'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);
|
||||
} else if ($step == 3) {
|
||||
}
|
||||
else if ($step == 3) {
|
||||
/* Alert recover */
|
||||
if (! $recovery_notify) {
|
||||
$table->rowstyle = array ();
|
||||
|
@ -531,7 +532,8 @@ if ($step == 2) {
|
|||
$table->data['field3'][0] = __('Field 3');
|
||||
$table->data['field3'][1] = html_print_textarea ('field3_recovery', 10, 30,
|
||||
$field3_recovery, '', true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
/* Step 1 by default */
|
||||
$table->size = array ();
|
||||
$table->size[0] = '20%';
|
||||
|
@ -543,39 +545,39 @@ if ($step == 2) {
|
|||
|
||||
$show_matches = false;
|
||||
switch ($type) {
|
||||
case "equal":
|
||||
case "not_equal":
|
||||
case "regex":
|
||||
$show_matches = true;
|
||||
$table->rowstyle['value'] = '';
|
||||
break;
|
||||
case "max_min":
|
||||
$show_matches = true;
|
||||
case "max":
|
||||
$table->rowstyle['max'] = '';
|
||||
if ($type == 'max')
|
||||
case "equal":
|
||||
case "not_equal":
|
||||
case "regex":
|
||||
$show_matches = true;
|
||||
$table->rowstyle['value'] = '';
|
||||
break;
|
||||
case "max_min":
|
||||
$show_matches = true;
|
||||
case "max":
|
||||
$table->rowstyle['max'] = '';
|
||||
if ($type == 'max')
|
||||
break;
|
||||
case "min":
|
||||
$table->rowstyle['min'] = '';
|
||||
break;
|
||||
case "onchange":
|
||||
$show_matches = true;
|
||||
break;
|
||||
case "min":
|
||||
$table->rowstyle['min'] = '';
|
||||
break;
|
||||
case "onchange":
|
||||
$show_matches = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text ('name', $name, '', 35, 255, true);
|
||||
|
||||
|
||||
$table->data[0][1] .= " ". __("Group");
|
||||
$groups = users_get_groups ();
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
// Only display group "All" if user is administrator or has "PM" privileges
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
|
||||
$display_all_group = true;
|
||||
else
|
||||
else
|
||||
$display_all_group = false;
|
||||
$table->data[0][1] .= " ".html_print_select_groups(false, "AR", $display_all_group, 'id_group', $id_group, '', '', 0, true);
|
||||
|
||||
|
||||
$table->data[1][0] = __('Description');
|
||||
$table->data[1][1] = html_print_textarea ('description', 10, 30,
|
||||
$description, '', true);
|
||||
|
@ -592,7 +594,7 @@ if ($step == 2) {
|
|||
$table->data[3][1] .= html_print_label (__('Trigger when matches the value'),
|
||||
'checkbox-matches_value', true);
|
||||
$table->data[3][1] .= '</span>';
|
||||
|
||||
|
||||
$table->data['value'][0] = __('Value');
|
||||
$table->data['value'][1] = html_print_input_text ('value', $value, '',
|
||||
35, 255, true);
|
||||
|
@ -606,7 +608,7 @@ if ($step == 2) {
|
|||
'id' => 'regex_bad',
|
||||
'title' => __('The regular expression is not valid')));
|
||||
$table->data['value'][1] .= '</span>';
|
||||
|
||||
|
||||
//Min first, then max, that's more logical
|
||||
$table->data['min'][0] = __('Min.');
|
||||
$table->data['min'][1] = html_print_input_text ('min', $min, '', 5, 255, true);
|
||||
|
@ -621,7 +623,8 @@ if ($step == 2) {
|
|||
/* 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">';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo '<form method="post">';
|
||||
}
|
||||
html_print_table ($table);
|
||||
|
@ -630,13 +633,15 @@ echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
|||
if ($id) {
|
||||
html_print_input_hidden ('id', $id);
|
||||
html_print_input_hidden ('update_template', 1);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_hidden ('create_template', 1);
|
||||
}
|
||||
|
||||
if ($step >= LAST_STEP) {
|
||||
html_print_submit_button (__('Finish'), 'finish', false, 'class="sub upd"');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_hidden ('step', $step + 1);
|
||||
html_print_submit_button (__('Next'), 'next', false, 'class="sub next"');
|
||||
}
|
||||
|
@ -685,7 +690,8 @@ function render_example () {
|
|||
vmax = parseInt ($("input#text-max").attr ("value"));
|
||||
if (isNaN (vmax) || vmax == "") {
|
||||
$("span#max").empty ().append ("0");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("span#max").empty ().append (vmax);
|
||||
}
|
||||
|
||||
|
@ -693,7 +699,8 @@ function render_example () {
|
|||
vmin = parseInt ($("input#text-min").attr ("value"));
|
||||
if (isNaN (vmin) || vmin == "") {
|
||||
$("span#min").empty ().append ("0");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("span#min").empty ().append (vmin);
|
||||
}
|
||||
|
||||
|
@ -701,7 +708,8 @@ function render_example () {
|
|||
vvalue = $("input#text-value").attr ("value");
|
||||
if (vvalue == "") {
|
||||
$("span#value").empty ().append ("<em><?php echo __('Empty');?></em>");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("span#value").empty ().append (vvalue);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,20 +41,24 @@ $buttons = array(
|
|||
'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=fields">' .
|
||||
html_print_image("images/god6.png", true, array ("title" => __('Custom fields'))) . '</a>'),
|
||||
);
|
||||
|
||||
switch ($section){
|
||||
case 'filter': $buttons['filter']['active'] = true;
|
||||
$subpage = ' - ' . __('Filters');
|
||||
break;
|
||||
case 'fields': $buttons['fields']['active'] = true;
|
||||
$subpage = ' - ' . __('Custom fields');
|
||||
break;
|
||||
case 'view': $buttons['view']['active'] = true;
|
||||
break;
|
||||
default: $buttons['filter']['active'] = true;
|
||||
$subpage = ' - ' . __('Filters');
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($section) {
|
||||
case 'filter':
|
||||
$buttons['filter']['active'] = true;
|
||||
$subpage = ' - ' . __('Filters');
|
||||
break;
|
||||
case 'fields':
|
||||
$buttons['fields']['active'] = true;
|
||||
$subpage = ' - ' . __('Custom fields');
|
||||
break;
|
||||
case 'view':
|
||||
$buttons['view']['active'] = true;
|
||||
break;
|
||||
default:
|
||||
$buttons['filter']['active'] = true;
|
||||
$subpage = ' - ' . __('Filters');
|
||||
break;
|
||||
}
|
||||
|
||||
ui_print_page_header (__("Manage events") . $subpage, "images/lightning_go.png", false, "", true, $buttons);
|
||||
|
||||
|
@ -68,4 +72,4 @@ switch($section) {
|
|||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
|
@ -53,13 +53,13 @@ if ($id_group) {
|
|||
else {
|
||||
echo "<h3 class='error'>".__('There was a problem loading group')."</h3>";
|
||||
echo "</table>";
|
||||
echo '</div>';
|
||||
echo '<div style="clear:both"> </div>';
|
||||
echo '</div>';
|
||||
echo '<div id="foot">';
|
||||
require ("general/footer.php");
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '<div style="clear:both"> </div>';
|
||||
echo '</div>';
|
||||
echo '<div id="foot">';
|
||||
require ("general/footer.php");
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,16 +42,17 @@ if ($id_group) {
|
|||
$group = db_get_row ('tmodule_group', 'id_mg', $id_group);
|
||||
if ($group) {
|
||||
$name = $group["name"];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo "<h3 class='error'>".__('There was a problem loading group')."</h3>";
|
||||
echo "</table>";
|
||||
echo '</div>';
|
||||
echo '<div style="clear:both"> </div>';
|
||||
echo '</div>';
|
||||
echo '<div id="foot">';
|
||||
require ("general/footer.php");
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo "</table>";
|
||||
echo '</div>';
|
||||
echo '<div style="clear:both"> </div>';
|
||||
echo '</div>';
|
||||
echo '<div id="foot">';
|
||||
require ("general/footer.php");
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -71,11 +72,11 @@ if ($id_group) {
|
|||
html_print_input_hidden ('update_group', 1);
|
||||
html_print_input_hidden ('id_group', $id_group);
|
||||
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_hidden ('create_group', 1);
|
||||
html_print_submit_button (__('Create'), 'crtbutton', false, 'class="sub wand"');
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
?>
|
||||
|
||||
?>
|
|
@ -93,7 +93,7 @@ if ($add) {
|
|||
$results = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
db_pandora_audit("Masive management", "Add alert action " . json_encode($id_agents), false, false, 'Agents: ' .
|
||||
json_encode($id_agents) . ' Alerts : ' . json_encode($agent_alerts) .
|
||||
' Fires Min: ' . $fires_min . ' Fires Max: ' . $fires_max . ' Actions: ' . implode(',',$actions));
|
||||
|
@ -204,44 +204,45 @@ $(document).ready (function () {
|
|||
$("option", $select_template).remove ();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#id_agents").change (function () {
|
||||
update_alerts();
|
||||
});
|
||||
|
||||
|
||||
function update_alerts() {
|
||||
var idAgents = Array();
|
||||
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
||||
idAgents.push($(val).val());
|
||||
});
|
||||
});
|
||||
$("#template_loading").show();
|
||||
|
||||
|
||||
var $select_template = $("#id_alert_templates").disable ();
|
||||
$("option", $select_template).remove ();
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "godmode/massive/massive_add_action_alerts",
|
||||
{
|
||||
"page" : "godmode/massive/massive_add_action_alerts",
|
||||
"get_alerts" : 1,
|
||||
"id_agents[]" : idAgents
|
||||
},
|
||||
function (data, status) {
|
||||
options = "";
|
||||
jQuery.each (data, function (id, value) {
|
||||
options += "<option value=\""+id+"\">"+value+"</option>";
|
||||
});
|
||||
|
||||
if(options == "") {
|
||||
options += "<option><?php echo __('None'); ?></option>";
|
||||
}
|
||||
|
||||
$("#id_alert_templates").append (options);
|
||||
$("#template_loading").hide ();
|
||||
$select_template.enable ();
|
||||
},
|
||||
"json"
|
||||
);
|
||||
},
|
||||
function (data, status) {
|
||||
options = "";
|
||||
jQuery.each (data, function (id, value) {
|
||||
options += "<option value=\""+id+"\">"+value+"</option>";
|
||||
});
|
||||
|
||||
if (options == "") {
|
||||
options += "<option><?php echo __('None'); ?></option>";
|
||||
}
|
||||
|
||||
$("#id_alert_templates").append (options);
|
||||
$("#template_loading").hide ();
|
||||
$select_template.enable ();
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$("a.show_advanced_actions").click (function () {
|
||||
/* It can be done in two different sites, so it must use two different selectors */
|
||||
actions = $(this).parents ("form").children ("span.advanced_actions");
|
||||
|
@ -249,10 +250,11 @@ $(document).ready (function () {
|
|||
actions = $(this).parents ("div").children ("span.advanced_actions")
|
||||
$("#advanced_actions").removeClass("advanced_actions invisible");
|
||||
$(this).remove ();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#id_group').trigger('change');
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
</script>
|
|
@ -242,7 +242,7 @@ $groups[0] = __('All');
|
|||
$table->colspan[2][1] = 2;
|
||||
$table->data[2][1] = html_print_select ($groups, 'groups_select',
|
||||
'', true, __('Select'), -1, true, false, true, '', false, 'width:100%').
|
||||
' '.__('Group recursion').' '.html_print_checkbox ("recursion", 1, false, true, false);
|
||||
' ' . __('Group recursion') . ' ' . html_print_checkbox ("recursion", 1, false, true, false);
|
||||
$table->data[2][3] = __('Select all modules of this group').' '.html_print_checkbox_extended ("force_group", 'group', '', '', false, '', 'style="margin-right: 40px;"', true);
|
||||
|
||||
$table->rowstyle[3] = 'vertical-align: top;';
|
||||
|
@ -257,7 +257,7 @@ $table->data[3][2] .= html_print_select (array('common' => __('Show common agent
|
|||
'common', false, '', '', true, false, true, '', false);
|
||||
$table->data[3][3] = html_print_select (array(), 'agents[]',
|
||||
$agents_select, false, __('None'), 0, true, true, false, '', false, 'width:100%');
|
||||
|
||||
|
||||
$table->rowstyle[4] = 'vertical-align: top;';
|
||||
$table->rowclass[4] = 'select_agents_row select_agents_row_2';
|
||||
$table->data[4][0] = __('Agents');
|
||||
|
@ -303,10 +303,10 @@ $(document).ready (function () {
|
|||
$("#module_name").change(module_changed_by_multiple_modules);
|
||||
|
||||
clean_lists();
|
||||
|
||||
|
||||
$(".select_modules_row").css('display', '<?php echo $modules_row?>');
|
||||
$(".select_agents_row").css('display', '<?php echo $agents_row?>');
|
||||
|
||||
|
||||
// Trigger change to refresh selection when change selection mode
|
||||
$("#agents_selection_mode").change (function() {
|
||||
$("#module_name").trigger('change');
|
||||
|
@ -337,7 +337,7 @@ $(document).ready (function () {
|
|||
else {
|
||||
filter = "id_tipo_modulo="+this.value;
|
||||
}
|
||||
|
||||
|
||||
$("#module_loading").show ();
|
||||
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
|
||||
$("#module_name").attr ("disabled", "disabled")
|
||||
|
|
|
@ -49,7 +49,7 @@ if ($delete_profiles) {
|
|||
$profiles_id = get_parameter ('profiles_id', -1);
|
||||
$groups_id = get_parameter ('groups_id', -1);
|
||||
$users_id = get_parameter ('users_id', -1);
|
||||
|
||||
|
||||
if($profiles_id == -1 || $groups_id == -1 || $users_id == -1){
|
||||
$result = false;
|
||||
}
|
||||
|
@ -57,19 +57,18 @@ if ($delete_profiles) {
|
|||
foreach($profiles_id as $profile) {
|
||||
foreach($groups_id as $group) {
|
||||
foreach($users_id as $id_up) {
|
||||
if ($id_up == 0){
|
||||
if ($id_up == 0) {
|
||||
echo '<h3 class="error">'.__('Not deleted. You must select an existing user').'</h3>';
|
||||
$result="";
|
||||
}
|
||||
else{
|
||||
}
|
||||
else {
|
||||
$user = (string) db_get_value_filter ('id_usuario', 'tusuario_perfil', array('id_up' => $id_up));
|
||||
|
||||
|
||||
db_pandora_audit("User management",
|
||||
"Deleted profile for user ".io_safe_input($user));
|
||||
|
||||
|
||||
$result = profile_delete_user_profile ($user, $id_up);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -120,7 +119,7 @@ $data[2] .= '</span>';
|
|||
$users_profiles = "";
|
||||
|
||||
$data[2] .= html_print_select (array(), 'users_id[]', '', '', '',
|
||||
'', true, true, true, '', false, 'width: 100%');
|
||||
'', true, true, true, '', false, 'width: 100%');
|
||||
|
||||
|
||||
array_push ($table->data, $data);
|
||||
|
@ -168,7 +167,7 @@ $(document).ready (function () {
|
|||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$("#groups_id").change (function () {
|
||||
update_users();
|
||||
});
|
||||
|
@ -178,4 +177,4 @@ $(document).ready (function () {
|
|||
});
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
</script>
|
|
@ -310,7 +310,7 @@ $groups[0] = __('All');
|
|||
$table->colspan[2][1] = 2;
|
||||
$table->data[2][1] = html_print_select ($groups, 'groups_select',
|
||||
'', true, __('Select'), -1, true, false, true).
|
||||
' '.__('Group recursion').' '.html_print_checkbox ("recursion", 1, false, true, false);
|
||||
' '.__('Group recursion').' '.html_print_checkbox ("recursion", 1, false, true, false);
|
||||
$table->data[2][3] = __('Select all modules of this group').' '.html_print_checkbox_extended ("force_group", 'group', '', '', false, '', 'style="margin-right: 40px;"', true);
|
||||
|
||||
$table->rowstyle[3] = 'vertical-align: top;';
|
||||
|
@ -325,13 +325,13 @@ $table->data[3][2] .= html_print_select (array('common' => __('Show common agent
|
|||
'common', false, '', '', true);
|
||||
$table->data[3][3] = html_print_select (array(), 'agents[]',
|
||||
$agents_select, false, __('None'), 0, true, true, false);
|
||||
|
||||
|
||||
$table->rowstyle[4] = 'vertical-align: top;';
|
||||
$table->rowclass[4] = 'select_agents_row select_agents_row_2';
|
||||
$table->data[4][0] = __('Agents');
|
||||
$table->data[4][1] = html_print_select ($agents, 'id_agents[]',
|
||||
$agents_id, false, '', '', true, true, false);
|
||||
|
||||
|
||||
$table->data[4][2] = __('When select agents');
|
||||
$table->data[4][2] .= '<br>';
|
||||
$table->data[4][2] .= html_print_select (array('common' => __('Show common modules'), 'all' => __('Show all modules')), 'modules_selection_mode',
|
||||
|
|
|
@ -136,14 +136,14 @@ $table->data[1][0] .= '<span id="agent_loading" class="invisible">';
|
|||
$table->data[1][0] .= html_print_image("images/spinner.png", true);
|
||||
$table->data[1][0] .= '</span>';
|
||||
$table->data[1][1] = html_print_select (agents_get_group_agents ($id_group, false, "none"),
|
||||
'id_agents[]', 0, false, '', '', true, true);
|
||||
'id_agents[]', 0, false, '', '', true, true);
|
||||
|
||||
$table->data[2][0] = __('Alert template');
|
||||
$table->data[2][0] .= '<span id="template_loading" class="invisible">';
|
||||
$table->data[2][0] .= html_print_image("images/spinner.png", true);
|
||||
$table->data[2][0] .= '</span>';
|
||||
$table->data[2][1] = html_print_select ('', 'id_alert_templates[]', '', '', '', '', true, true, true, '', true);
|
||||
|
||||
|
||||
$table->data[3][0] = __('Enabled alerts').ui_print_help_tip(__('Format').":<br> ".__('Agent')." - ".__('Module'), true);
|
||||
$table->data[3][0] .= '<span id="alerts_loading" class="invisible">';
|
||||
$table->data[3][0] .= html_print_image("images/spinner.png", true);
|
||||
|
@ -181,21 +181,21 @@ ui_require_jquery_file ('pandora.controls');
|
|||
/* <![CDATA[ */
|
||||
$(document).ready (function () {
|
||||
clear_alert_fields();
|
||||
|
||||
|
||||
var recursion;
|
||||
$("#checkbox-recursion").click(function (){
|
||||
recursion = this.checked ? 1 : 0;
|
||||
$("#id_group").trigger("change");
|
||||
});
|
||||
|
||||
|
||||
$("#id_group").pandoraSelectGroupAgent ({
|
||||
agentSelect: "select#id_agents",
|
||||
agentSelect: "select#id_agents",
|
||||
recursion: function() {return recursion},
|
||||
callbackPost: function () {
|
||||
clear_alert_fields();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#id_agents").change (function () {
|
||||
clear_alert_fields();
|
||||
update_alert_templates();
|
||||
|
@ -205,7 +205,8 @@ $(document).ready (function () {
|
|||
if (this.value != 0) {
|
||||
$("#id_enabled_alerts").enable ();
|
||||
$("#id_disabled_alerts").enable ();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("#id_enabled_alerts").disable ();
|
||||
$("#id_disabled_alerts").disable ();
|
||||
}
|
||||
|
@ -217,11 +218,11 @@ $(document).ready (function () {
|
|||
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
||||
idAgents.push($(val).val());
|
||||
});
|
||||
$("#template_loading").show();
|
||||
|
||||
$("#template_loading").show();
|
||||
|
||||
var $select_template = $("#id_alert_templates").disable ();
|
||||
$("option", $select_template).remove ();
|
||||
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "godmode/massive/massive_enable_disable_alerts",
|
||||
"get_alerts" : 1,
|
||||
|
@ -249,8 +250,8 @@ $(document).ready (function () {
|
|||
var idAlertTemplates = Array();
|
||||
jQuery.each ($("#id_alert_templates option:selected"), function (i, val) {
|
||||
idAlertTemplates.push($(val).val());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var $select = $("#id_enabled_alerts").disable ();
|
||||
var $select2 = $("#id_disabled_alerts").disable ();
|
||||
$("#alerts_loading").show ();
|
||||
|
@ -298,16 +299,15 @@ $(document).ready (function () {
|
|||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
function clear_alert_fields() {
|
||||
var $select_template = $("#id_alert_templates").disable ();
|
||||
var $select_enabled = $("#id_enabled_alerts").disable ();
|
||||
var $select_disabled = $("#id_disabled_alerts").disable ();
|
||||
$("option", $select_template).remove ();
|
||||
$("option", $select_enabled).remove ();
|
||||
$("option", $select_disabled).remove ();
|
||||
}
|
||||
|
||||
function clear_alert_fields() {
|
||||
var $select_template = $("#id_alert_templates").disable ();
|
||||
var $select_enabled = $("#id_enabled_alerts").disable ();
|
||||
var $select_disabled = $("#id_disabled_alerts").disable ();
|
||||
$("option", $select_template).remove ();
|
||||
$("option", $select_enabled).remove ();
|
||||
$("option", $select_disabled).remove ();
|
||||
}
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
</script>
|
|
@ -33,9 +33,9 @@ $tab = (string) get_parameter ('tab', 'massive_agents');
|
|||
$option = (string) get_parameter ('option', '');
|
||||
|
||||
$options_alerts = array('add_alerts' => __('Massive alerts addition'), 'delete_alerts' => __('Massive alerts deletion'),
|
||||
'add_action_alerts' => __('Massive alert actions addition'), 'delete_action_alerts' => __('Massive alert actions deletion'),
|
||||
'enable_disable_alerts' => __('Massive alert enable/disable'), 'standby_alerts' => __('Massive alert setting standby'));
|
||||
|
||||
'add_action_alerts' => __('Massive alert actions addition'), 'delete_action_alerts' => __('Massive alert actions deletion'),
|
||||
'enable_disable_alerts' => __('Massive alert enable/disable'), 'standby_alerts' => __('Massive alert setting standby'));
|
||||
|
||||
$options_agents = array('edit_agents' => __('Massive agents edition'), 'delete_agents' => __('Massive agents deletion'));
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
|
@ -45,8 +45,9 @@ else {
|
|||
$options_users = array();
|
||||
}
|
||||
|
||||
$options_modules = array('delete_modules' => __('Massive modules deletion'), 'edit_modules' => __('Massive modules edition'),
|
||||
'copy_modules' => __('Massive modules copy'));
|
||||
$options_modules = array('delete_modules' => __('Massive modules deletion'),
|
||||
'edit_modules' => __('Massive modules edition'),
|
||||
'copy_modules' => __('Massive modules copy'));
|
||||
|
||||
$options_policies = array();
|
||||
|
||||
|
@ -99,27 +100,27 @@ if ($option == '') {
|
|||
}
|
||||
|
||||
$alertstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts">'
|
||||
. html_print_image ('images/bell.png', true, array ('title' => __('Alerts operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_alerts');
|
||||
|
||||
. html_print_image ('images/bell.png', true, array ('title' => __('Alerts operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_alerts');
|
||||
|
||||
$userstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users">'
|
||||
. html_print_image ('images/group.png', true, array ('title' => __('Users operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_users');
|
||||
|
||||
. html_print_image ('images/group.png', true, array ('title' => __('Users operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_users');
|
||||
|
||||
$agentstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_agents">'
|
||||
. html_print_image ('images/bricks.png', true, array ('title' => __('Agents operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_agents');
|
||||
|
||||
. html_print_image ('images/bricks.png', true, array ('title' => __('Agents operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_agents');
|
||||
|
||||
$modulestab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'
|
||||
. html_print_image ('images/brick.png', true, array ('title' => __('Modules operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_modules');
|
||||
|
||||
. html_print_image ('images/brick.png', true, array ('title' => __('Modules operations')))
|
||||
. '</a>', 'active' => $tab == 'massive_modules');
|
||||
|
||||
/* Collection */
|
||||
$policiestab = enterprise_hook('massive_policies_tab');
|
||||
|
||||
if ($policiestab == -1)
|
||||
$policiestab = "";
|
||||
|
||||
|
||||
$onheader = array();
|
||||
$onheader['massive_agents'] = $agentstab;
|
||||
$onheader['massive_modules'] = $modulestab;
|
||||
|
@ -133,9 +134,9 @@ ui_print_page_header (__('Massive operations'). ' » '. $options[$option],
|
|||
|
||||
// Checks if the PHP configuration is correctly
|
||||
if ((get_cfg_var("max_execution_time") != 0) or (get_cfg_var("max_input_time") != -1)){
|
||||
echo '<div id="notify_conf" class="notify">';
|
||||
echo __("In order to perform massive operations, PHP needs a correct configuration in timeout parameters. Please, open your PHP configuration file (php.ini) for example: <i>sudo vi /etc/php5/apache2/php.ini;</i><br> And set your timeout parameters to a correct value: <br><i> max_execution_time = 0</i> and <i>max_input_time = -1</i>");
|
||||
echo '</div>';
|
||||
echo '<div id="notify_conf" class="notify">';
|
||||
echo __("In order to perform massive operations, PHP needs a correct configuration in timeout parameters. Please, open your PHP configuration file (php.ini) for example: <i>sudo vi /etc/php5/apache2/php.ini;</i><br> And set your timeout parameters to a correct value: <br><i> max_execution_time = 0</i> and <i>max_input_time = -1</i>");
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
// Catch all submit operations in this view to display Wait banner
|
||||
|
@ -159,9 +160,8 @@ echo '</div>';
|
|||
<script language="javascript" type="text/javascript">
|
||||
|
||||
|
||||
$(document).ready (function (){
|
||||
|
||||
$('#manage_config_form').submit( function(){
|
||||
$(document).ready (function () {
|
||||
$('#manage_config_form').submit( function() {
|
||||
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm)
|
||||
$("#loading").css("display", "");
|
||||
|
@ -169,7 +169,7 @@ $(document).ready (function (){
|
|||
return false;
|
||||
});
|
||||
|
||||
$('#form_edit').submit( function(){
|
||||
$('#form_edit').submit( function() {
|
||||
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm)
|
||||
$("#loading").css("display", "");
|
||||
|
@ -177,14 +177,14 @@ $(document).ready (function (){
|
|||
return false;
|
||||
});
|
||||
|
||||
$('[id^=form]').submit( function(){
|
||||
$('[id^=form]').submit( function() {
|
||||
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
|
||||
if (confirm)
|
||||
$("#loading").css("display", "");
|
||||
else
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$("#loading").css("display", "none");
|
||||
});
|
||||
|
||||
|
@ -199,7 +199,7 @@ html_print_select($options, 'option', $option, 'this.form.submit()', '', 0, fals
|
|||
if($option == 'edit_agents' || $option == 'edit_modules')
|
||||
echo '<a href="#" class="tip"> <span>' . __("The blank fields will not be updated") . '</span></a>';
|
||||
echo '</td></tr></table>';
|
||||
echo '</form>';
|
||||
echo '</form>';
|
||||
|
||||
switch ($option) {
|
||||
case 'delete_alerts':
|
||||
|
@ -247,4 +247,4 @@ switch ($option) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
?>
|
||||
?>
|
|
@ -129,7 +129,7 @@ $table->data[0][0] = '<form method="post" id="form_alerts" action="index.php?sec
|
|||
$table->data[0][0] .= html_print_input_hidden('id_alert_template_not_standby', $id_alert_templates, true);
|
||||
$table->data[0][0] .= __('Group');
|
||||
$table->data[0][1] = html_print_select_groups(false, "AR", true, 'id_group', $id_group,
|
||||
'', '', '', true, false, true, '');
|
||||
'', '', '', true, false, true, '');
|
||||
$table->data[0][2] = __('Group recursion');
|
||||
$table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion, true, false);
|
||||
|
||||
|
@ -138,14 +138,14 @@ $table->data[1][0] .= '<span id="agent_loading" class="invisible">';
|
|||
$table->data[1][0] .= html_print_image('images/spinner.png', true);
|
||||
$table->data[1][0] .= '</span>';
|
||||
$table->data[1][1] = html_print_select (agents_get_group_agents ($id_group, false, "none"),
|
||||
'id_agents[]', 0, false, '', '', true, true);
|
||||
'id_agents[]', 0, false, '', '', true, true);
|
||||
|
||||
$table->data[2][0] = __('Alert template');
|
||||
$table->data[2][0] .= '<span id="template_loading" class="invisible">';
|
||||
$table->data[2][0] .= html_print_image('images/spinner.png', true);
|
||||
$table->data[2][0] .= '</span>';
|
||||
$table->data[2][1] = html_print_select ('', 'id_alert_templates[]', '', '', '', '', true, true, true, '', true);
|
||||
|
||||
|
||||
$table->data[3][0] = __('Not standby alerts').ui_print_help_tip(__('Format').":<br> ".__('Agent')." - ".__('Module'), true);
|
||||
$table->data[3][0] .= '<span id="alerts_loading" class="invisible">';
|
||||
$table->data[3][0] .= html_print_image('images/spinner.png', true);
|
||||
|
@ -183,13 +183,13 @@ ui_require_jquery_file ('pandora.controls');
|
|||
/* <![CDATA[ */
|
||||
$(document).ready (function () {
|
||||
clear_alert_fields();
|
||||
|
||||
|
||||
var recursion;
|
||||
$("#checkbox-recursion").click(function (){
|
||||
recursion = this.checked ? 1 : 0;
|
||||
$("#id_group").trigger("change");
|
||||
});
|
||||
|
||||
|
||||
$("#id_group").pandoraSelectGroupAgent ({
|
||||
agentSelect: "select#id_agents",
|
||||
recursion: function() {return recursion},
|
||||
|
@ -197,7 +197,7 @@ $(document).ready (function () {
|
|||
clear_alert_fields();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("#id_agents").change (function () {
|
||||
clear_alert_fields();
|
||||
update_alert_templates();
|
||||
|
@ -220,10 +220,10 @@ $(document).ready (function () {
|
|||
idAgents.push($(val).val());
|
||||
});
|
||||
$("#template_loading").show();
|
||||
|
||||
|
||||
var $select_template = $("#id_alert_templates").disable ();
|
||||
$("option", $select_template).remove ();
|
||||
|
||||
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "godmode/massive/massive_standby_alerts",
|
||||
"get_alerts" : 1,
|
||||
|
@ -252,7 +252,7 @@ $(document).ready (function () {
|
|||
jQuery.each ($("#id_alert_templates option:selected"), function (i, val) {
|
||||
idAlertTemplates.push($(val).val());
|
||||
});
|
||||
|
||||
|
||||
var $select = $("#id_not_standby_alerts").disable ();
|
||||
var $select2 = $("#id_standby_alerts").disable ();
|
||||
$("#alerts_loading").show ();
|
||||
|
@ -309,7 +309,6 @@ $(document).ready (function () {
|
|||
$("option", $select_not_standby).remove ();
|
||||
$("option", $select_standby).remove ();
|
||||
}
|
||||
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
</script>
|
|
@ -66,8 +66,9 @@ if ($update) {
|
|||
$parent = (int) get_parameter ('parent');
|
||||
|
||||
if ($name == '') {
|
||||
ui_print_error_message (__('Not updated. Blank name'));
|
||||
} else {
|
||||
ui_print_error_message (__('Not updated. Blank name'));
|
||||
}
|
||||
else {
|
||||
$result = db_process_sql_update ('tnetwork_component_group',
|
||||
array ('name' => $name,
|
||||
'parent' => $parent),
|
||||
|
@ -87,19 +88,20 @@ if ($update) {
|
|||
if ($delete) {
|
||||
$result = db_process_sql_delete ('tnetwork_component_group',
|
||||
array ('id_sg' => $id));
|
||||
|
||||
|
||||
$result1 = db_process_sql_update('tnetwork_component_group', array('parent' => 0), array('parent' => $id));
|
||||
|
||||
|
||||
|
||||
|
||||
if (($result !== false) and ($result1 !== false)) $result = true;
|
||||
else $result = false;
|
||||
|
||||
if ($result) {
|
||||
db_pandora_audit( "Module management", "Delete component group #$id");
|
||||
} else {
|
||||
db_pandora_audit( "Module management", "Fail try to delete component group #$id");
|
||||
}
|
||||
|
||||
db_pandora_audit( "Module management", "Delete component group #$id");
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Module management", "Fail try to delete component group #$id");
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully deleted'),
|
||||
__('Not deleted. Error deleting data'));
|
||||
|
@ -113,9 +115,9 @@ if ($multiple_delete) {
|
|||
foreach ($ids as $id) {
|
||||
$result = db_process_sql_delete ('tnetwork_component_group',
|
||||
array ('id_sg' => $id));
|
||||
|
||||
|
||||
$result1 = db_process_sql_update('tnetwork_component_group', array('parent' => 0), array('parent' => $id));
|
||||
|
||||
|
||||
if (($result === false) or ($result1 === false)) {
|
||||
db_process_sql_rollback();
|
||||
break;
|
||||
|
@ -132,9 +134,10 @@ if ($multiple_delete) {
|
|||
$str_ids = implode (',', $ids);
|
||||
if ($result) {
|
||||
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");
|
||||
}
|
||||
}
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully multiple deleted'),
|
||||
__('Not deleted. Error deleting multiple data'));
|
||||
|
@ -162,7 +165,7 @@ $filter['limit'] = (int) $config['block_size'];
|
|||
$groups = db_get_all_rows_filter ('tnetwork_component_group', $filter);
|
||||
if ($groups === false)
|
||||
$groups = array ();
|
||||
|
||||
|
||||
$table->width = '98%';
|
||||
$table->head = array ();
|
||||
$table->head[0] = __('Name');
|
||||
|
@ -229,4 +232,4 @@ function check_all_checkboxes() {
|
|||
$(".check_delete").attr('checked', false);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
|
@ -99,7 +99,7 @@ if ($create_component) {
|
|||
$custom_string_1 = '';
|
||||
$custom_string_2 = '';
|
||||
$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) {
|
||||
// New support for snmp v3
|
||||
$tcp_send = $snmp_version;
|
||||
|
@ -109,7 +109,7 @@ if ($create_component) {
|
|||
$custom_string_1 = $snmp3_privacy_method;
|
||||
$custom_string_2 = $snmp3_privacy_pass;
|
||||
$custom_string_3 = $snmp3_security_level;
|
||||
$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
|
||||
$name_check = db_get_value ('name', 'tnetwork_component', 'name', $name);
|
||||
}
|
||||
if ($name && !$name_check) {
|
||||
|
||||
|
@ -147,7 +147,7 @@ if ($create_component) {
|
|||
'only_metaconsole' => $only_metaconsole));
|
||||
}
|
||||
else {
|
||||
$id = '';
|
||||
$id = '';
|
||||
}
|
||||
if ($id === false || !$id) {
|
||||
db_pandora_audit("Module management", "Fail try to create network component");
|
||||
|
@ -166,7 +166,8 @@ if ($update_component) {
|
|||
$custom_string_1 = '';
|
||||
$custom_string_2 = '';
|
||||
$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) {
|
||||
// New support for snmp v3
|
||||
$tcp_send = $snmp_version;
|
||||
|
@ -238,9 +239,10 @@ if ($delete_component) {
|
|||
|
||||
if ($result) {
|
||||
db_pandora_audit( "Module management", "Delete network component #$id");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
db_pandora_audit( "Module management", "Fail try to delete network component #$id");
|
||||
}
|
||||
}
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully deleted'),
|
||||
|
@ -265,14 +267,15 @@ if ($multiple_delete) {
|
|||
$str_ids = implode (',', $ids);
|
||||
if ($result) {
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
db_process_sql_commit();
|
||||
}
|
||||
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully multiple deleted'),
|
||||
__('Not deleted. Error deleting multiple data'));
|
||||
|
@ -407,7 +410,7 @@ foreach ($components as $component) {
|
|||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
if(isset($data)) {
|
||||
if (isset($data)) {
|
||||
echo "<form method='post' action='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&search_id_group=0search_string='>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table ($table);
|
||||
|
@ -441,4 +444,4 @@ function check_all_checkboxes() {
|
|||
$(".check_delete").attr('checked', false);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
|
@ -187,13 +187,13 @@ if (isset($name))
|
|||
|
||||
// Header
|
||||
$tab = get_parameter("tab", "");
|
||||
switch ($tab){
|
||||
switch ($tab) {
|
||||
case "main":
|
||||
ui_print_page_header ($head, "", false, "graph_builder", true, $buttons);
|
||||
break;
|
||||
case "graph_editor":
|
||||
ui_print_page_header ($head, "", false, "graph_editor", true, $buttons);
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
ui_print_page_header ($head, "", false, "graph_builder", true, $buttons);
|
||||
break;
|
||||
|
@ -209,7 +209,7 @@ if ($update_graph)
|
|||
ui_print_result_message($success, __("Update the graph"), __("Bad update the graph"));
|
||||
|
||||
if ($delete_module) {
|
||||
ui_print_result_message($result, __('Graph deleted successfully'), __('There was a problem deleting Graph'));
|
||||
ui_print_result_message($result, __('Graph deleted successfully'), __('There was a problem deleting Graph'));
|
||||
}
|
||||
|
||||
// Parse CHUNK information into showable information
|
||||
|
|
|
@ -1565,7 +1565,7 @@ function chooseType() {
|
|||
$("#row_show_in_landscape").show();
|
||||
$("#row_servers").show();
|
||||
break;
|
||||
case 'sql_graph_vbar':
|
||||
case 'sql_graph_vbar':
|
||||
$("#row_description").show();
|
||||
$("#row_query").show();
|
||||
$("#row_custom").show();
|
||||
|
|
|
@ -134,11 +134,11 @@ if (isset($_GET["update"])) {
|
|||
$result = db_process_sql_update('trecon_task', $values, $where);
|
||||
else {
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
$result = false;
|
||||
|
||||
|
||||
if ($result !== false) {
|
||||
echo '<h3 class="suc">'.__('Successfully updated recon task').'</h3>';
|
||||
}
|
||||
|
@ -173,20 +173,20 @@ if (isset($_GET["create"])) {
|
|||
'parent_detection' => $parent_detection,
|
||||
'parent_recursion' => $parent_recursion
|
||||
);
|
||||
|
||||
$reason = "";
|
||||
|
||||
$reason = "";
|
||||
if ($name != "") {
|
||||
if (($id_recon_script == 'NULL') && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network))
|
||||
{
|
||||
$result = db_process_sql_insert('trecon_task', $values);
|
||||
$reason = __("Network provided is not correct");
|
||||
$reason = __("Network provided is not correct");
|
||||
}
|
||||
elseif ($id_recon_script != 'NULL') {
|
||||
$result = db_process_sql_insert('trecon_task', $values);
|
||||
}
|
||||
else {
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
$result = false;
|
||||
|
@ -196,7 +196,7 @@ if (isset($_GET["create"])) {
|
|||
}
|
||||
else {
|
||||
echo '<h3 class="error">'.__('Error creating recon task').'</h3>';
|
||||
echo $reason;
|
||||
echo $reason;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -205,12 +205,15 @@ if (isset($_GET["create"])) {
|
|||
// --------------------------------
|
||||
//Pandora Admin must see all columns
|
||||
if (! check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sql = sprintf('SELECT * FROM trecon_task RT, tusuario_perfil UP WHERE
|
||||
UP.id_usuario = "%s" AND UP.id_grupo = RT.id_group',
|
||||
$config['id_user']);
|
||||
|
||||
$sql = sprintf('SELECT *
|
||||
FROM trecon_task RT, tusuario_perfil UP
|
||||
WHERE
|
||||
UP.id_usuario = "%s" AND UP.id_grupo = RT.id_group',
|
||||
$config['id_user']);
|
||||
|
||||
$result = db_get_all_rows_sql ($sql);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$result = db_get_all_rows_in_table('trecon_task');
|
||||
}
|
||||
$color=1;
|
||||
|
@ -226,31 +229,32 @@ if ($result !== false) {
|
|||
$table->style[8] = 'text-align: center;';
|
||||
|
||||
foreach ($result as $row) {
|
||||
|
||||
$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>';
|
||||
|
||||
|
||||
if ($row["id_recon_script"] == 0)
|
||||
$data[1] = $row["subnet"];
|
||||
else
|
||||
$data[1] =__("N/A");
|
||||
|
||||
|
||||
if ($row["id_recon_script"] == 0){
|
||||
// Network recon task
|
||||
|
||||
|
||||
if ($row["id_recon_script"] == 0) {
|
||||
// Network recon task
|
||||
$data[2] = html_print_image ("images/network.png", true, array ("title" => __('Network recon task')))." ";
|
||||
$data[2] .= network_profiles_get_name ($row["id_network_profile"]);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// APP recon task
|
||||
$data[2] = html_print_image ("images/plugin.png", true). " ";
|
||||
$data[2] .= db_get_sql (sprintf("SELECT name FROM trecon_script WHERE id_recon_script = %d", $row["id_recon_script"]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// GROUP
|
||||
if ($row["id_recon_script"] == 0){
|
||||
if ($row["id_recon_script"] == 0) {
|
||||
$data[3] = ui_print_group_icon ($row["id_group"], true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[3] = "-";
|
||||
}
|
||||
|
||||
|
@ -258,9 +262,10 @@ if ($result !== false) {
|
|||
$data[4] = (($row["create_incident"] == 1) ? __('Yes') : __('No'));
|
||||
|
||||
// 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'));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[5] = "-";
|
||||
}
|
||||
// INTERVAL
|
||||
|
@ -270,9 +275,10 @@ if ($result !== false) {
|
|||
$data[6] =human_time_description_raw($row["interval_sweep"]);
|
||||
|
||||
// PORTS
|
||||
if ($row["id_recon_script"] == 0){
|
||||
if ($row["id_recon_script"] == 0) {
|
||||
$data[7] = substr($row["recon_ports"],0,15);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data[7] = "-";
|
||||
}
|
||||
|
||||
|
@ -292,7 +298,8 @@ if ($result !== false) {
|
|||
|
||||
html_print_table ($table);
|
||||
unset ($table);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
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 '</form>';
|
||||
echo "</div>";
|
||||
|
||||
?>
|
||||
?>
|
|
@ -27,7 +27,7 @@ if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_us
|
|||
ui_print_page_header (__('Link management'), "images/extensions.png", false, "", false, "" );
|
||||
|
||||
|
||||
if (isset($_POST["create"])){ // If create
|
||||
if (isset($_POST["create"])) { // If create
|
||||
$name = get_parameter_post ("name");
|
||||
$link = get_parameter_post ("link");
|
||||
|
||||
|
@ -43,13 +43,13 @@ if (isset($_POST["create"])){ // If create
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($_POST["update"])){ // if update
|
||||
if (isset($_POST["update"])) { // if update
|
||||
$id_link = io_safe_input($_POST["id_link"]);
|
||||
$name = io_safe_input($_POST["name"]);
|
||||
$link = io_safe_input($_POST["link"]);
|
||||
|
||||
|
||||
$result = false;
|
||||
if ($name != '')
|
||||
if ($name != '')
|
||||
$result = db_process_sql_update("tlink", array('name' => $name, 'link' => $link), array('id_link' => $id_link));
|
||||
|
||||
if (! $result)
|
||||
|
@ -57,8 +57,8 @@ if (isset($_POST["update"])){ // if update
|
|||
else
|
||||
echo "<h3 class='suc'>".__('Successfully updated')."</h3>";
|
||||
}
|
||||
|
||||
if (isset($_GET["borrar"])){ // if delete
|
||||
|
||||
if (isset($_GET["borrar"])) { // if delete
|
||||
$id_link = io_safe_input($_GET["borrar"]);
|
||||
|
||||
$result = db_process_sql_delete("tlink", array("id_link" => $id_link));
|
||||
|
@ -71,8 +71,8 @@ if (isset($_GET["borrar"])){ // if delete
|
|||
}
|
||||
|
||||
// Main form view for Links edit
|
||||
if ((isset($_GET["form_add"])) or (isset($_GET["form_edit"]))){
|
||||
if (isset($_GET["form_edit"])){
|
||||
if ((isset($_GET["form_add"])) or (isset($_GET["form_edit"]))) {
|
||||
if (isset($_GET["form_edit"])) {
|
||||
$creation_mode = 0;
|
||||
$id_link = io_safe_input($_GET["id_link"]);
|
||||
|
||||
|
@ -81,7 +81,7 @@ if ((isset($_GET["form_add"])) or (isset($_GET["form_edit"]))){
|
|||
if ($row !== false) {
|
||||
$nombre = $row["name"];
|
||||
$link = $row["link"];
|
||||
}
|
||||
}
|
||||
else echo "<h3 class='error'>".__('Name error')."</h3>";
|
||||
}
|
||||
else { // form_add
|
||||
|
@ -125,15 +125,15 @@ else { // Main list view for Links editor
|
|||
if ($rows === false) {
|
||||
$rows = array();
|
||||
}
|
||||
|
||||
|
||||
if (empty($rows)) {
|
||||
echo '<div class="nf">'.__("There isn't links").'</div>';
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
echo "<table cellpadding='4' cellspacing='4' class='databox' style='width:98%'>";
|
||||
echo "<th width='180px'>".__('Link name')."</th>";
|
||||
echo "<th width='80px'>".__('Delete')."</th>";
|
||||
|
||||
|
||||
$color=1;
|
||||
foreach ($rows as $row) {
|
||||
if ($color == 1){
|
||||
|
@ -149,11 +149,11 @@ else { // Main list view for Links editor
|
|||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
|
||||
echo "<table width='98%'>";
|
||||
echo "<tr><td align='right'>";
|
||||
echo "<form method='post' action='index.php?sec=gsetup&sec2=godmode/setup/links&form_add=1'>";
|
||||
echo "<input type='submit' class='sub next' name='form_add' value='".__('Add')."'>";
|
||||
echo "</form></table>";
|
||||
}
|
||||
?>
|
||||
?>
|
|
@ -91,7 +91,7 @@ switch ($action) {
|
|||
$values['icon_name'] = $icon;
|
||||
}
|
||||
$result = false;
|
||||
if ($name != '')
|
||||
if ($name != '')
|
||||
$result = db_process_sql_update('tconfig_os', $values, array('id_os' => $idOS));
|
||||
|
||||
$message = ui_print_result_message($result, __('Success updatng OS'), __('Error updating OS'), '', true);
|
||||
|
@ -101,7 +101,7 @@ switch ($action) {
|
|||
else {
|
||||
$tab = 'builder';
|
||||
$os = db_get_row_filter('tconfig_os', array('id_os' => $idOS));
|
||||
$name = $os['name'];
|
||||
$name = $os['name'];
|
||||
}
|
||||
$actionHidden = 'update';
|
||||
$textButton = __('Update');
|
||||
|
@ -133,7 +133,6 @@ $buttons = array(
|
|||
'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>'));
|
||||
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
// Header
|
||||
|
@ -151,4 +150,4 @@ switch ($tab) {
|
|||
return;
|
||||
break;
|
||||
}
|
||||
?>
|
||||
?>
|
|
@ -36,7 +36,7 @@ $buttons = array(
|
|||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
// Header
|
||||
|
@ -65,16 +65,17 @@ if ($id_profile || $new_profile) {
|
|||
}
|
||||
else {
|
||||
$profile = db_get_row ('tperfil', 'id_perfil', $id_profile);
|
||||
|
||||
|
||||
if ($profile === false) {
|
||||
echo '<h3 class="error">'.__('There was a problem loading profile').'</h3></table>';
|
||||
echo '</div>';
|
||||
echo '<div style="clear:both"> </div>';
|
||||
echo '</div>';
|
||||
echo '<div id="foot">';
|
||||
require ("general/footer.php");
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '<div style="clear:both"> </div>';
|
||||
echo '</div>';
|
||||
echo '<div id="foot">';
|
||||
require ("general/footer.php");
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -143,12 +144,12 @@ if ($id_profile || $new_profile) {
|
|||
if ($new_profile) {
|
||||
html_print_submit_button (__('Add'), "crt", false, 'class="sub wand"');
|
||||
html_print_input_hidden ('create_profile', 1);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_input_hidden ('id', $id_profile);
|
||||
html_print_input_hidden ('update_profile', 1);
|
||||
html_print_submit_button (__('Update'), "upd", false, 'class="sub upd"');
|
||||
}
|
||||
echo "</div></form>";
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
|
@ -398,8 +398,8 @@ function db_get_row_filter($table, $filter, $fields = false, $where_join = 'AND'
|
|||
function db_get_sql ($sql, $field = 0, $search_history_db = false) {
|
||||
$result = db_get_all_rows_sql ($sql, $search_history_db);
|
||||
|
||||
if($result === false)
|
||||
return false;
|
||||
if ($result === false)
|
||||
return false;
|
||||
|
||||
$ax = 0;
|
||||
foreach ($result[0] as $f){
|
||||
|
|
|
@ -393,6 +393,7 @@ function menu_get_sec_pages($sec,$menu_hash = false) {
|
|||
else {
|
||||
$menu = json_decode(base64_decode($menu_hash),true);
|
||||
}
|
||||
|
||||
// Get the sec2 of the main section
|
||||
$sec2_array[$menu[$sec]['sec2']] = $menu[$sec]['text'];
|
||||
|
||||
|
|
|
@ -943,7 +943,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
|
|||
}
|
||||
|
||||
$borderStyle = '';
|
||||
if(substr($img,0,1) == '4') {
|
||||
if (substr($img,0,1) == '4') {
|
||||
$img_style['border'] ='2px solid #ffa300;';
|
||||
$img = substr_replace($img, '', 0,1);
|
||||
}
|
||||
|
@ -1314,7 +1314,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
|
|||
break;
|
||||
default:
|
||||
enterprise_hook("enterprise_visual_map_print_item",
|
||||
array($layout_data, $status, $colorStatus));
|
||||
array($layout_data, $status, $colorStatus, 'operation'));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1385,14 +1385,14 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
|
|||
else
|
||||
$groups = users_get_groups ($id_user, 'IR', false);
|
||||
|
||||
if(!empty($groups)) {
|
||||
if (!empty($groups)) {
|
||||
if ($where != '') {
|
||||
$where .= ' AND ';
|
||||
}
|
||||
$where .= sprintf ('id_group IN (%s)', implode (",", array_keys ($groups)));
|
||||
}
|
||||
|
||||
if($where == '') {
|
||||
if ($where == '') {
|
||||
$where = array();
|
||||
}
|
||||
|
||||
|
|
|
@ -317,29 +317,28 @@ function parse_oracle_dump($connection, $url, $debug = false) {
|
|||
}
|
||||
|
||||
function oracle_drop_all_objects ($connection) {
|
||||
|
||||
//Drop all objects of the current installation
|
||||
$stmt = oci_parse($connection,
|
||||
"BEGIN " .
|
||||
"FOR cur_rec IN (SELECT object_name, object_type " .
|
||||
"FROM user_objects " .
|
||||
"WHERE object_type IN ('TABLE', 'VIEW', 'PACKAGE', 'PROCEDURE', 'FUNCTION', 'SEQUENCE', 'SNAPSHOT', 'MATERIALIZED VIEW')) LOOP " .
|
||||
"BEGIN " .
|
||||
"IF cur_rec.object_type = 'TABLE' THEN " .
|
||||
"EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' \"' || cur_rec.object_name || '\" CASCADE CONSTRAINTS'; " .
|
||||
"ELSE " .
|
||||
"EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' \"' || cur_rec.object_name || '\"'; " .
|
||||
"END IF; " .
|
||||
"EXCEPTION " .
|
||||
"WHEN OTHERS THEN " .
|
||||
"DBMS_OUTPUT.put_line('FAILED: DROP ' || cur_rec.object_type || ' \"' || cur_rec.object_name || '\"'); " .
|
||||
"END; " .
|
||||
"END LOOP; " .
|
||||
"END; ");
|
||||
|
||||
"BEGIN " .
|
||||
"FOR cur_rec IN (SELECT object_name, object_type " .
|
||||
"FROM user_objects " .
|
||||
"WHERE object_type IN ('TABLE', 'VIEW', 'PACKAGE', 'PROCEDURE', 'FUNCTION', 'SEQUENCE', 'SNAPSHOT', 'MATERIALIZED VIEW')) LOOP " .
|
||||
"BEGIN " .
|
||||
"IF cur_rec.object_type = 'TABLE' THEN " .
|
||||
"EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' \"' || cur_rec.object_name || '\" CASCADE CONSTRAINTS'; " .
|
||||
"ELSE " .
|
||||
"EXECUTE IMMEDIATE 'DROP ' || cur_rec.object_type || ' \"' || cur_rec.object_name || '\"'; " .
|
||||
"END IF; " .
|
||||
"EXCEPTION " .
|
||||
"WHEN OTHERS THEN " .
|
||||
"DBMS_OUTPUT.put_line('FAILED: DROP ' || cur_rec.object_type || ' \"' || cur_rec.object_name || '\"'); " .
|
||||
"END; " .
|
||||
"END LOOP; " .
|
||||
"END; ");
|
||||
|
||||
$result = oci_execute($stmt);
|
||||
oci_free_statement($stmt);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -353,7 +352,7 @@ function random_name ($size) {
|
|||
|
||||
function print_logo_status ($step, $step_total) {
|
||||
global $banner;
|
||||
|
||||
|
||||
echo "
|
||||
<div id='logo_img'>
|
||||
<img src='images/pandora_logo.png' border='0'><br>
|
||||
|
@ -567,12 +566,12 @@ function install_step3() {
|
|||
if (!$error) {
|
||||
echo "<form method='post' name='step2_form' action='install.php?step=4'>";
|
||||
}
|
||||
|
||||
echo "<table cellpadding=6 celwidth=100% border=0>";
|
||||
echo "<tr><td>";
|
||||
|
||||
echo "<table cellpadding=6 celwidth=100% border=0>";
|
||||
echo "<tr><td>";
|
||||
echo "DB Engine<br>";
|
||||
|
||||
|
||||
|
||||
|
||||
if ($error) {
|
||||
echo "
|
||||
<div class='warn'>
|
||||
|
@ -583,56 +582,55 @@ function install_step3() {
|
|||
echo "<select name='engine' onChange=\"ChangeDBAction(this)\">";
|
||||
echo $options;
|
||||
echo "</select>";
|
||||
|
||||
echo "<td>";
|
||||
|
||||
echo "<td>";
|
||||
echo " Installation in <br>";
|
||||
echo "<select name='db_action' onChange=\"ChangeDBDrop(this)\">";
|
||||
echo "<option value='db_new'>A new Database</option>";
|
||||
echo "<option value='db_exist'>An existing Database</option>";
|
||||
echo "<option value='db_new'>A new Database</option>";
|
||||
echo "<option value='db_exist'>An existing Database</option>";
|
||||
echo "</select>";
|
||||
}
|
||||
echo " <tr><td>DB User with privileges<br>
|
||||
<input class='login' type='text' name='user' value='root' size=8>
|
||||
|
||||
|
||||
<td>DB Password for this user<br>
|
||||
<input class='login' type='password' name='pass' value='' size=8>
|
||||
|
||||
<tr><td>DB Hostname<br>
|
||||
<input class='login' type='text' name='host' value='localhost' size=12>
|
||||
|
||||
|
||||
<td>DB Name (pandora by default)<br>
|
||||
<input class='login' type='text' name='dbname' value='pandora' size=8>
|
||||
|
||||
<tr><td valign=top>
|
||||
|
||||
<tr><td valign=top>
|
||||
Drop Database if exists<br>
|
||||
<input class='login' type='checkbox' name='drop' value=1 disabled>
|
||||
|
||||
|
||||
|
||||
|
||||
<td>Full path to HTTP publication directory<br>
|
||||
<span style='font-size: 9px'>For example /var/www/pandora_console/</span>
|
||||
<br>
|
||||
<input class='login' type='text' name='path' style='width: 240px;'
|
||||
value='".dirname (__FILE__)."'>
|
||||
|
||||
|
||||
<tr><td colspan=2>URL path to Pandora FMS Console<br>
|
||||
<span style='font-size: 9px'>For example '/pandora_console'</span>
|
||||
</br>
|
||||
<input class='login' type='text' name='url' style='width: 250px;'
|
||||
value='".dirname ($_SERVER["SCRIPT_NAME"])."'>
|
||||
</table>
|
||||
";
|
||||
</table>
|
||||
";
|
||||
|
||||
if (!$error) {
|
||||
echo " <div align='right'><br>
|
||||
<input type='image' src='images/arrow_next.png' value='Step #4' id='step4'>
|
||||
</div>
|
||||
";
|
||||
}
|
||||
echo " </form>
|
||||
echo "<div align='right'><br>
|
||||
<input type='image' src='images/arrow_next.png' value='Step #4' id='step4'>
|
||||
</div>";
|
||||
|
||||
}
|
||||
echo "</form>
|
||||
</div>";
|
||||
|
||||
print_logo_status (4,6);
|
||||
|
||||
|
||||
echo "</div>
|
||||
<div id='foot_install'>
|
||||
<i>Pandora FMS is an OpenSource Software project registered at
|
||||
|
@ -643,7 +641,7 @@ function install_step3() {
|
|||
|
||||
function install_step4() {
|
||||
$pandora_config = "include/config.php";
|
||||
|
||||
|
||||
if ( (! isset($_POST["user"])) || (! isset($_POST["dbname"])) || (! isset($_POST["host"])) ||
|
||||
(! isset($_POST["pass"])) || (!isset($_POST['engine'])) || (! isset($_POST["db_action"])) ) {
|
||||
$dbpassword = "";
|
||||
|
@ -663,7 +661,7 @@ function install_step4() {
|
|||
$dbdrop = $_POST["drop"];
|
||||
else
|
||||
$dbdrop = 0;
|
||||
|
||||
|
||||
$dbname = $_POST["dbname"];
|
||||
if (isset($_POST["url"]))
|
||||
$url = $_POST["url"];
|
||||
|
@ -679,7 +677,7 @@ function install_step4() {
|
|||
$step2=0;
|
||||
$step3=0;
|
||||
$step4=0; $step5=0; $step6=0; $step7=0;
|
||||
|
||||
|
||||
echo "
|
||||
<div id='install_container'>
|
||||
<div id='wizard' style='height: 480px;'>
|
||||
|
@ -704,19 +702,19 @@ function install_step4() {
|
|||
$step1 = mysql_query ("CREATE DATABASE $dbname");
|
||||
check_generic ($step1, "Creating database '$dbname'");
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$step = 1;
|
||||
}
|
||||
if ($step1 == 1) {
|
||||
$step2 = mysql_select_db($dbname);
|
||||
check_generic ($step2, "Opening database '$dbname'");
|
||||
|
||||
|
||||
$step3 = parse_mysql_dump("pandoradb.sql");
|
||||
check_generic ($step3, "Creating schema");
|
||||
|
||||
|
||||
$step4 = parse_mysql_dump("pandoradb_data.sql");
|
||||
check_generic ($step4, "Populating database");
|
||||
|
||||
|
||||
$random_password = random_name (8);
|
||||
$host = 'localhost';
|
||||
if ($dbhost != 'localhost')
|
||||
|
@ -725,7 +723,7 @@ function install_step4() {
|
|||
IDENTIFIED BY '".$random_password."'");
|
||||
mysql_query ("FLUSH PRIVILEGES");
|
||||
check_generic ($step5, "Established privileges for user pandora. A new random password has been generated: <b>$random_password</b><div class='warn'>Please write it down, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file</div>");
|
||||
|
||||
|
||||
$step6 = is_writable("include");
|
||||
check_generic ($step6, "Write permissions to save config file in './include'");
|
||||
|
||||
|
@ -766,12 +764,12 @@ function install_step4() {
|
|||
}
|
||||
else {
|
||||
check_generic(1, "Connection with Database");
|
||||
|
||||
|
||||
// Drop all objects if needed
|
||||
if ($dbdrop == 1) {
|
||||
oracle_drop_all_objects($connection);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$step1 = parse_oracle_dump($connection, "pandoradb.oracle.sql");
|
||||
|
||||
check_generic($step1, "Creating schema");
|
||||
|
@ -779,15 +777,15 @@ function install_step4() {
|
|||
if ($step1) {
|
||||
$step2 = parse_oracle_dump($connection, "pandoradb.data.oracle.sql");
|
||||
}
|
||||
|
||||
|
||||
check_generic ($step2, "Populating database");
|
||||
|
||||
|
||||
echo "<tr><td><div class='warn'>Please, you will need to setup your Pandora FMS server, editing the </i>/etc/pandora/pandora_server.conf</i> file and set database password.</div></tr></td>";
|
||||
|
||||
if ($step2) {
|
||||
$step3 = is_writable("include");
|
||||
}
|
||||
|
||||
|
||||
check_generic ($step3, "Write permissions to save config file in './include'");
|
||||
|
||||
if ($step3) {
|
||||
|
@ -820,9 +818,9 @@ function install_step4() {
|
|||
if (($step4 + $step3 + $step2 + $step1) == 4) {
|
||||
$everything_ok = 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 'pgsql':
|
||||
$step1 = $step2 = $step3 = $step4 = $step5 = $step6 = $step7 = 0;
|
||||
|
||||
|
@ -847,7 +845,7 @@ function install_step4() {
|
|||
|
||||
check_generic ($step1, "Creating database '$dbname'");
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$step1 = 1;
|
||||
}
|
||||
|
||||
|
@ -1003,7 +1001,7 @@ function install_step4() {
|
|||
break;
|
||||
}
|
||||
echo "</table></div>";
|
||||
|
||||
|
||||
print_logo_status(5,6);
|
||||
|
||||
echo "<div id='install_img'>";
|
||||
|
@ -1020,7 +1018,7 @@ function install_step4() {
|
|||
$info .= "objects ";
|
||||
else
|
||||
$info .= "schemes ";
|
||||
|
||||
|
||||
$info .= "created in this step have been dropped. </p>
|
||||
</div>";
|
||||
echo $info;
|
||||
|
@ -1030,7 +1028,7 @@ function install_step4() {
|
|||
if (mysql_error() != "") {
|
||||
echo "<div class='warn'> <b>ERROR:</b> ". mysql_error().".</div>";
|
||||
}
|
||||
|
||||
|
||||
if ($step1 == 1) {
|
||||
mysql_query ("DROP DATABASE $dbname");
|
||||
}
|
||||
|
@ -1041,7 +1039,7 @@ function install_step4() {
|
|||
oracle_drop_all_objects($connection);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1105,4 +1103,4 @@ else {
|
|||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
|
@ -18,12 +18,12 @@ global $config;
|
|||
// Login check
|
||||
check_login ();
|
||||
|
||||
if (is_ajax()){
|
||||
if (is_ajax()) {
|
||||
require_once("include/functions_reporting.php");
|
||||
|
||||
$get_alert_fired = get_parameter("get_alert_fired", 0);
|
||||
|
||||
if ($get_alert_fired){
|
||||
|
||||
if ($get_alert_fired) {
|
||||
// Calculate alerts fired
|
||||
$data_reporting = reporting_get_group_stats();
|
||||
echo $data_reporting['monitor_alerts_fired'];
|
||||
|
@ -47,7 +47,7 @@ $free_search = get_parameter("free_search", '');
|
|||
|
||||
$sec2 = get_parameter_get ('sec2');
|
||||
$sec2 = safe_url_extraclean ($sec2);
|
||||
|
||||
|
||||
$sec = get_parameter_get ('sec');
|
||||
$sec = safe_url_extraclean ($sec);
|
||||
|
||||
|
@ -70,11 +70,11 @@ if ($idAgent != 0) {
|
|||
$id_group = agents_get_agent_group ($idAgent);
|
||||
|
||||
$is_extra = enterprise_hook('policies_is_agent_extra_policy', array($id_agente));
|
||||
|
||||
|
||||
if($is_extra === ENTERPRISE_NOT_HOOK) {
|
||||
$is_extra = false;
|
||||
}
|
||||
|
||||
|
||||
if (!check_acl ($config["id_user"], $id_group, "AR") && !$is_extra) {
|
||||
db_pandora_audit("ACL Violation","Trying to access alert view");
|
||||
require ("general/noaccess.php");
|
||||
|
@ -85,7 +85,6 @@ if ($idAgent != 0) {
|
|||
$idGroup = false;
|
||||
|
||||
$print_agent = false;
|
||||
|
||||
}
|
||||
else {
|
||||
if (!check_acl ($config["id_user"], 0, "AR")) {
|
||||
|
@ -95,7 +94,7 @@ else {
|
|||
}
|
||||
|
||||
$agents = array_keys(agents_get_group_agents(array_keys(users_get_groups($config["id_user"], 'AR', false))));
|
||||
|
||||
|
||||
$idGroup = $id_group;
|
||||
|
||||
$print_agent = true;
|
||||
|
@ -105,10 +104,10 @@ else {
|
|||
|
||||
if ($alert_validate) {
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") == 0) {
|
||||
echo '<h3 class="error">'.__('Insufficient permissions to validate alerts').'</h3>';
|
||||
echo '<h3 class="error">'.__('Insufficient permissions to validate alerts').'</h3>';
|
||||
}
|
||||
else {
|
||||
validateAlert();
|
||||
validateAlert();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -299,9 +298,9 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
|||
$table->head[6] = __('Action');
|
||||
$table->head[7] = __('Last fired');
|
||||
$table->head[8] = __('Status');
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
|
||||
$table->head[9] = __('Validate');
|
||||
}
|
||||
}
|
||||
$table->align[8] = 'center';
|
||||
$table->align[9] = 'center';
|
||||
}
|
||||
|
@ -319,7 +318,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
|||
$table->head[5] = __('Action');
|
||||
$table->head[6] = __('Last fired');
|
||||
$table->head[7] = __('Status');
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
|
||||
$table->head[8] = __('Validate');
|
||||
}
|
||||
$table->align[7] = 'center';
|
||||
|
@ -344,7 +343,7 @@ else
|
|||
$table->head[5] = __('Action');
|
||||
$table->head[6] = __('Last fired');
|
||||
$table->head[7] = __('Status');
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") == 1) {
|
||||
$table->head[8] = __('Validate');
|
||||
}
|
||||
$table->align[7] = 'center';
|
||||
|
@ -449,4 +448,4 @@ $(document).ready (function () {
|
|||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
|
@ -74,45 +74,48 @@ $datetime_to = strtotime ($date_to.' '.$time_to);
|
|||
if ($moduletype_name == "log4x") {
|
||||
$table->width = "100%";
|
||||
$sql_freestring = '%' . $freestring . '%';
|
||||
|
||||
|
||||
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);
|
||||
} 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);
|
||||
}
|
||||
|
||||
|
||||
$columns = array(
|
||||
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ),
|
||||
"Sev" => array("severity", "modules_format_data", "align" => "center", "width" => "70px"),
|
||||
"Message" => array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"),
|
||||
"StackTrace" => array("stacktrace", "modules_format_verbatim", "align" => "left", "width" => "50%")
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ),
|
||||
"Sev" => array("severity", "modules_format_data", "align" => "center", "width" => "70px"),
|
||||
"Message"=> array("message", "modules_format_verbatim", "align" => "left", "width" => "45%"),
|
||||
"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 . '%';
|
||||
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);
|
||||
} 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);
|
||||
}
|
||||
|
||||
|
||||
$columns = array(
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"),
|
||||
"Data" => array("datos", "modules_format_data", "align" => "left"),
|
||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"),
|
||||
"Data" => array("datos", "modules_format_data", "align" => "left"),
|
||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||
);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
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);
|
||||
} 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);
|
||||
}
|
||||
|
||||
|
||||
$columns = array(
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"),
|
||||
"Data" => array("datos", "modules_format_data", "align" => "left"),
|
||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||
"Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"),
|
||||
"Data" => array("datos", "modules_format_data", "align" => "left"),
|
||||
"Time" => array("utimestamp", "modules_format_time", "align" => "center")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -136,7 +139,7 @@ switch ($config["dbtype"]) {
|
|||
$set['limit'] = $block_size;
|
||||
$set['offset'] = $offset;
|
||||
$sql = oracle_recode_query ($sql, $set);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
$result = db_get_all_rows_sql ($sql, true);
|
||||
|
@ -146,7 +149,7 @@ if ($result === false) {
|
|||
|
||||
if (($config['dbtype'] == 'oracle') && ($result !== false)) {
|
||||
for ($i=0; $i < count($result); $i++) {
|
||||
unset($result[$i]['rnum']);
|
||||
unset($result[$i]['rnum']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,8 +184,8 @@ $formtable->data[1][2] .= html_print_input_text ('date_to', $date_to, '', 10, 10
|
|||
$formtable->data[1][2] .= html_print_input_text ('time_to', $time_to, '', 7, 7, true);
|
||||
|
||||
if (preg_match ("/string/", $moduletype_name) || $moduletype_name == "log4x") {
|
||||
$formtable->data[2][0] = __('Free text for search');
|
||||
$formtable->data[2][1] = html_print_input_text ("freestring", $freestring, '', 20,30, true);
|
||||
$formtable->data[2][0] = __('Free text for search');
|
||||
$formtable->data[2][1] = html_print_input_text ("freestring", $freestring, '', 20,30, true);
|
||||
}
|
||||
|
||||
html_print_table ($formtable);
|
||||
|
@ -205,17 +208,17 @@ foreach($columns as $col => $attr) {
|
|||
|
||||
if (isset($attr["width"]))
|
||||
$table->size[$index] = $attr["width"];
|
||||
|
||||
|
||||
$index++;
|
||||
}
|
||||
|
||||
foreach ($result as $row) {
|
||||
$data = array ();
|
||||
|
||||
|
||||
foreach($columns as $col => $attr) {
|
||||
$data[] = $attr[1] ($row[$attr[0]]);
|
||||
}
|
||||
|
||||
|
||||
array_push ($table->data, $data);
|
||||
if (count($table->data) > 200) break;
|
||||
}
|
||||
|
@ -235,12 +238,12 @@ ui_require_jquery_file ('timeentry');
|
|||
<script language="javascript" type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
$("#text-time_from, #text-time_to").timeEntry ({
|
||||
spinnerImage: 'images/time-entry.png',
|
||||
spinnerSize: [20, 20, 0]
|
||||
});
|
||||
$("#text-date_from, #text-date_to").datepicker ();
|
||||
$.datepicker.regional["<?php echo $config['language']; ?>"];
|
||||
$("#text-time_from, #text-time_to").timeEntry ({
|
||||
spinnerImage: 'images/time-entry.png',
|
||||
spinnerSize: [20, 20, 0]
|
||||
});
|
||||
$("#text-date_from, #text-date_to").datepicker ();
|
||||
$.datepicker.regional["<?php echo $config['language']; ?>"];
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -260,12 +260,12 @@ foreach ($modules as $module) {
|
|||
if ($module["id_policy_module"] != 0) {
|
||||
$linked = policies_is_module_linked($module['id_agente_modulo']);
|
||||
$id_policy = db_get_value_sql('SELECT id_policy FROM tpolicy_modules WHERE id = '.$module["id_policy_module"]);
|
||||
|
||||
if ($id_policy != "")
|
||||
$name_policy = db_get_value_sql('SELECT name FROM tpolicies WHERE id = '.$id_policy);
|
||||
else
|
||||
$name_policy = __("Unknown");
|
||||
|
||||
|
||||
if ($id_policy != "")
|
||||
$name_policy = db_get_value_sql('SELECT name FROM tpolicies WHERE id = '.$id_policy);
|
||||
else
|
||||
$name_policy = __("Unknown");
|
||||
|
||||
$policyInfo = policies_info_module_policy($module["id_policy_module"]);
|
||||
|
||||
$adopt = false;
|
||||
|
@ -293,7 +293,7 @@ foreach ($modules as $module) {
|
|||
$title = __('(Unlinked) ') . $name_policy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$data[1] = '<a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&id=' . $id_policy . '">' .
|
||||
html_print_image($img,true, array('title' => $title)) .
|
||||
'</a>';
|
||||
|
|
|
@ -19,9 +19,9 @@ global $config;
|
|||
check_login ();
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "AR") && ! is_user_admin ($config['id_user'])) {
|
||||
db_pandora_audit("ACL Violation", "Trying to access GIS Agent view");
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
db_pandora_audit("ACL Violation", "Trying to access GIS Agent view");
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
}
|
||||
|
||||
require_once ('include/functions_gis.php');
|
||||
|
|
|
@ -39,7 +39,7 @@ $update_networkmap = get_parameter ('update_networkmap', 0);
|
|||
$recenter_networkmap = get_parameter ('recenter_networkmap', 0);
|
||||
$hidden_options = get_parameter ('hidden_options', 1);
|
||||
|
||||
if($delete_networkmap) {
|
||||
if ($delete_networkmap) {
|
||||
$result = networkmap_delete_networkmap($id_networkmap);
|
||||
$message = ui_print_result_message ($result,
|
||||
__('Network map deleted successfully'),
|
||||
|
@ -50,7 +50,7 @@ if($delete_networkmap) {
|
|||
$id_networkmap = 0;
|
||||
}
|
||||
|
||||
if($add_networkmap) {
|
||||
if ($add_networkmap) {
|
||||
// Load variables
|
||||
$layout = 'radial';
|
||||
$depth = 'all';
|
||||
|
@ -77,9 +77,9 @@ if($add_networkmap) {
|
|||
}
|
||||
else {
|
||||
$id_networkmap = networkmap_create_networkmap($name, $activeTab, $layout, $nooverlap, $simple, $regen, $font_size, $group, $module_group, $depth, $modwithalerts, $hidepolicymodules, $zoom, $ranksep, $center);
|
||||
$message = ui_print_result_message ($id_networkmap,
|
||||
__('Network map created successfully'),
|
||||
__('Could not create network map'), '', true);
|
||||
$message = ui_print_result_message ($id_networkmap,
|
||||
__('Network map created successfully'),
|
||||
__('Could not create network map'), '', true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ if($save_networkmap || $update_networkmap) {
|
|||
$check = db_get_value('name', 'tnetwork_map', 'name', $name);
|
||||
$subcheck = db_get_value('name', 'tnetwork_map', 'id_networkmap', $id_networkmap);
|
||||
|
||||
if($save_networkmap){
|
||||
if($save_networkmap) {
|
||||
if (!$check || $subcheck == $name) {
|
||||
$result = networkmap_update_networkmap($id_networkmap, array('name' => $name, 'type' => $activeTab, 'layout' => $layout,
|
||||
'nooverlap' => $nooverlap, 'simple' => $simple, 'regenerate' => $regen, 'font_size' => $font_size,
|
||||
|
@ -185,11 +185,11 @@ if($config['enterprise_installed']) {
|
|||
$buttons['groups'] = array('active' => $activeTab == 'groups',
|
||||
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/networkmap&tab=groups&pure='.$pure.'">' .
|
||||
html_print_image("images/group.png", true, array ("title" => __('Groups view'))) .'</a>');
|
||||
|
||||
|
||||
$buttons['topology'] = array('active' => $activeTab == 'topology',
|
||||
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/networkmap&tab=topology&pure='.$pure.'">' .
|
||||
html_print_image("images/recon.png", true, array ("title" => __('Topology view'))) .'</a>');
|
||||
|
||||
|
||||
$buttons['separator'] = array('separator' => '');
|
||||
|
||||
$combolist = '<form name="query_sel" method="post" action="index.php?sec=network&sec2=operation/agentes/networkmap">';
|
||||
|
@ -206,11 +206,11 @@ $buttons['addmap'] = array('active' => $activeTab == false,
|
|||
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/networkmap&add_networkmap=1&tab='.$activeTab.'&pure='.$pure.'">' .
|
||||
html_print_image("images/add.png", true, array ("title" => __('Add map'))) .'</a>');
|
||||
|
||||
if(!$nomaps && $id_networkmap != 0) {
|
||||
if (!$nomaps && $id_networkmap != 0) {
|
||||
$buttons['deletemap'] = array('active' => $activeTab == false,
|
||||
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/networkmap&id_networkmap='.$id_networkmap.'&delete_networkmap=1&tab='.$activeTab.'&pure='.$pure.'">' .
|
||||
html_print_image("images/cross.png", true, array ("title" => __('Delete map'))) .'</a>');
|
||||
|
||||
|
||||
$buttons['savemap'] = array('active' => $activeTab == false,
|
||||
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/networkmap&id_networkmap='.$id_networkmap.'&save_networkmap=1
|
||||
&tab='.$activeTab.'&save_networkmap=1&name='.$name.'&group='.$group.'
|
||||
|
|
|
@ -40,13 +40,13 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
$sub = array ();
|
||||
$sub["operation/agentes/tactical"]["text"] = __('Tactical view');
|
||||
$sub["operation/agentes/tactical"]["refr"] = 0;
|
||||
|
||||
|
||||
$sub["operation/agentes/group_view"]["text"] = __('Group view');
|
||||
$sub["operation/agentes/group_view"]["refr"] = 0;
|
||||
|
||||
$sub['operation/tree']['text'] = __('Tree view');
|
||||
$sub["operation/tree"]["refr"] = 0;
|
||||
|
||||
|
||||
$sub['operation/tree']['text'] = __('Tree view');
|
||||
$sub["operation/tree"]["refr"] = 0;
|
||||
|
||||
$sub["operation/agentes/estado_agente"]["text"] = __('Agent detail');
|
||||
$sub["operation/agentes/estado_agente"]["refr"] = 0;
|
||||
$sub["operation/agentes/estado_agente"]["subsecs"] = array(
|
||||
|
@ -82,14 +82,14 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
$sub2['godmode/snmpconsole/snmp_filters']['text'] = __('SNMP filters');
|
||||
enterprise_hook ('snmpconsole_submenu');
|
||||
$sub2['godmode/snmpconsole/snmp_trap_generator']['text'] = __('SNMP trap generator');
|
||||
|
||||
|
||||
$sub["operation/snmpconsole/snmp_view"]["sub2"] = $sub2;
|
||||
|
||||
$menu_operation["estado"]["sub"] = $sub;
|
||||
//End of view agents
|
||||
}
|
||||
|
||||
if ($config['metaconsole'] == 0) {
|
||||
if ($config['metaconsole'] == 0) {
|
||||
//Start network view
|
||||
|
||||
$menu_operation["network"]["text"] = __('Network View');
|
||||
|
@ -115,11 +115,11 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
$menu_operation["reporting"]["refr"] = 60;
|
||||
|
||||
$sub = array ();
|
||||
|
||||
|
||||
$sub["godmode/reporting/reporting_builder"]["text"] = __('Custom reporting');
|
||||
//Set godomode path
|
||||
$sub["godmode/reporting/reporting_builder"]["subsecs"] = array("godmode/reporting/reporting_builder",
|
||||
"operation/reporting/reporting_viewer");
|
||||
"operation/reporting/reporting_viewer");
|
||||
//Visual console
|
||||
$sub["godmode/reporting/map_builder"]["text"] = __('Visual console');
|
||||
//Set godomode path
|
||||
|
@ -127,13 +127,13 @@ if (check_acl ($config['id_user'], 0, "AR")) {
|
|||
"godmode/reporting/map_builder",
|
||||
"godmode/reporting/visual_console_builder");
|
||||
|
||||
if (!empty($config['vc_refr'])){
|
||||
if (!empty($config['vc_refr'])) {
|
||||
$sub["godmode/reporting/map_builder"]["refr"] = $config['vc_refr'];
|
||||
}
|
||||
else if (!empty($config['refr'])){
|
||||
else if (!empty($config['refr'])) {
|
||||
$sub["godmode/reporting/map_builder"]["refr"] = $config['refr'];
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$sub["godmode/reporting/map_builder"]["refr"] = 60;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,16 +48,16 @@ if (is_ajax()){
|
|||
$type = 1;
|
||||
|
||||
echo $type;
|
||||
}
|
||||
}
|
||||
|
||||
// Get values of the current netflow filter
|
||||
if ($get_filter_values){
|
||||
$id = get_parameter('id');
|
||||
|
||||
$filter_values = db_get_row_filter ('tnetflow_filter', array('id_sg' => $id));
|
||||
|
||||
|
||||
echo json_encode($filter_values);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -98,15 +98,16 @@ ui_print_page_header (__('Netflow live view'), "images/networkmap/so_cisco_new.p
|
|||
|
||||
// Save user defined filter
|
||||
if ($save != '' && check_acl ($config["id_user"], 0, "AW")) {
|
||||
|
||||
|
||||
// Save filter args
|
||||
$filter['filter_args'] = netflow_get_filter_arguments ($filter);
|
||||
|
||||
|
||||
$filter_id = db_process_sql_insert ('tnetflow_filter', $filter);
|
||||
if ($filter_id === false) {
|
||||
$filter_id = 0;
|
||||
echo '<h3 class="error">'.__ ('Error creating filter').'</h3>';
|
||||
} else {
|
||||
echo '<h3 class="error">'.__ ('Error creating filter').'</h3>';
|
||||
}
|
||||
else {
|
||||
echo '<h3 class="suc">'.__ ('Filter created successfully').'</h3>';
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +120,7 @@ else if ($update != '' && check_acl ($config["id_user"], 0, "AW")) {
|
|||
|
||||
// Save filter args
|
||||
$filter_copy['filter_args'] = netflow_get_filter_arguments ($filter_copy);
|
||||
|
||||
|
||||
$result = db_process_sql_update ('tnetflow_filter', $filter_copy, array ('id_sg' => $filter_id));
|
||||
ui_print_result_message ($result, __('Filter updated successfully'), __('Error updating filter'));
|
||||
}
|
||||
|
@ -129,19 +130,19 @@ else if ($update != '' && check_acl ($config["id_user"], 0, "AW")) {
|
|||
$filter['id_name'] = '';
|
||||
|
||||
echo '<form method="post" action="index.php?sec=netf&sec2=operation/netflow/nf_live_view">';
|
||||
|
||||
|
||||
// Chart options table
|
||||
$table->width = '100%';
|
||||
$table->border = 0;
|
||||
$table->class = "databox_color";
|
||||
$table->style[0] = 'vertical-align: top;';
|
||||
$table->data = array ();
|
||||
|
||||
|
||||
$table->data[0][0] = '<b>'.__('Date').'</b>';
|
||||
$table->data[0][1] = html_print_input_text ('date', $date, false, 10, 10, true);
|
||||
$table->data[0][1] .= html_print_image ("images/calendar_view_day.png", true, array ("alt" => "calendar", "onclick" => "scwShow(scwID('text-date'),this);"));
|
||||
$table->data[0][1] .= html_print_input_text ('time', $time, false, 10, 5, true);
|
||||
|
||||
|
||||
$table->data[0][2] = '<b>'.__('Interval').'</b>';
|
||||
$table->data[0][3] = html_print_select (netflow_get_valid_intervals (), 'period', $period, '', '', 0, true, false, false);
|
||||
$table->data[0][4] = '<b>'.__('Type').'</b>';
|
||||
|
@ -156,9 +157,9 @@ echo '<form method="post" action="index.php?sec=netf&sec2=operation/netflow/nf_l
|
|||
);
|
||||
$table->data[0][6] = '<b>'.__('Max. values').'</b>';
|
||||
$table->data[0][7] = html_print_select ($max_values, 'max_aggregates', $max_aggregates, '', '', 0, true);
|
||||
|
||||
|
||||
html_print_table ($table);
|
||||
|
||||
|
||||
// Filter options table
|
||||
$table->width = '100%';
|
||||
$table->border = 0;
|
||||
|
@ -166,10 +167,10 @@ echo '<form method="post" action="index.php?sec=netf&sec2=operation/netflow/nf_l
|
|||
$table->style[0] = 'vertical-align: top;';
|
||||
$table->size[0] = '15%';
|
||||
$table->data = array ();
|
||||
|
||||
|
||||
$table->data[0][0] = ui_print_error_message ('Define a name for the filter and click on Save as new filter again', '', true);
|
||||
$table->colspan[0][0] = 4;
|
||||
|
||||
|
||||
$table->data[1][0] = '<span id="filter_name_color"><b>'.__('Name').'</b></span>';
|
||||
$table->data[1][1] = html_print_input_text ('name', $filter['id_name'], false, 20, 80, true);
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
|
|
|
@ -46,7 +46,8 @@ if($update_date){
|
|||
$date = get_parameter_post ('date');
|
||||
$time = get_parameter_post ('time');
|
||||
$interval = get_parameter('period','86400');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$date = date ("Y/m/d", get_system_time ());
|
||||
$time = date ("H:i:s", get_system_time ());
|
||||
$interval ='86400';
|
||||
|
@ -55,9 +56,9 @@ $end_date = strtotime ($date . " " . $time);
|
|||
$start_date = $end_date - $interval;
|
||||
|
||||
$buttons['report_list'] = '<a href="index.php?sec=netf&sec2=operation/netflow/nf_reporting">'
|
||||
. html_print_image ("images/edit.png", true, array ("title" => __('Report list')))
|
||||
. '</a>';
|
||||
|
||||
. html_print_image ("images/edit.png", true, array ("title" => __('Report list')))
|
||||
. '</a>';
|
||||
|
||||
//Header
|
||||
ui_print_page_header (__('Netflow'), "images/networkmap/so_cisco_new.png", false, "", false, $buttons);
|
||||
|
||||
|
|
|
@ -109,10 +109,11 @@ check_login ();
|
|||
|
||||
$id_report = (int) get_parameter ('id');
|
||||
|
||||
if (! $id_report) {
|
||||
if (!$id_report) {
|
||||
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");
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -184,9 +185,9 @@ foreach ($contents as $content) {
|
|||
$data["period"] = human_time_description_raw ($content['period']);
|
||||
$data["uperiod"] = $content['period'];
|
||||
$data["type"] = $content["type"];
|
||||
|
||||
$session_id = session_id();
|
||||
|
||||
|
||||
$session_id = session_id();
|
||||
|
||||
switch ($content["type"]) {
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
|
@ -201,13 +202,13 @@ foreach ($contents as $content) {
|
|||
$data["objdata"]["img"] = $url;
|
||||
|
||||
break;
|
||||
case 'simple_baseline_graph':
|
||||
case 'simple_baseline_graph':
|
||||
$data["title"] = __('Simple baseline graph');
|
||||
|
||||
$img = grafico_modulo_sparse($content['id_agent_module'],
|
||||
$content['period'], 0, 720,
|
||||
230, '', null, false, true, false, ($datetime + $content['period']), '', true, 0, true, true);
|
||||
|
||||
|
||||
preg_match("/src='(.*)'/", $img, $matches);
|
||||
$url = "<![CDATA[".$matches[1]."]]>";
|
||||
|
||||
|
@ -218,15 +219,15 @@ foreach ($contents as $content) {
|
|||
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
|
||||
$data["title"] = __('Custom graph');
|
||||
$data["objdata"]["img_name"] = $graph["name"];
|
||||
|
||||
|
||||
$result = db_get_all_rows_field_filter ("tgraph_source","id_graph",$content['id_gs']);
|
||||
$modules = array ();
|
||||
$weights = array ();
|
||||
|
||||
|
||||
if ($result === false) {
|
||||
$result = array();
|
||||
}
|
||||
|
||||
|
||||
foreach ($result as $content2) {
|
||||
array_push ($modules, $content2['id_agent_module']);
|
||||
array_push ($weights, $content2["weight"]);
|
||||
|
@ -247,20 +248,20 @@ foreach ($contents as $content) {
|
|||
|
||||
preg_match("/src='(.*)'/", $img, $matches);
|
||||
$url = "<![CDATA[".$matches[1]."]]>";
|
||||
|
||||
|
||||
$data["objdata"]["img"] = $url;
|
||||
|
||||
break;
|
||||
case 3:
|
||||
case 'SLA':
|
||||
$data["title"] = __('S.L.A.');
|
||||
|
||||
|
||||
$slas = db_get_all_rows_field_filter ('treport_content_sla_combined','id_report_content', $content['id_rc']);
|
||||
if ($slas === false) {
|
||||
$data["objdata"]["error"] = __('There are no SLAs defined');
|
||||
$slas = array ();
|
||||
}
|
||||
|
||||
|
||||
$data["objdata"]["sla"] = array ();
|
||||
$sla_failed = false;
|
||||
|
||||
|
@ -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']);
|
||||
if ($sla_value === false) {
|
||||
$sla_data["error"] = __('Unknown');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ($sla_value < $sla['sla_limit']) {
|
||||
$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);
|
||||
if ($monitor_value === false) {
|
||||
$monitor_value = __('Unknown');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$monitor_value = format_numeric ($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);
|
||||
if ($data["objdata"] === false) {
|
||||
$data["objdata"] = __('Unknown');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data["objdata"] = format_numeric ($data["objdata"]);
|
||||
}
|
||||
break;
|
||||
|
@ -313,7 +317,8 @@ foreach ($contents as $content) {
|
|||
$data["objdata"] = reporting_get_agentmodule_data_max ($content['id_agent_module'], $content['period'], $datetime);
|
||||
if ($data["objdata"] === false) {
|
||||
$data["objdata"] = __('Unknown');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data["objdata"] = format_numeric ($data["objdata"]);
|
||||
}
|
||||
break;
|
||||
|
@ -323,7 +328,8 @@ foreach ($contents as $content) {
|
|||
$data["objdata"] = reporting_get_agentmodule_data_min ($content['id_agent_module'], $content['period'], $datetime);
|
||||
if ($data["objdata"] === false) {
|
||||
$data["objdata"] = __('Unknown');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data["objdata"] = format_numeric ($data["objdata"]);
|
||||
}
|
||||
break;
|
||||
|
@ -333,7 +339,8 @@ foreach ($contents as $content) {
|
|||
$data["objdata"] = reporting_get_agentmodule_data_sum ($content['id_agent_module'], $content['period'], $datetime);
|
||||
if ($data["objdata"] === false) {
|
||||
$data["objdata"] = __('Unknown');
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$data["objdata"] = format_numeric ($data["objdata"]);
|
||||
}
|
||||
break;
|
||||
|
@ -527,14 +534,14 @@ foreach ($contents as $content) {
|
|||
break;
|
||||
case 'url':
|
||||
$data["title"] = __('Import text from URL');
|
||||
|
||||
|
||||
$curlObj = curl_init();
|
||||
|
||||
curl_setopt($curlObj, CURLOPT_URL, $content['external_source']);
|
||||
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
|
||||
$output = curl_exec($curlObj);
|
||||
$output = curl_exec($curlObj);
|
||||
curl_close($curlObj);
|
||||
|
||||
|
||||
$data["objdata"] = $output;
|
||||
break;
|
||||
case 'database_serialized':
|
||||
|
@ -580,10 +587,11 @@ foreach ($contents as $content) {
|
|||
$ttr = reporting_get_agentmodule_ttr ($content['id_agent_module'], $content['period'], $report["datetime"]);
|
||||
if ($ttr === false) {
|
||||
$ttr = __('Unknown');
|
||||
} else if ($ttr != 0) {
|
||||
}
|
||||
else if ($ttr != 0) {
|
||||
$ttr = human_time_description_raw ($ttr);
|
||||
}
|
||||
|
||||
|
||||
$data["title"] = __('TTRT');
|
||||
$data["objdata"] = $ttr;
|
||||
break;
|
||||
|
@ -591,10 +599,11 @@ foreach ($contents as $content) {
|
|||
$tto = reporting_get_agentmodule_tto ($content['id_agent_module'], $content['period'], $report["datetime"]);
|
||||
if ($tto === false) {
|
||||
$tto = __('Unknown');
|
||||
} else if ($tto != 0) {
|
||||
}
|
||||
else if ($tto != 0) {
|
||||
$tto = human_time_description_raw ($tto);
|
||||
}
|
||||
|
||||
|
||||
$data["title"] = __('TTO');
|
||||
$data["objdata"] = $tto;
|
||||
break;
|
||||
|
@ -602,10 +611,11 @@ foreach ($contents as $content) {
|
|||
$mtbf = reporting_get_agentmodule_mtbf ($content['id_agent_module'], $content['period'], $report["datetime"]);
|
||||
if ($mtbf === false) {
|
||||
$mtbf = __('Unknown');
|
||||
} else if ($mtbf != 0) {
|
||||
}
|
||||
else if ($mtbf != 0) {
|
||||
$mtbf = human_time_description_raw ($mtbf);
|
||||
}
|
||||
|
||||
|
||||
$data["title"] = __('MTBF');
|
||||
$data["objdata"] = $mtbf;
|
||||
break;
|
||||
|
@ -613,10 +623,11 @@ foreach ($contents as $content) {
|
|||
$mttr = reporting_get_agentmodule_mttr ($content['id_agent_module'], $content['period'], $report["datetime"]);
|
||||
if ($mttr === false) {
|
||||
$mttr = __('Unknown');
|
||||
} else if ($mttr != 0) {
|
||||
}
|
||||
else if ($mttr != 0) {
|
||||
$mttr = human_time_description_raw ($mttr);
|
||||
}
|
||||
|
||||
|
||||
$data["title"] = __('MTTR');
|
||||
$data["objdata"] = $mttr;
|
||||
break;
|
||||
|
@ -629,7 +640,7 @@ foreach ($contents as $content) {
|
|||
$id_agent = $es['id_agents'];
|
||||
$module_name = $es['inventory_modules'];
|
||||
$date = $es['date'];
|
||||
|
||||
|
||||
$data["objdata"]["inventory"] = inventory_get_data((array)$id_agent,(array)$module_name,$date,'',false, 'array');
|
||||
break;
|
||||
case 'inventory_changes':
|
||||
|
@ -640,9 +651,9 @@ foreach ($contents as $content) {
|
|||
|
||||
$id_agent = $es['id_agents'];
|
||||
$module_name = $es['inventory_modules'];
|
||||
|
||||
|
||||
$data["objdata"]["inventory_changes"] = inventory_get_changes($id_agent, $module_name, $report["datetime"] - $content['period'], $report["datetime"], 'array');
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
xml_array ($data);
|
||||
|
@ -651,4 +662,4 @@ foreach ($contents as $content) {
|
|||
}
|
||||
|
||||
echo '</reports></report>';
|
||||
?>
|
||||
?>
|
|
@ -432,7 +432,7 @@ if ($traps !== false) {
|
|||
$data = array ();
|
||||
if (empty($trap["description"])){
|
||||
$trap["description"]="";
|
||||
}
|
||||
}
|
||||
$severity = enterprise_hook ('get_severity', array ($trap));
|
||||
if ($severity === ENTERPRISE_NOT_HOOK) {
|
||||
$severity = $trap["alerted"] == 1 ? $trap["priority"] : 1;
|
||||
|
@ -441,10 +441,11 @@ if ($traps !== false) {
|
|||
//Status
|
||||
if ($trap["status"] == 0) {
|
||||
$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"));
|
||||
}
|
||||
|
||||
|
||||
// Agent matching source address
|
||||
$agent = agents_get_agent_with_ip ($trap['source']);
|
||||
if ($agent === false) {
|
||||
|
@ -452,7 +453,8 @@ if ($traps !== false) {
|
|||
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>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR")) {
|
||||
continue;
|
||||
}
|
||||
|
@ -532,35 +534,42 @@ if ($traps !== false) {
|
|||
$string = '<table style="border:solid 1px #D3D3D3;" width="90%" class="toggle">
|
||||
<tr><td align="left" valign="top" width="15%" ><b>' . __('Custom data:') . '</b></td><td align="left" >' . $trap['oid_custom'] . '</td></tr>'
|
||||
. '<tr><td align="left" valign="top">' . '<b>' . __('OID:') . '</td><td align="left"> ' . $trap['oid'] . '</td></tr>';
|
||||
|
||||
if ($trap["description"] != ""){
|
||||
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Description:') . '</td><td align="left">' . $trap['description'] . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($trap["type"] != ""){
|
||||
$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"]){
|
||||
case -1: $desc_trap_type = __('None');
|
||||
break;
|
||||
case 0: $desc_trap_type = __('Cold start (0)');
|
||||
break;
|
||||
case 1: $desc_trap_type = __('Warm start (1)');
|
||||
break;
|
||||
case 2: $desc_trap_type = __('Link down (2)');
|
||||
break;
|
||||
case 3: $desc_trap_type = __('Link up (3)');
|
||||
break;
|
||||
case 4: $desc_trap_type = __('Authentication failure (4)');
|
||||
break;
|
||||
default: $desc_trap_type = __('Other');
|
||||
break;
|
||||
|
||||
if ($trap["description"] != "") {
|
||||
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Description:') . '</td><td align="left">' . $trap['description'] . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($trap["type"] != "") {
|
||||
$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"]) {
|
||||
case -1:
|
||||
$desc_trap_type = __('None');
|
||||
break;
|
||||
case 0:
|
||||
$desc_trap_type = __('Cold start (0)');
|
||||
break;
|
||||
case 1:
|
||||
$desc_trap_type = __('Warm start (1)');
|
||||
break;
|
||||
case 2:
|
||||
$desc_trap_type = __('Link down (2)');
|
||||
break;
|
||||
case 3:
|
||||
$desc_trap_type = __('Link up (3)');
|
||||
break;
|
||||
case 4:
|
||||
$desc_trap_type = __('Authentication failure (4)');
|
||||
break;
|
||||
default:
|
||||
$desc_trap_type = __('Other');
|
||||
break;
|
||||
}
|
||||
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Type:') . '</td><td align="left">' . $desc_trap_type . '</td></tr>';
|
||||
}
|
||||
|
||||
$string .= '</table>';
|
||||
|
||||
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Type:') . '</td><td align="left">' . $desc_trap_type . '</td></tr>';
|
||||
}
|
||||
|
||||
$string .= '</table>';
|
||||
|
||||
$data = array($string); //$data = array($trap['description']);
|
||||
$idx++;
|
||||
$table->rowclass[$idx] = 'trap_info_' . $trap['id_trap'];
|
||||
|
@ -575,7 +584,8 @@ $trap_types = array(-1 => __('None'), 0 => __('Cold start (0)'), 1 => __('Warm s
|
|||
// No matching traps
|
||||
if ($idx == 0) {
|
||||
echo '<div class="nf">'.__('No matching traps found').'</div>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
html_print_table ($table);
|
||||
}
|
||||
|
||||
|
@ -641,7 +651,7 @@ function toggleDiv (divid){
|
|||
|
||||
function toggleVisibleExtendedInfo(id_trap) {
|
||||
display = $('.trap_info_' + id_trap).css('display');
|
||||
|
||||
|
||||
if (display != 'none') {
|
||||
$('.trap_info_' + id_trap).css('display', 'none');
|
||||
}
|
||||
|
@ -650,4 +660,4 @@ function toggleVisibleExtendedInfo(id_trap) {
|
|||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</script>
|
|
@ -641,13 +641,12 @@ if (is_ajax ())
|
|||
html_print_image ("operation/tree/leaf.png", false, array ("style" => 'vertical-align: middle;', "id" => "tree_image_os_" . $row["id_agente"], "pos_tree" => "1" ));
|
||||
else
|
||||
html_print_image ("operation/tree/last_leaf.png", false, array ("style" => 'vertical-align: middle;', "id" => "tree_image_os_" . $row["id_agente"], "pos_tree" => "2" ));
|
||||
|
||||
|
||||
// This line checks for (non-initialized) asyncronous modules
|
||||
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;
|
||||
$title = __('UNKNOWN');
|
||||
|
||||
} // Else checks module status
|
||||
$title = __('UNKNOWN');
|
||||
} // Else checks module status
|
||||
elseif ($row["estado"] == 1) {
|
||||
$status = STATUS_MODULE_CRITICAL;
|
||||
$title = __('CRITICAL');
|
||||
|
@ -671,11 +670,11 @@ if (is_ajax ())
|
|||
else {
|
||||
$title .= " : " . substr(io_safe_output($row["datos"]),0,42);
|
||||
}
|
||||
|
||||
|
||||
echo str_replace('.png' ,'_ball.png',
|
||||
str_replace('img', 'img style="vertical-align: middle;"', ui_print_status_image($status, $title,true))
|
||||
);
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo str_replace('img', 'img style="vertical-align: middle;"', servers_show_type ($row['id_modulo']));
|
||||
echo " ";
|
||||
$graph_type = return_graphtype ($row["id_tipo_modulo"]);
|
||||
|
|
|
@ -113,7 +113,8 @@ if (isset ($_GET["modified"]) && !$view_mode) {
|
|||
$pass_ok = login_validate_pass($password_new, $id, true);
|
||||
if ($pass_ok != 1) {
|
||||
ui_print_error_message($pass_ok);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$return = update_user_password ($id, $password_new);
|
||||
if ($return) {
|
||||
$return2 = save_pass_history($id, $password_new);
|
||||
|
@ -122,45 +123,39 @@ if (isset ($_GET["modified"]) && !$view_mode) {
|
|||
__('Password successfully updated'),
|
||||
__('Error updating passwords: %s', $config['auth_error']));
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$return = update_user_password ($id, $password_new);
|
||||
ui_print_result_message ($return,
|
||||
__('Password successfully updated'),
|
||||
__('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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// No need to display "error" here, because when no update is needed (no changes in data)
|
||||
// SQL function returns 0 (FALSE), but is not an error, just no change. Previous error
|
||||
// message could be confussing to the user.
|
||||
|
||||
|
||||
$return = update_user ($id, $upd_info);
|
||||
if ($return > 0) {
|
||||
ui_print_result_message ($return,
|
||||
__('User info successfully updated'),
|
||||
__('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;
|
||||
}
|
||||
|
||||
// Prints action status for current message
|
||||
if ($status != -1){
|
||||
if ($status != -1) {
|
||||
ui_print_result_message ($status,
|
||||
__('User info successfully updated'),
|
||||
__('Error updating user info'));
|
||||
__('User info successfully updated'),
|
||||
__('Error updating user info'));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue