pandorafms/pandora_console/extensions/update_manager/main.php

101 lines
4.0 KiB
PHP
Raw Normal View History

<?php
// Pandora FMS - the Flexible Monitoring System
// ============================================
// Copyright (c) 2008 Artica Soluciones Tecnologicas, http://www.artica.es
// Please see http://pandora.sourceforge.net for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// 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.
// Load global vars
require_once ("include/config.php");
check_login ();
if (! give_acl ($config['id_user'], 0, 'PM')) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to use Open Update Manager extension");
include ("general/noaccess.php");
exit;
}
$db =& um_db_connect ('mysql', $config['dbhost'], $config['dbuser'],
$config['dbpass'], $config['dbname']);
$settings = um_db_load_settings ();
echo '<h2>'.__('Update manager').'</h2>';
if ($settings->customer_key == FREE_USER) {
echo '<div class="notify" style="width: 80%; text-align:left;" >';
echo '<img src="images/information.png" /> ';
/* Translators: Do not translade Update Manager, it's the name of the program */
echo __('The new <a href="http://updatemanager.sourceforge.net">Update Manager</a> client is shipped with Pandora FMS 2.0. It helps system administrators to update their Pandora FMS automatically, since the Update Manager does the task of getting new modules, new plugins and new features (even full migrations tools for future versions) automatically.');
echo '<p />';
echo __('Update Manager is one of the most advanced features of Pandora FMS 2.0 Enterprise version, for more information visit <a href="http://pandorafms.com">http://pandorafms.com</a>.');
echo '<p />';
echo __('Update Manager sends anonymous information about Pandora FMS usage (number of agents and modules running). To disable it, just delete extension or remove remote server address from Update Manager plugin setup.');
echo '</div>';
}
$user_key = get_user_key ($settings);
$update_package = (bool) get_parameter_post ('update_package');
if ($update_package) {
2009-01-12 Esteban Sanchez <estebans@artica.es> * godmode/agentes/alert_manager.php: Complete rewritten of the alert system when assigned alerts to an agent. * pandoradb.sql: New tables for alert system. These are: talert_commands, talert_actions, talert_templates, talert_template_modules, talert_template_module_actions. No migration tool is available yet. * godmode/alerts/configure_alert_template.php, godmode/alerts/configure_alert_action.php, godmode/alerts/alert_templates.php, godmode/alerts/configure_alert_command.php, godmode/alerts/alert_actions.php: Added to repository. Administration interface to new alert system. * godmode/alerts/modify_alert.php: Deleted from repository. * godmode/setup/setup.php: Added an example of the date format. Main table has now percentage width. * godmode/menu.php, operation/menu.php: Added new alert options. Removed refr value when it's not neccesary. * include/styles/pandora.css: Added width to textarea elements. Style correction and cleanup. Tables doesn't have a odd-even pattern, but the hovered row now changes its colour. New styles for alert pages. * include/functions_custom_graphs.php: Added to repository. custom graphs functions moved here. * include/functions_incidents.php, include/functions_events.php: Moved to LGPL. Style comment corrections. * include/functions_html.php: Documentation style correction. Added print_input_file() and print_label(). * include/functions_ui.php: Doc style correction. * operation/reporting/graph_viewer.php: Include new function file with custom graphs. Use generic functions. * index.php: Unset pass from POST and REQUEST arrays. * include/functions_db.php: Some documentation updated to new format. Added format_array_to_update_sql() to generate SQL sentences for updates. Style correction. * godmode/agentes/configurar_agente.php: Variables renamed to have a meaning. * extensions/update_manager/main.php: Mark an string translatable. * extensions/update_manager/lib/libupdate_manager_client.php, godmode/alerts/configure_alert.php, include/functions.php, godmode/agentes/module_manager.php, operation/agentes/networkmap.php, operation/reporting/reporting_viewer.php, godmode/agentes/manage_config.php: Style correction. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
echo '<h2>'.__('Updating').'...</h2>';
flush ();
$force = (bool) get_parameter_post ('force_update');
um_client_upgrade_to_latest ($user_key, $force);
/* TODO: Add a new in tnews */
$settings = um_db_load_settings ();
}
$package = um_client_check_latest_update ($settings, $user_key);
if (is_int ($package) && $package == 1) {
echo '<h5 class="suc">'.__('Your system is up-to-date').'.</h5>';
} elseif ($package === false) {
echo '<h5 class="error">'.__('Server connection failed')."</h5>";
} elseif (is_int ($package) && $package == 0) {
echo '<h5 class="error">'.__('Server authorization rejected')."</h5>";
} else {
echo '<h5 class="suc">'.__('There\'s a new update for Pandora FMS')."</h5>";
2009-03-04 Sancho Lerena <slerena@artica.es> * extras/: New directory with extra contents (scripts, tools, samples) * index.php: Add new permission check for /attachment directory. Probably could be extended and wrapped into a function. This should be only called once, this is the reason why is placed here and not in config_process. * pandora_console_upgrade: Force MYSQL run, even if SQL return error (useful for applying over a older 3.0 version for example). * pandoradb_data.sql: Was missing some tconfig variables. * extras/*.sql: Missing somre tconfig variables and other minor issues fixed * extensions/update_manager/main.php: Description of update manager patch wider. Probably needs more formatting in the future. * extras/sample_login.php: Sample on how to implement autologin feature. * footer.php: I hope solve the frakkin image problem. * godmode/agents/agent_manager.php: proper ACL check notice. * godmode/alerts/alert_list.php: Fixed notice. * godmode/reporting/map_builder.php: Added link to wizard and item count. * godmode/reporting/map_builder_wizard.php: Added new feature, a wizard to populate the visual map, using agents from a combo, depending on the map selected. Could have a lot of improvements, it's a basic start. Allow to choose agents and image maps and space between images. Puts in a reticle automatically adjusting at 600px width. * godmode/setup.php: Checkbox for trap_forward was bad, fixed. * config_process.php: Fixed version to 3.0-dev * functions_html.php: Default of 0 in text boxes makes them unusable on default values, funny :-) * include/functions_reporting.php: Fixed a notice on unknown variable on function get_group_stat(). * operation/agentes/alerts_status.php: Filter on module status is made now with combos, like the rest of the filters in the GUI. * operation/events/events.php: a missing div makes graph float outside the filter box. TODO: Hidder filter makes free-width style buggy here. * operation/reporting/reporting_viewer.php: Fixed layout issue. * operation/visual_console/render_view.php: Added ACL check. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1510 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-04 18:57:00 +01:00
$table->width = '80%';
$table->data = array ();
$table->data[0][0] = '<strong>'.__('Id').'</strong>';
$table->data[0][1] = $package->id;
$table->data[1][0] = '<strong>'.__('Timestamp').'</strong>';
$table->data[1][1] = $package->timestamp;
$table->data[2][0] = '<strong>'.__('Description').'</strong>';
$table->data[2][1] = html_entity_decode ($package->description);
print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form method="post">';
echo __('Overwrite local changes');
print_checkbox ('force_update', '1', false);
echo '<p />';
print_input_hidden ('update_package', 1);
print_submit_button (__('Update'), 'update_button', false, 'class="sub upd"');
echo '</form>';
echo '</div>';
}
echo '<h4>'.__('Your system version number is').': '.$settings->current_update.'</h4>';
?>