2014-06-10 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_config.php,
	include/functions_update_manager.php, index.php,
	general/logon_ok.php, extensions/update_manager.php,
	godmode/update_manager_xxx/update_manager.online.php: work in the
	first version of new update manager.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10154 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-06-10 14:34:27 +00:00
parent 1666cd187f
commit 61144da653
7 changed files with 83 additions and 11 deletions

View File

@ -1,3 +1,11 @@
2014-06-10 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php,
include/functions_update_manager.php, index.php,
general/logon_ok.php, extensions/update_manager.php,
godmode/update_manager_xxx/update_manager.online.php: work in the
first version of new update manager.
2014-06-10 Miguel de Dios <miguel.dedios@artica.es>
* godmode/update_manager_xxx/update_manager.online.php,

View File

@ -239,7 +239,7 @@ extensions_add_operation_menu_option (__('Update manager'), null, null, "v1r1");
extensions_add_godmode_menu_option (__('Update manager settings'), 'PM', null, null, "v1r1");
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_login_function ('pandora_update_manager_login');
pandora_update_manager_install ();

View File

@ -30,12 +30,14 @@ require_once ($config["homedir"] . '/include/functions_graph.php');
ui_print_page_header (__('Welcome to Pandora FMS Web Console'));
if(tags_has_user_acl_tags()) {
if (tags_has_user_acl_tags()) {
ui_print_tags_warning();
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------
// Site news !
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------
echo '<div style="width:50%; float:left;" id="leftcolumn">';
//////////////////NEWS BOARD/////////////////////////////

View File

@ -20,6 +20,13 @@ ui_require_css_file('update_manager', 'godmode/update_manager_xxx/');
require_once("include/functions_update_manager.php");
enterprise_include_once("include/functions_update_manager.php");
$current_package = 0;
if (isset($config['current_package']))
$current_package = $config['current_package'];
echo "<p><b>" . sprintf(__("The last version of package installed is: %d"),
$current_package) . "</b></p>";
/* Translators: Do not translade Update Manager, it's the name of the program */
ui_print_info_message(
'<p>' .

View File

@ -1181,7 +1181,8 @@ function config_check () {
// Check default password for "admin"
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
if ($is_admin) {
$hashpass = db_get_sql ("SELECT password FROM tusuario WHERE id_user = 'admin'");
$hashpass = db_get_sql ("SELECT password
FROM tusuario WHERE id_user = 'admin'");
if ($hashpass == "1da7ee7d45b96d0e1f45ee4ee23da560"){
$config["alert_cnt"]++;
$_SESSION["alert_msg"] .= ui_print_error_message(
@ -1303,7 +1304,7 @@ function config_check () {
$config["alert_cnt"]++;
$_SESSION["alert_msg"] .= ui_print_info_message(
array('title' => __("New update of Pandora Console"),
'message' => __('There is a new update please go to menu operation and into extensions <a style="font-weight:bold;" href="index.php?sec=extensions&sec2=extensions/update_manager">go to Update Manager</a> for more details.'),
'message' => __('There is a new update please go to menu Administration and into extensions <a style="font-weight:bold;" href="index.php?sec=gsetup&sec2=godmode/update_manager_xxx/update_manager_xxx&tab=online">go to Update Manager</a> for more details.'),
'no_close' => true, 'force_style' => 'color: #000000 !important'), '', true);
}
}

View File

@ -40,7 +40,7 @@ function update_manager_get_config_values() {
//~ $limit_count = 2;
$build_version = "140514";
$pandora_version = "4.1";
$license = "INTEGRIA-FREE";
//$license = "INTEGRIA-FREE";
return array(
@ -213,6 +213,47 @@ function update_manager_main() {
<?php
}
function update_manager_check_online_free_packages_available() {
global $config;
$update_message = '';
$um_config_values = update_manager_get_config_values();
$params = array('action' => 'newest_package',
'license' => $um_config_values['license'],
'limit_count' => $um_config_values['limit_count'],
'current_package' => $um_config_values['current_update'],
'version' => $um_config_values['version'],
'build' => $um_config_values['build']);
$curlObj = curl_init();
curl_setopt($curlObj, CURLOPT_URL, $config['url_update_manager']);
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlObj, CURLOPT_POST, true);
curl_setopt($curlObj, CURLOPT_POSTFIELDS, $params);
curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($curlObj);
$http_status = curl_getinfo($curlObj, CURLINFO_HTTP_CODE);
curl_close($curlObj);
if ($http_status >= 400 && $http_status < 500) {
return false;
}
elseif ($http_status >= 500) {
return false;
}
else {
if ($is_ajax) {
return true;
}
else {
return false;
}
}
}
function update_manager_check_online_free_packages ($is_ajax=true) {
global $config;

View File

@ -206,7 +206,7 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
|| $config['enable_pass_policy_admin']))
&& (defined('PANDORA_ENTERPRISE'))
&& ($config['enable_pass_policy'])) {
include_once(ENTERPRISE_DIR."/include/auth/mysql.php");
include_once(ENTERPRISE_DIR . "/include/auth/mysql.php");
$blocked = login_check_blocked($nick);
@ -233,7 +233,8 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
//login ok and password has expired
require_once ('general/login_page.php');
db_pandora_audit("Password expired", "Password expired: ".$nick, $nick);
db_pandora_audit("Password expired",
"Password expired: " . $nick, $nick);
while (@ob_end_flush ());
exit ("</html>");
}
@ -297,10 +298,10 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
//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']);
$user_language = get_user_language($config['id_user']);
$l10n = NULL;
if (file_exists ('./include/languages/'.$user_language.'.mo')) {
if (file_exists ('./include/languages/' . $user_language . '.mo')) {
$l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$user_language.'.mo'));
$l10n->load_tables();
}
@ -359,7 +360,19 @@ if ($process_login) {
/* Call all extensions login function */
extensions_call_login_function ();
unset($_SESSION['new_update']);
require_once("include/functions_update_manager.php");
enterprise_include_once("include/functions_update_manager.php");
if (enterprise_installed()) {
$result = update_manager_check_online_enterprise_packages_available();
}
else {
$result = update_manager_check_online_free_packages_available();
}
if ($result)
$_SESSION['new_update'] = 'new';
//Set the initial global counter for chat.
users_get_last_global_counter('session');