2012-05-11 Miguel de Dios <miguel.dedios@artica.es>

* extensions/update_manager/lib/functions.php: fixed into the
	function "update_pandora_installation" lost var,  and into the
	function "update_pandora_get_list_downloaded_packages" check fail
	dir.
	
	* extensions/update_manager/update_pandora.php: fixed foreach a non
	array in list download packages when fail.
	
	MERGED FROM 4.0.2




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6293 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-05-11 11:39:50 +00:00
parent e27f160c90
commit 2be7256a85
3 changed files with 34 additions and 14 deletions

View File

@ -1,3 +1,15 @@
2012-05-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/update_manager/lib/functions.php: fixed into the
function "update_pandora_installation" lost var, and into the
function "update_pandora_get_list_downloaded_packages" check fail
dir.
* extensions/update_manager/update_pandora.php: fixed foreach a non
array in list download packages when fail.
MERGED FROM 4.0.2
2012-05-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* general/login_help_dialog.php: Removed variable due to

View File

@ -79,8 +79,9 @@ function update_pandora_installation() {
}
$dir = $config['attachment_store'] . '/update_pandora/';
if (!is_dir($dir)) {
$result = mkdir($dir);
$return = mkdir($dir);
if (!$return) {
$return_var['return'] = false;
@ -113,13 +114,17 @@ function update_pandora_get_list_downloaded_packages($mode = 'operation') {
global $conf_update_pandora;
$dir = dir($conf_update_pandora['dir']);
if ($dir === false) {
ui_print_error_message(sprintf(
__('Error reading the dir of packages in "%s".'), $conf_update_pandora['dir']));
return;
}
$packages = array();
while (false !== ($entry = $dir->read())) {
if (is_file($conf_update_pandora['dir'] . $entry)
&& is_readable($conf_update_pandora['dir'] . $entry)) {
if (strstr($entry, '.tar.gz') !== false) {
if ($mode == 'operation') {
$packages[] = $entry;
}

View File

@ -78,20 +78,21 @@ function update_pandora_administration($settings, $user_key) {
}
$conf_update_pandora = update_pandora_get_conf();
if (!empty($conf_update_pandora['last_installed'])){
echo '<h4>';
echo __('Your Pandora FMS open source package installed is') .
' ' . $conf_update_pandora['last_installed'];
' ' . $conf_update_pandora['last_installed'];
echo "</h4>";
} else {
}
else {
echo '<h4>';
echo __('Your Pandora FMS does not have any update installed yet');
echo __('Your Pandora FMS does not have any update installed yet');
echo "</h4>";
}
echo "<br><br>";
}
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.') .
@ -99,10 +100,10 @@ function update_pandora_administration($settings, $user_key) {
'<p>' .
__('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>'
);
echo "<h4>". __('Online') . '</h4>';
);
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="">
@ -158,6 +159,8 @@ function update_pandora_administration($settings, $user_key) {
$tableMain->data = array();
$list_downloaded_packages = update_pandora_get_list_downloaded_packages('administration');
if (empty($list_downloaded_packages))
$list_downloaded_packages = array();
$table = null;
$table->width = '100%';
$table->size = array('50%', '25%', '25%');