2012-06-22 Miguel de Dios <miguel.dedios@artica.es>
* extensions/update_manager/load_updatemanager.php, extensions/update_manager/lib/functions.ajax.php, extensions/update_manager/lib/libupdate_manager_client.php, extensions/update_manager/main.php, extensions/update_manager/debug.php: added the feature to get traces of execution. Only change the flag for debug in debug.php . Merged from 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6677 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
1719bce1d6
commit
0e205b15a4
|
@ -1,3 +1,14 @@
|
|||
2012-06-22 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* extensions/update_manager/load_updatemanager.php,
|
||||
extensions/update_manager/lib/functions.ajax.php,
|
||||
extensions/update_manager/lib/libupdate_manager_client.php,
|
||||
extensions/update_manager/main.php,
|
||||
extensions/update_manager/debug.php: added the feature to get traces
|
||||
of execution. Only change the flag for debug in debug.php .
|
||||
|
||||
Merged from 4.0.2
|
||||
|
||||
2012-06-22 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* operation/users/user_edit.php
|
||||
|
|
|
@ -19,6 +19,8 @@ function check_keygen_online() {
|
|||
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/lib/functions.php");
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/debug.php");
|
||||
|
||||
global $conf_update_pandora;
|
||||
if (empty($conf_update_pandora))
|
||||
|
@ -35,6 +37,9 @@ function check_keygen_online() {
|
|||
|
||||
db_clean_cache();
|
||||
$settings = um_db_load_settings ();
|
||||
|
||||
print_debug_message_trace("End Call check_keygen_online function.");
|
||||
|
||||
return check_keygen ($settings);
|
||||
}
|
||||
|
||||
|
@ -55,6 +60,11 @@ function update_pandora_get_packages_online_ajax($ajax = true) {
|
|||
require_once ($config["homedir"] .
|
||||
"/extensions/update_manager/load_updatemanager.php");
|
||||
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/debug.php");
|
||||
|
||||
print_debug_message_trace("Init Call update_pandora_get_packages_online_ajax function.");
|
||||
|
||||
$last = get_parameter('last', 0);
|
||||
|
||||
db_clean_cache();
|
||||
|
@ -105,6 +115,8 @@ function update_pandora_get_packages_online_ajax($ajax = true) {
|
|||
$return['end'] = 1;
|
||||
}
|
||||
|
||||
print_debug_message_trace("End Call update_pandora_get_packages_online_ajax function.");
|
||||
|
||||
if ($ajax)
|
||||
echo json_encode($return);
|
||||
else
|
||||
|
@ -124,6 +136,11 @@ function update_pandora_download_package() {
|
|||
require_once ($config["homedir"] .
|
||||
"/extensions/update_manager/load_updatemanager.php");
|
||||
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/debug.php");
|
||||
|
||||
print_debug_message_trace("Init Call update_pandora_download_package function.");
|
||||
|
||||
$dir = $config['attachment_store'] . '/update_pandora/';
|
||||
|
||||
$package = get_parameter('package', '');
|
||||
|
@ -229,6 +246,8 @@ function update_pandora_download_package() {
|
|||
$return['mode'] = $conf_update_pandora['download_mode'];
|
||||
$return['filename'] = $package;
|
||||
|
||||
print_debug_message_trace("End Call update_pandora_download_package function.");
|
||||
|
||||
echo json_encode($return);
|
||||
}
|
||||
|
||||
|
@ -241,6 +260,11 @@ function update_pandora_check_download_package() {
|
|||
|
||||
require_once ($config["homedir"] . '/include/functions_graph.php');
|
||||
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/debug.php");
|
||||
|
||||
print_debug_message_trace("Init Call update_pandora_check_download_package function.");
|
||||
|
||||
sleep(1);
|
||||
|
||||
if ($conf_update_pandora['download_mode'] == 'wget') {
|
||||
|
@ -304,6 +328,8 @@ function update_pandora_check_download_package() {
|
|||
}
|
||||
}
|
||||
|
||||
print_debug_message_trace("End Call update_pandora_check_download_package function.");
|
||||
|
||||
echo json_encode($return);
|
||||
}
|
||||
|
||||
|
@ -313,6 +339,11 @@ function update_pandora_install_package() {
|
|||
if (empty($conf_update_pandora))
|
||||
$conf_update_pandora = update_pandora_get_conf();
|
||||
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/debug.php");
|
||||
|
||||
print_debug_message_trace("Init Call update_pandora_install_package function.");
|
||||
|
||||
$dir = $config['attachment_store'] . '/update_pandora/';
|
||||
|
||||
$package = get_parameter('package', '');
|
||||
|
@ -326,11 +357,14 @@ function update_pandora_install_package() {
|
|||
$command = 'tar tzvf ' . $dir . $filename .
|
||||
' --exclude="pandora_console/install.php" --exclude="pandora_console/include/config.php" | grep -v "pandora_console/$" | wc -l > /tmp/' . $package . '.info.txt';
|
||||
exec($command, $output, $status);
|
||||
print_debug_message_trace($command);
|
||||
//html_debug_print($command, true);
|
||||
|
||||
$command = 'tar xzvf ' . $dir . $filename .
|
||||
' --exclude="pandora_console/install.php" --exclude="pandora_console/include/config.php" ' .
|
||||
' --strip-components=1 -C ' . $config['homedir'] . ' 1>/tmp/' . $package . '.files.info.txt';
|
||||
|
||||
print_debug_message_trace($command);
|
||||
//html_debug_print($command, true);
|
||||
|
||||
//Maybe this line run for seconds or minutes
|
||||
|
@ -344,6 +378,8 @@ function update_pandora_install_package() {
|
|||
else {
|
||||
echo json_encode(array('correct' => 0));
|
||||
}
|
||||
|
||||
print_debug_message_trace("End Call update_pandora_install_package function.");
|
||||
}
|
||||
|
||||
function update_pandora_check_install_package() {
|
||||
|
@ -351,6 +387,11 @@ function update_pandora_check_install_package() {
|
|||
|
||||
require_once ($config["homedir"] . '/include/functions_graph.php');
|
||||
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/debug.php");
|
||||
|
||||
print_debug_message_trace("Init Call update_pandora_check_install_package function.");
|
||||
|
||||
sleep(1);
|
||||
|
||||
$package = get_parameter('package', '');
|
||||
|
@ -392,6 +433,8 @@ function update_pandora_check_install_package() {
|
|||
unlink('/tmp/' . $package . '.info.txt');
|
||||
}
|
||||
|
||||
print_debug_message_trace("End Call update_pandora_check_install_package function.");
|
||||
|
||||
echo json_encode($return);
|
||||
}
|
||||
|
||||
|
@ -404,6 +447,11 @@ function checking_online_enterprise_package() {
|
|||
"/extensions/update_manager/lib/libupdate_manager.php");
|
||||
require_once ($config["homedir"] .
|
||||
"/extensions/update_manager/load_updatemanager.php");
|
||||
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/debug.php");
|
||||
|
||||
print_debug_message_trace("Init Call checking_online_enterprise_package function.");
|
||||
|
||||
$return = array('correct' => 1, 'text' => '',
|
||||
'enable_buttons' => false, 'details_text' => '',
|
||||
|
@ -459,6 +507,8 @@ function checking_online_enterprise_package() {
|
|||
}
|
||||
}
|
||||
|
||||
print_debug_message_trace("End Call checking_online_enterprise_package function.");
|
||||
|
||||
echo json_encode($return);
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -634,6 +634,13 @@ function um_client_upgrade_to_package ($package, $settings, $force = true, $upda
|
|||
}
|
||||
|
||||
function um_client_upgrade_to_latest ($user_key, $force = true) {
|
||||
global $config;
|
||||
|
||||
require_once($config["homedir"] .
|
||||
"/extensions/update_manager/debug.php");
|
||||
|
||||
print_debug_message_trace("Init Call um_client_upgrade_to_latest function.");
|
||||
|
||||
$success = false;
|
||||
|
||||
$settings = um_db_load_settings ();
|
||||
|
@ -641,8 +648,13 @@ function um_client_upgrade_to_latest ($user_key, $force = true) {
|
|||
do {
|
||||
$package = um_client_get_package ($settings, $user_key);
|
||||
|
||||
|
||||
if ($package === false || $package === true ||
|
||||
$package === 0 || $package === 1) {
|
||||
|
||||
print_debug_message_trace("Package download not is a object, it is " .
|
||||
(int)$package . ".");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -651,6 +663,9 @@ function um_client_upgrade_to_latest ($user_key, $force = true) {
|
|||
if (! $success)
|
||||
break;
|
||||
|
||||
print_debug_message_trace("Success update package " .
|
||||
(int)$package->id . ".");
|
||||
|
||||
$settings->current_update = $package->id;
|
||||
}
|
||||
while (1);
|
||||
|
@ -658,6 +673,8 @@ function um_client_upgrade_to_latest ($user_key, $force = true) {
|
|||
/* Break on error, when there are no more packages on the server (server return true)
|
||||
or on auth failure (server return false) */
|
||||
|
||||
print_debug_message_trace("End Call um_client_upgrade_to_latest function.");
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,14 @@ function check_keygen ($settings) {
|
|||
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 '<h3 class="error">';
|
||||
echo __('Keygen file does not exists');
|
||||
|
@ -65,23 +72,19 @@ function get_user_key ($settings) {
|
|||
return '';
|
||||
}
|
||||
|
||||
global $config;
|
||||
|
||||
|
||||
/* html_debug_print ("DEBUG: Trying to execute escapeshellcmd ($settings->keygen_path".
|
||||
' '.$settings->customer_key.' '.$config['dbhost'].
|
||||
' '.$config['dbuser'].' '.$config['dbpass'].
|
||||
' '.$config['dbname'], true); */
|
||||
|
||||
$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);
|
||||
|
||||
print_debug_message_trace("user_key >>> " . $user_key);
|
||||
//html_debug_print($user_key, true);
|
||||
|
||||
return $user_key;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,9 +56,14 @@ function main_view() {
|
|||
function main_view_enterprise($settings, $user_key) {
|
||||
global $config;
|
||||
|
||||
require_once("debug.php");
|
||||
|
||||
print_debug_message_trace("Init Call main_view_enterprise function.");
|
||||
|
||||
$update_package = (bool) get_parameter_post ('update_package');
|
||||
|
||||
if ($update_package) {
|
||||
print_debug_message_trace("Enter in update package.");
|
||||
if (enterprise_installed()) {
|
||||
$force = (bool) get_parameter_post ('force_update');
|
||||
|
||||
|
@ -218,6 +223,8 @@ function main_view_enterprise($settings, $user_key) {
|
|||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
print_debug_message_trace("End Call main_view_enterprise function.");
|
||||
}
|
||||
|
||||
function main_view_open($settings, $user_key) {
|
||||
|
|
Loading…
Reference in New Issue