2012-04-13 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_config.php, index.php,
	extensions/update_manager/lib/functions.ajax.php,
	extensions/update_manager/lib/functions.php,
	extensions/update_manager/main.php,
	extensions/update_manager/update_pandora.php,
	general/logon_ok.php:: some fixeds and some changes for run fine and
	pretty the update manager. 
	
	Merged from the branch "pandora_4.0"
	



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5970 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-04-13 10:39:28 +00:00
parent 5ba12da9d3
commit 065a5cca77
8 changed files with 82 additions and 56 deletions

View File

@ -1,3 +1,15 @@
2012-04-13 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, index.php,
extensions/update_manager/lib/functions.ajax.php,
extensions/update_manager/lib/functions.php,
extensions/update_manager/main.php,
extensions/update_manager/update_pandora.php,
general/logon_ok.php:: some fixeds and some changes for run fine and
pretty the update manager.
Merged from the branch "pandora_4.0"
2012-04-13 Junichi Satoh <junichi@rworks.jp>
* godmode/alerts/configure_alert_compound.php: Added special days

View File

@ -131,7 +131,7 @@ function update_pandora_download_package() {
if ($conf_update_pandora['download_mode'] == 'wget') {
$command = "wget " .
$package_url . " -P " . $dir .
$package_url . " -O " . $dir . $package .
" -o /tmp/" . $package . ".info.txt";
$return = array('correct' => 0);

View File

@ -143,11 +143,13 @@ function update_pandora_get_list_downloaded_packages($mode = 'operation') {
if (empty($packages)) {
if ($mode == 'operation') {
$packages[] = array('name' =>
__('There are not downloaded packages in your Pandora Console.'));
__('There are not downloaded packages in your Pandora Console.'),
'time' => '');
}
else {
$packages[] = array('empty' => true, 'name' =>
__('There are not downloaded packages in your Pandora Console.'));
__('There are not downloaded packages in your Pandora Console.'),
'time' => '');
}
}
@ -233,7 +235,7 @@ function update_pandora_print_javascript_admin() {
draggable: false,
modal: true,
height: 400,
width: 600,
width: 650,
overlay: {
opacity: 0.5,
background: "black"
@ -258,7 +260,7 @@ function update_pandora_print_javascript_admin() {
draggable: true,
modal: true,
height: 400,
width: 600,
width: 650,
overlay: {
opacity: 0.5,
background: "black"
@ -336,6 +338,7 @@ function update_pandora_print_javascript_admin() {
$("#info_text").html('');
$("#button_close_download_disabled").hide();
$("#button_close_download").show();
}
}
@ -394,6 +397,7 @@ function update_pandora_print_javascript_admin() {
else {
$("#title_installing_update_pandora").hide();
$("#title_installed_update_pandora").show();
$("#button_close_download_disabled").hide();
$("#button_close_download").show();
}
}
@ -423,16 +427,15 @@ function update_pandora_print_javascript_admin() {
$("tbody", "#online_packages").append(
'<tr class="package_' + data['package'] + '">' +
'<td style=" text-align:left; width:50%;" class="name_package">' +
'<?php echo '<b>' . __('There is a new version:') . '</b> '; ?>' +
'<td style=" text-align:left; width:50%;" valign="top" class="name_package">' +
'<?php echo '<b>' . __('There is a new version:') . '</b><br><br> '; ?>' +
data['package'] +
'</td>' +
'<td style=" text-align:left; width:30%;" class="timestamp_package">' +
'<td style=" text-align:left; width:30%;" valign="bottom" class="timestamp_package">' +
data['timestamp'] +
'</td>' +
'<td style=" text-align:center; width:50px;">' +
'<td style=" text-align:center; width:50px;" valign="bottom">' +
buttonUpdate +
' ' + data['text_adv'] +
'</td>' +
'</tr>');

View File

@ -84,16 +84,12 @@ function main_view_enterprise($settings, $user_key) {
}
echo '<h4>';
echo __('Your Pandora FMS Enterprise version number is') . ' ' .
$settings->current_update;
echo "</h4>";
$table = null;
$table->width = '98%';
$table->style = array();
$table->style[0] = 'font-weight: bolder; font-size: 20px;';
$table->data = array();
$table->data[0][0] = __('Your Pandora FMS Enterprise version number is')
. ' ' . $settings->current_update;
html_print_table($table);
echo "<br><br>";
/* Translators: Do not translade Update Manager, it's the name of the program */

View File

@ -78,17 +78,20 @@ function update_pandora_administration($settings, $user_key) {
}
$conf_update_pandora = update_pandora_get_conf();
$table = null;
$table->width = '98%';
$table->style = array();
$table->style[0] = 'font-weight: bolder; font-size: 20px;';
$table->data = array();
$table->data[0][0] = __('Your Pandora FMS open source package installed is') .
' ' . $conf_update_pandora['last_installed'];
html_print_table($table);
if (!empty($conf_update_pandora['last_installed'])){
echo '<h4>';
echo __('Your Pandora FMS open source package installed is') .
' ' . $conf_update_pandora['last_installed'];
echo "</h4>";
} else {
echo '<h4>';
echo __('Your Pandora FMS does not have any update installed yet');
echo "</h4>";
}
echo "<br><br>";
ui_print_info_message(
'<p>' .
__('This is a automatilly update Pandora Console only. Be careful if you have changed any php file of console, please make a backup this modified files php. Because the update action ovewrite all php files in Pandora console.') .
@ -97,13 +100,10 @@ function update_pandora_administration($settings, $user_key) {
__('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.') .
'</p>'
);
$table = null;
$table->width = '98%';
$table->data = array();
$table->data[0][0] = '<h4>' . __('Online') . '</h4>';
$table->data[1][0] =
'<table id="online_packages" class="databox" width="80%" cellspacing="4" cellpadding="4" border="0" style="">' .
echo "<h4>". __('Online') . '</h4>';
echo '<table id="online_packages" class="databox" width="95%" cellspacing="4" cellpadding="4" border="0" style="">' .
'<tbody>
<tr id="online_packages-0" class="spinner_row" style="">
<td id="online_packages-0-0" style=" text-align:left; width:80%;">' .
@ -113,22 +113,21 @@ function update_pandora_administration($settings, $user_key) {
</tr>
</tbody>' .
'</table>';
html_print_table($table);
?>
<div id="dialog_download" title="<?php echo __('Process packge'); ?>"
style="display:none;">
<div style="position:absolute; top:20%; text-align: center; left:0%; right:0%; width:600px;">
<div style="position:absolute; top:10%; text-align: center; left:0%; right:0%; width:600px;">
<?php
echo '<h2 id="title_downloading_update_pandora">' . __('Downloading <span class="package_name">package</span> in progress') . " ";
echo '<h4 id="title_downloading_update_pandora">' . __('Downloading <span class="package_name">package</span> in progress') . " ";
html_print_image('images/spinner.gif');
echo '</h2>';
echo '<h2 style="display: none;" id="title_downloaded_update_pandora">' . __('Downloaded <span class="package_name">package</span>') . '</h2>';
echo '<h2 style="display: none;" id="title_installing_update_pandora">' . __('Installing <span class="package_name">package</span> in progress') . " ";
echo '</h4>';
echo '<h4 style="display: none;" id="title_downloaded_update_pandora">' . __('Downloaded <span class="package_name">package</span>') . '</h2>';
echo '<h4 style="display: none;" id="title_installing_update_pandora">' . __('Installing <span class="package_name">package</span> in progress') . " ";
html_print_image('images/spinner.gif');
echo '</h2>';
echo '<h2 style="display: none;" id="title_installed_update_pandora">' . __('Installed <span class="package_name">package</span> in progress') . '</h2>';
echo '<h2 style="display: none;" id="title_error_update_pandora">' . __('Fail download <span class="package_name">package</span>') . '</h2>';
echo '</h4>';
echo '<h4 style="display: none;" id="title_installed_update_pandora">' . __('Installed <span class="package_name">package</span> in progress') . '</h2>';
echo '<h4 style="display: none;" id="title_error_update_pandora">' . __('Fail download <span class="package_name">package</span>') . '</h2>';
echo '<br /><br />';
echo "<div id='progress_bar_img'>";
echo progress_bar(0, 300, 20, 0 . '%', 1, false, "#00ff00");
@ -139,6 +138,11 @@ function update_pandora_administration($settings, $user_key) {
</div>";
?>
<div id="button_close_download_disabled" style="position: absolute; top:280px; right:43%;">
<?php
html_print_submit_button(__("Close"), 'hide_download_disabled_dialog', true, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only" style="width:100px;"');
?>
</div>
<div id="button_close_download" style="display: none; position: absolute; top:280px; right:43%;">
<?php
html_print_submit_button(__("Close"), 'hide_download_dialog', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only" style="width:100px;"');
@ -147,11 +151,11 @@ function update_pandora_administration($settings, $user_key) {
</div>
</div>
<?php
echo '<h4>' . __('Downloaded Packages') . '</h4>';
$tableMain = null;
$tableMain->width = '98%';
$tableMain->width = '95%';
$tableMain->data = array();
$tableMain->data[0][0] = '<h4>' . __('Downloaded Packages') . '</h4>';
$list_downloaded_packages = update_pandora_get_list_downloaded_packages('administration');
$table = null;

View File

@ -23,7 +23,7 @@ global $config;
check_login ();
/* Call all extensions login function */
extensions_call_login_function ();
//extensions_call_login_function ();
require_once ("include/functions_reporting.php");
require_once ($config["homedir"] . '/include/functions_graph.php');

View File

@ -586,7 +586,7 @@ function config_process_config () {
}
if (!isset ($config['autoupdate'])) {
config_update_value ( 'autoupdate', 0);
config_update_value ( 'autoupdate', 1);
}
if (!isset ($config['api_password'])) {

View File

@ -126,6 +126,8 @@ $page = $sec2; //Reference variable for old time sake
$sec = get_parameter_get ('sec');
$sec = safe_url_extraclean ($sec);
$process_login = false;
$searchPage = false;
$search = get_parameter_get("head_search_keywords");
if (strlen($search) > 0) {
@ -161,14 +163,16 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
$pass = get_parameter_post ("pass"); //This is the variable with the password
$nick = db_escape_string_sql($nick);
$pass = db_escape_string_sql($pass);
// process_user_login is a virtual function which should be defined in each auth file.
// It accepts username and password. The rest should be internal to the auth file.
// The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it
// process_user_login should return false in case of errors or invalid login, the nickname if correct
$nick_in_db = process_user_login ($nick, $pass);
if ($nick_in_db !== false) {
$process_login = true;
unset ($_GET["sec2"]);
$_GET["sec"] = "general/logon_ok";
$home_page ='';
@ -222,9 +226,9 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
$config['id_user'] = $nick_in_db;
//Remove everything that might have to do with people's passwords or logins
unset ($_GET['pass'], $pass, $_POST['pass'], $_REQUEST['pass'], $login_good);
$user_language = get_user_language ($config['id_user']);
$l10n = NULL;
if (file_exists ('./include/languages/'.$user_language.'.mo')) {
$l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$user_language.'.mo'));
@ -265,11 +269,15 @@ if (isset ($_GET["bye"])) {
* Load here, because if not, some extensions not load well, I don't why.
*/
extensions_load_extensions ($config['extensions']);
if ($process_login) {
/* Call all extensions login function */
extensions_call_login_function ();
}
// Header
if ($config["pure"] == 0) {
echo '<div id="container"><div id="head">';
require ("general/header.php");
require ("general/header.php");
echo '</div><div id="page"><div id="menu">';
require ("general/main_menu.php");
echo '</div>';
@ -282,11 +290,14 @@ else {
// Session locking concurrency speedup!
session_write_close ();
// Main block of content
if ($config["pure"] == 0) {
echo '<div id="main">';
}
// Page loader / selector
if ($searchPage) {
require ('operation/search_results.php');