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

* include/functions_config.php, extensions/update_manager.php,
	extensions/update_manager/lib/functions.php: fixed the first
	intallation of update manager.
	
	Merged from the branch "pandora_4.0".




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6030 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-04-18 18:39:58 +00:00
parent 9195bc889b
commit 4bd469036b
4 changed files with 46 additions and 21 deletions

View File

@ -1,3 +1,11 @@
2012-04-18 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, extensions/update_manager.php,
extensions/update_manager/lib/functions.php: fixed the first
intallation of update manager.
Merged from the branch "pandora_4.0".
2012-04-18 Sancho Lerena <slerena@artica.es>
* operation/servers/recon_view.php: Fix column header.
@ -41,7 +49,7 @@
operation/agentes/networkmap.php, include/functions_ui.php: cleaned
source code style.
Merged from th branch "pandora_4.0".
Merged from the branch "pandora_4.0".
2012-04-18 Dario Rodriguez <dario.rodriguez@artica.es>

View File

@ -191,18 +191,26 @@ function pandora_update_manager_login () {
$package = um_client_check_latest_update ($settings, $user_key);
if (is_object ($package)) {
if ($package->id != 'ERROR_NON_NUMERIC_FOUND')
if ($package->id != 'ERROR_NON_NUMERIC_FOUND') {
$_SESSION['new_update'] = 'new';
}
}
}
else {
require_once(
"extensions/update_manager/lib/functions.ajax.php");
require_once("extensions/update_manager/lib/functions.php");
$return_installation_open = array();
if (!update_pandora_check_installation()) {
$return_installation_open = update_pandora_installation();
}
$result = update_pandora_get_packages_online_ajax(false);
if ($result['correct']) {
$_SESSION['new_update'] = 'new';
$_SESSION['return_installation_open'] = $return_installation_open;
}
}
}
@ -215,15 +223,11 @@ function pandora_update_manager_godmode () {
require_once ('update_manager/settings.php');
}
if(isset($config['id_user'])) {
if (check_acl($config['id_user'], 0, "PM")) {
extensions_add_operation_menu_option (__('Update manager'));
extensions_add_godmode_menu_option (__('Update manager settings'), 'PM');
extensions_add_main_function ('pandora_update_manager_main');
extensions_add_godmode_function ('pandora_update_manager_godmode');
extensions_add_login_function ('pandora_update_manager_login');
}
}
extensions_add_operation_menu_option (__('Update manager'));
extensions_add_godmode_menu_option (__('Update manager settings'), 'PM');
extensions_add_main_function ('pandora_update_manager_main');
extensions_add_godmode_function ('pandora_update_manager_godmode');
extensions_add_login_function ('pandora_update_manager_login');
pandora_update_manager_install ();

View File

@ -48,6 +48,8 @@ function update_pandora_get_conf() {
function update_pandora_installation() {
global $config;
$return_var = array('return' => true, 'text' => null);
$row = db_get_row_filter('tconfig', array('token' => 'update_pandora_conf_url'));
if (empty($row)) {
@ -70,23 +72,23 @@ function update_pandora_installation() {
'value' => $conf_update_pandora['download_mode']);
$return = db_process_sql_insert('tconfig', $values);
ui_print_result_message($return, __('Succesful store conf data in DB.'),
__('Unsuccesful store conf data in DB.'));
}
else {
ui_print_message(__('Conf data have been in the DB.'));
if (!$return) {
$return_var['return'] = false;
$return_var['text'][] = __('Unsuccesful store conf data in DB.');
}
}
$dir = $config['attachment_store'] . '/update_pandora/';
if (!is_dir($dir)) {
$result = mkdir($dir);
ui_print_result_message($result, __('Succesful create a dir to save package in Pandora Console'),
__('Unsuccesful create a dir to save package in Pandora Console'));
}
else {
ui_print_message(__('The directory for save package have been in Pandora Console.'));
if (!$return) {
$return_var['return'] = false;
$return_var['text'][] = __('Unsuccesful create a dir to save package in Pandora Console');
}
}
return $return_var;
}
function update_pandora_update_conf() {

View File

@ -734,6 +734,17 @@ function config_check (){
//pandora_update_manager_login();
if (isset($_SESSION['new_update'])) {
if (!empty($_SESSION['return_installation_open'])) {
if (!$_SESSION['return_installation_open']['return']) {
foreach ($_SESSION['return_installation_open']['text'] as $message) {
$config["alert_cnt"]++;
$_SESSION["alert_msg"] .= ui_print_error_message(
array('title' => __("Error first setup Open update"),
'message' => $message,
'no_close' => true, 'force_style' => 'color: #000000 !important'), '', true);
}
}
}
if ($_SESSION['new_update'] == 'new') {
$config["alert_cnt"]++;
$_SESSION["alert_msg"] .= ui_print_info_message(