2013-02-11 Ramon Novoa <rnovoa@artica.es>
* 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
This commit is contained in:
parent
96e7eaee45
commit
3a8967f920
pandora_console
|
@ -1,3 +1,8 @@
|
||||||
|
2013-02-11 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* extensions/update_manager/load_updatemanager.php: Removed the keygen
|
||||||
|
from update manager since it was not working well.
|
||||||
|
|
||||||
2013-02-11 Sergio Martin <sergio.martin@artica.es>
|
2013-02-11 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_network_components.php
|
* include/functions_network_components.php
|
||||||
|
|
|
@ -29,98 +29,37 @@ require_once ('lib/libupdate_manager.php');
|
||||||
function check_keygen ($settings) {
|
function check_keygen ($settings) {
|
||||||
global $config;
|
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 '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_user_key ($settings) {
|
function get_user_key ($settings) {
|
||||||
global $config;
|
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 '<h3 class="error">';
|
|
||||||
echo __('Keygen file does not exists');
|
|
||||||
echo '</h3>';*/
|
|
||||||
|
|
||||||
return array('result' => false,
|
|
||||||
'message' => __('The Keygen is not in the path.'));
|
|
||||||
}
|
|
||||||
if (! is_executable ($settings->keygen_path)) {
|
|
||||||
/*echo '<h3 class="error">';
|
|
||||||
echo __('Keygen file is not executable');
|
|
||||||
echo '</h3>';*/
|
|
||||||
|
|
||||||
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 $build_version;
|
||||||
global $pandora_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']) {
|
switch ($config['dbtype']) {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
$n = (int) db_get_value ('COUNT(`id_agente`)', 'tagente', 'disabled', 0);
|
$n = (int) db_get_value ('COUNT(`id_agente`)', 'tagente', 'disabled', 0);
|
||||||
$m = (int) db_get_value ('COUNT(`id_agente_modulo`)', 'tagente_modulo',
|
$m = (int) db_get_value ('COUNT(`id_agente_modulo`)', 'tagente_modulo', 'disabled', 0);
|
||||||
'disabled', 0);
|
$u = (int) db_get_value ('MAX(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(keepalive))', 'tserver');
|
||||||
break;
|
break;
|
||||||
case 'postgresql':
|
case 'postgresql':
|
||||||
$n = (int) db_get_value ('COUNT("id_agente")', 'tagente', 'disabled', 0);
|
$n = (int) db_get_value ('COUNT("id_agente")', 'tagente', 'disabled', 0);
|
||||||
$m = (int) db_get_value ('COUNT("id_agente_modulo")', 'tagente_modulo',
|
$m = (int) db_get_value ('COUNT("id_agente_modulo")', 'tagente_modulo', 'disabled', 0);
|
||||||
'disabled', 0);
|
$u = (int) db_get_value ('MAX(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(keepalive))', 'tserver');
|
||||||
break;
|
break;
|
||||||
case 'oracle':
|
case 'oracle':
|
||||||
$n = (int) db_get_value ('COUNT(id_agente)', 'tagente', 'disabled', 0);
|
$n = (int) db_get_value ('COUNT(id_agente)', 'tagente', 'disabled', 0);
|
||||||
$m = (int) db_get_value ('COUNT(id_agente_modulo)', 'tagente_modulo',
|
$m = (int) db_get_value ('COUNT(id_agente_modulo)', 'tagente_modulo', 'disabled', 0);
|
||||||
'disabled', 0);
|
$u = (int) db_get_value ('MAX(UNIX_TIMESTAMP()-UNIX_TIMESTAMP(keepalive))', 'tserver');
|
||||||
break;
|
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);
|
return json_encode ($user_key);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue