2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
|
|
|
|
2008-04-01 15:53:11 +02:00
|
|
|
// Pandora FMS - the Free Monitoring System
|
2007-03-12 18:58:52 +01:00
|
|
|
// ========================================
|
2008-04-01 15:53:11 +02:00
|
|
|
// Copyright (c) 2008 Artica Soluciones Tecnológicas, http://www.artica.es
|
|
|
|
// Please see http://pandora.sourceforge.net for full contribution list
|
|
|
|
|
2006-07-11 10:49:21 +02:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-04-01 15:53:11 +02:00
|
|
|
// as published by the Free Software Foundation for version 2.
|
2006-07-11 10:49:21 +02:00
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2006-07-11 10:49:21 +02:00
|
|
|
// Load global vars
|
2006-03-27 05:37:27 +02:00
|
|
|
require("include/config.php");
|
2006-07-11 10:49:21 +02:00
|
|
|
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
|
|
|
if (comprueba_login()) {
|
|
|
|
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Database Management");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
}
|
|
|
|
if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user'])) {
|
|
|
|
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Database Management");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
}
|
2008-06-16 20:09:56 +02:00
|
|
|
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
|
|
|
$update_settings = (bool) get_parameter ('update_settings');
|
|
|
|
|
|
|
|
if ($update_settings) {
|
|
|
|
$config["block_size"] = (int) get_parameter ('block_size');
|
|
|
|
$config["language"] = (string) get_parameter ('language_code');
|
|
|
|
$config["days_compact"] = (int) get_parameter ('days_compact');
|
|
|
|
$config["days_purge"] = (int) get_parameter ('days_purge');
|
|
|
|
$config["graph_res"] = (int) get_parameter ('graph_res');
|
|
|
|
$config["step_compact"] = (int) get_parameter ('step_compact');
|
|
|
|
$config["show_unknown"] = (int) get_parameter ('show_unknown');
|
|
|
|
$config["show_lastalerts"] = (int) get_parameter ('show_lastalerts');
|
|
|
|
$config["style"] = (string) get_parameter ('style', 'pandora.css');
|
|
|
|
$config["remote_config"] = (string) get_parameter ('remote_config');
|
|
|
|
$config["graph_color1"] = (string) get_parameter ('graph_color1');
|
|
|
|
$config["graph_color2"] = (string) get_parameter ('graph_color2');
|
|
|
|
$config["graph_color3"] = (string) get_parameter ('graph_color3');
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
|
|
|
$config["style"] = substr ($config["style"], 0, strlen ($config["style"]) - 4);
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["remote_config"]."' WHERE token = 'remote_config'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["block_size"]."' WHERE token = 'block_size'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["language"]."' WHERE token = 'language_code'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["days_purge"]."' WHERE token = 'days_purge'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["days_compact"]." ' WHERE token = 'days_compact'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_res"]."' WHERE token = 'graph_res'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["step_compact"]."' WHERE token = 'step_compact'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["show_unknown"]."' WHERE token = 'show_unknown'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["show_lastalerts"]."' WHERE token = 'show_lastalerts'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["style"]."' WHERE token = 'style'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color1"]."' WHERE token = 'graph_color1'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color2"]."' WHERE token = 'graph_color2'");
|
|
|
|
mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color3"]."' WHERE token = 'graph_color3'");
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
|
|
|
|
|
|
|
echo "<h2>".lang_string ("setup_screen")." > ";
|
|
|
|
echo lang_string ("general_config")."</h2>";
|
|
|
|
|
|
|
|
$file_styles = list_files('include/styles/', "pandora", 1, 0);
|
|
|
|
|
|
|
|
$table->width = '500px';
|
|
|
|
$table->data = array ();
|
|
|
|
$table->data[0][0] = lang_string ('language_code');
|
|
|
|
$table->data[0][1] = print_select_from_sql ('SELECT id_language, name FROM tlanguage', 'language_code', $config["language"], '', '', '', true);
|
|
|
|
$table->data[1][0] = lang_string ('Remote config directory');
|
|
|
|
$table->data[1][1] = print_input_text ('remote_config', $config["remote_config"], '', 30, 100, true);
|
|
|
|
$table->data[2][0] = lang_string ('Graph color (min)');
|
|
|
|
$table->data[2][1] = print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
|
|
|
|
$table->data[3][0] = lang_string ('Graph color (avg)');
|
|
|
|
$table->data[3][1] = print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
|
|
|
|
$table->data[4][0] = lang_string ('Graph color (max)');
|
|
|
|
$table->data[4][1] = print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
|
|
|
|
$table->data[5][0] = lang_string ('days_compact');
|
|
|
|
$table->data[5][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true);
|
|
|
|
$table->data[6][0] = lang_string ('days_purge');
|
|
|
|
$table->data[6][1] = print_input_text ('days_purge', $config["days_purge"], '', 5, 5, true);
|
|
|
|
$table->data[7][0] = lang_string ('graph_res');
|
|
|
|
$table->data[7][1] = print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
|
|
|
|
$table->data[8][0] = lang_string ('step_compact');
|
|
|
|
$table->data[8][1] = print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true);
|
|
|
|
$table->data[9][0] = lang_string ('show_unknown');
|
|
|
|
$table->data[9][1] = print_checkbox ('show_unknown', 1, $config["show_unknown"], true);
|
|
|
|
$table->data[10][0] = lang_string ('show_lastalerts');
|
|
|
|
$table->data[10][1] = print_checkbox ('show_lastalerts', 1, $config["show_lastalerts"], true);
|
|
|
|
$table->data[11][0] = lang_string ('style_template');
|
|
|
|
$table->data[11][1] = print_select ($file_styles, 'style', $config["style"], '', '', '', true);
|
|
|
|
$table->data[12][0] = lang_string ('block_size');
|
|
|
|
$table->data[12][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true);
|
|
|
|
|
|
|
|
echo '<form id="form_setup" method="POST" action="index.php?sec=gsetup&sec2=godmode/setup/setup">';
|
|
|
|
print_input_hidden ('update_settings', 1);
|
|
|
|
print_table ($table);
|
|
|
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
|
|
|
print_submit_button (lang_string ('update'), 'update_button', false, 'class="sub upd"');
|
|
|
|
echo '</div>';
|
|
|
|
echo '</form>';
|
|
|
|
?>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="include/styles/color-picker.css" type="text/css" />
|
|
|
|
<script type="text/javascript" src="include/javascript/jquery.js"></script>
|
|
|
|
<script type="text/javascript" src="include/javascript/jquery.colorpicker.js"></script>
|
|
|
|
<script language="javascript" type="text/javascript">
|
|
|
|
$(document).ready (function () {
|
|
|
|
$("#form_setup #text-graph_color1").attachColorPicker();
|
|
|
|
$("#form_setup #text-graph_color2").attachColorPicker();
|
|
|
|
$("#form_setup #text-graph_color3").attachColorPicker();
|
|
|
|
});
|
|
|
|
</script>
|