From 611a76cde512c90f01cc2041ee65ff2ba52d94f8 Mon Sep 17 00:00:00 2001 From: ramonn Date: Mon, 11 Feb 2013 17:04:25 +0000 Subject: [PATCH] 2013-02-11 Ramon Novoa * extensions/update_manager/load_updatemanager.php: Removed the keygen from update manager since it was not working well. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7622 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++ .../update_manager/load_updatemanager.php | 85 +++---------------- 2 files changed, 17 insertions(+), 73 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c233408908..71978d9401 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-02-11 Ramon Novoa + + * extensions/update_manager/load_updatemanager.php: Removed the keygen + from update manager since it was not working well. + 2013-02-11 Sergio Martin * include/functions_network_components.php diff --git a/pandora_console/extensions/update_manager/load_updatemanager.php b/pandora_console/extensions/update_manager/load_updatemanager.php index b4274a49b7..bcd5c3f75d 100644 --- a/pandora_console/extensions/update_manager/load_updatemanager.php +++ b/pandora_console/extensions/update_manager/load_updatemanager.php @@ -29,98 +29,37 @@ require_once ('lib/libupdate_manager.php'); function check_keygen ($settings) { global $config; - if ($settings->customer_key != FREE_USER) { - if (! file_exists ($settings->keygen_path)) { - return ui_print_error_message( array('title' => __("Keygen error"), - 'message' => __('Pandora Console updates need a valid keygen file. Keygen file does not exists'), - 'no_close' => true, 'force_style' => 'color: #000000 !important'), '', true); - } - if (! is_executable ($settings->keygen_path)) { - return ui_print_error_message( array('title' => __("Keygen error"), - 'message' => __('Pandora Console updates need a valid keygen file. Keygen file is not executable'), - 'no_close' => true, 'force_style' => 'color: #000000 !important'), '', true); - - } - } - return ''; } function get_user_key ($settings) { global $config; - - require_once($config["homedir"] . - "/extensions/update_manager/debug.php"); - - print_debug_message_trace("Init Call get_user_key function."); - - if ($settings->customer_key != FREE_USER) { - print_debug_message_trace("Enter in ENTERPRISE ."); - - if (! file_exists ($settings->keygen_path)) { - /*echo '

'; - echo __('Keygen file does not exists'); - echo '

';*/ - - return array('result' => false, - 'message' => __('The Keygen is not in the path.')); - } - if (! is_executable ($settings->keygen_path)) { - /*echo '

'; - echo __('Keygen file is not executable'); - echo '

';*/ - - return array('result' => false, - 'message' => __('Cannot execute the Keygen.')); - } - - $command_line = escapeshellcmd($settings->keygen_path. - ' '.$settings->customer_key.' '.$config['dbhost']. - ' '.$config['dbuser'].' '.$config['dbpass']. - ' '.$config['dbname'].' '.$config['dbtype']); - - print_debug_message_trace("command_line >>> " . $command_line); - //html_debug_print($command_line, true); - - $user_key = exec ($command_line, $output, $return_exec); - - if ($return_exec != 0) { - //Maybe there is a error in the execution. - return array('result' => false, - 'message' => __('Error in execution the keygen.')); - } - - print_debug_message_trace("user_key >>> " . $user_key); - //html_debug_print($user_key, true); - - return $user_key; - } - - /* Free users. - We only want to know this for statistics records. - Feel free to disable this extension if you want. - */ global $build_version; global $pandora_version; + require_once($config["homedir"] . "/extensions/update_manager/debug.php"); + + print_debug_message_trace("Init Call get_user_key function."); + + $s = $settings->customer_key; switch ($config['dbtype']) { case 'mysql': $n = (int) db_get_value ('COUNT(`id_agente`)', 'tagente', 'disabled', 0); - $m = (int) db_get_value ('COUNT(`id_agente_modulo`)', 'tagente_modulo', - 'disabled', 0); + $m = (int) db_get_value ('COUNT(`id_agente_modulo`)', 'tagente_modulo', 'disabled', 0); + $u = (int) db_get_value ('MAX(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(keepalive))', 'tserver'); break; case 'postgresql': $n = (int) db_get_value ('COUNT("id_agente")', 'tagente', 'disabled', 0); - $m = (int) db_get_value ('COUNT("id_agente_modulo")', 'tagente_modulo', - 'disabled', 0); + $m = (int) db_get_value ('COUNT("id_agente_modulo")', 'tagente_modulo', 'disabled', 0); + $u = (int) db_get_value ('MAX(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(keepalive))', 'tserver'); break; case 'oracle': $n = (int) db_get_value ('COUNT(id_agente)', 'tagente', 'disabled', 0); - $m = (int) db_get_value ('COUNT(id_agente_modulo)', 'tagente_modulo', - 'disabled', 0); + $m = (int) db_get_value ('COUNT(id_agente_modulo)', 'tagente_modulo', 'disabled', 0); + $u = (int) db_get_value ('MAX(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(keepalive))', 'tserver'); break; } - $user_key = array ('A' => $n, 'M' => $m, 'B' => $build_version, 'P' => $pandora_version); + $user_key = array ('S' => $s, 'A' => $n, 'U' => $u, 'M' => $m, 'B' => $build_version, 'P' => $pandora_version); return json_encode ($user_key); }