mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
2014-08-14 Miguel de Dios <miguel.dedios@artica.es>
* godmode/update_manager/update_manager.online.php, include/functions_update_manager.php, include/ajax/update_manager.ajax.php: fixed the update manager when some tar formats, and fixed the versions copy&paste error in the code. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10428 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
dd7e5db2ec
commit
21f74c8a25
@ -1,3 +1,11 @@
|
|||||||
|
2014-08-14 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* godmode/update_manager/update_manager.online.php,
|
||||||
|
include/functions_update_manager.php,
|
||||||
|
include/ajax/update_manager.ajax.php: fixed the update manager when
|
||||||
|
some tar formats, and fixed the versions copy&paste error in the
|
||||||
|
code.
|
||||||
|
|
||||||
2014-08-14 Miguel de Dios <miguel.dedios@artica.es>
|
2014-08-14 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* include/help/clippy/agent_out_of_limits.php,
|
* include/help/clippy/agent_out_of_limits.php,
|
||||||
|
@ -20,16 +20,7 @@ ui_require_css_file('update_manager', 'godmode/update_manager/');
|
|||||||
require_once("include/functions_update_manager.php");
|
require_once("include/functions_update_manager.php");
|
||||||
enterprise_include_once("include/functions_update_manager.php");
|
enterprise_include_once("include/functions_update_manager.php");
|
||||||
|
|
||||||
if (enterprise_installed()) {
|
$current_package = update_manager_get_current_package();
|
||||||
$current_package = 0;
|
|
||||||
if (isset($config['current_package_enterprise']))
|
|
||||||
$current_package = $config['current_package_enterprise'];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$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"),
|
echo "<p><b>" . sprintf(__("The last version of package installed is: %d"),
|
||||||
$current_package) . "</b></p>";
|
$current_package) . "</b></p>";
|
||||||
|
@ -463,10 +463,11 @@ if ($install_free_package) {
|
|||||||
|
|
||||||
update_manager_starting_update();
|
update_manager_starting_update();
|
||||||
|
|
||||||
|
$result = update_manager_starting_update();
|
||||||
|
|
||||||
|
if ($result)
|
||||||
|
update_manager_set_current_package($version);
|
||||||
|
|
||||||
db_process_sql_update('tconfig', array('`value`' => $version),
|
|
||||||
array('`token`' => "current_package"));
|
|
||||||
$config['current_package'] = $version;
|
|
||||||
|
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
|
@ -30,29 +30,6 @@ function update_manager_get_config_values() {
|
|||||||
db_encapsule_fields_with_same_name_to_instructions('key'),
|
db_encapsule_fields_with_same_name_to_instructions('key'),
|
||||||
'customer_key');
|
'customer_key');
|
||||||
|
|
||||||
if (enterprise_installed()) {
|
|
||||||
$current_update = db_get_value(
|
|
||||||
db_encapsule_fields_with_same_name_to_instructions('value'),
|
|
||||||
'tupdate_settings',
|
|
||||||
db_encapsule_fields_with_same_name_to_instructions('key'),
|
|
||||||
'current_package_enterprise');
|
|
||||||
|
|
||||||
$current_update = 0;
|
|
||||||
if (isset($config['current_package_enterprise']))
|
|
||||||
$current_update = $config['current_package_enterprise'];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$current_update = db_get_value(
|
|
||||||
db_encapsule_fields_with_same_name_to_instructions('value'),
|
|
||||||
'tupdate_settings',
|
|
||||||
db_encapsule_fields_with_same_name_to_instructions('key'),
|
|
||||||
'current_package');
|
|
||||||
|
|
||||||
$current_update = 0;
|
|
||||||
if (isset($config['current_package']))
|
|
||||||
$current_update = $config['current_package'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$limit_count = db_get_value_sql("SELECT count(*) FROM tagente");
|
$limit_count = db_get_value_sql("SELECT count(*) FROM tagente");
|
||||||
|
|
||||||
|
|
||||||
@ -62,7 +39,7 @@ function update_manager_get_config_values() {
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'license' => $license,
|
'license' => $license,
|
||||||
'current_update' => $current_update,
|
'current_update' => update_manager_get_current_package(),
|
||||||
'limit_count' => $limit_count,
|
'limit_count' => $limit_count,
|
||||||
'build' => $build_version,
|
'build' => $build_version,
|
||||||
'version' => $pandora_version,
|
'version' => $pandora_version,
|
||||||
@ -374,16 +351,16 @@ function update_manager_starting_update() {
|
|||||||
$path_package = $config['attachment_store'] .
|
$path_package = $config['attachment_store'] .
|
||||||
"/downloads/last_package.tgz";
|
"/downloads/last_package.tgz";
|
||||||
|
|
||||||
try {
|
$full_path = $config['attachment_store'] . "/downloads/pandora_console";
|
||||||
rrmdir($config['attachment_store'] .
|
rrmdir($full_path);
|
||||||
"/downloads/temp_update/pandora_console");
|
|
||||||
|
|
||||||
$phar = new PharData($path_package);
|
ob_start();
|
||||||
$phar->extractTo($config['attachment_store'] . "/downloads/temp_update");
|
$result = system("tar xvzf " . $path_package .
|
||||||
}
|
" -C " . $config['attachment_store'] . "/downloads/", $none);
|
||||||
catch (Exception $e) {
|
ob_end_clean();
|
||||||
// handle errors
|
|
||||||
|
if ($result != 0) {
|
||||||
db_process_sql_update('tconfig',
|
db_process_sql_update('tconfig',
|
||||||
array('value' => json_encode(
|
array('value' => json_encode(
|
||||||
array(
|
array(
|
||||||
@ -393,24 +370,21 @@ function update_manager_starting_update() {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
array('token' => 'progress_update_status'));
|
array('token' => 'progress_update_status'));
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
db_process_sql_update('tconfig',
|
db_process_sql_update('tconfig',
|
||||||
array('value' => 50),
|
array('value' => 50),
|
||||||
array('token' => 'progress_update'));
|
array('token' => 'progress_update'));
|
||||||
|
|
||||||
$path_array = array('downloads', 'temp_update', 'pandora_console');
|
|
||||||
$full_path = $config['attachment_store'];
|
|
||||||
foreach ($path_array as $directory) {
|
|
||||||
$full_path = $full_path . '/' . $directory;
|
|
||||||
if (!is_dir($full_path)) {
|
|
||||||
mkdir($full_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$homedir = $config['homedir'];
|
$homedir = $config['homedir'];
|
||||||
|
|
||||||
$result = update_manager_recurse_copy($full_path, $homedir,
|
$result = update_manager_recurse_copy(
|
||||||
|
$full_path,
|
||||||
|
$homedir,
|
||||||
array('install.php'));
|
array('install.php'));
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
@ -423,6 +397,8 @@ function update_manager_starting_update() {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
array('token' => 'progress_update_status'));
|
array('token' => 'progress_update_status'));
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
db_process_sql_update('tconfig',
|
db_process_sql_update('tconfig',
|
||||||
@ -437,6 +413,8 @@ function update_manager_starting_update() {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
array('token' => 'progress_update_status'));
|
array('token' => 'progress_update_status'));
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,4 +446,52 @@ function update_manager_recurse_copy($src, $dst, $black_list) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_manager_set_current_package($current_package) {
|
||||||
|
if (enterprise_installed()) {
|
||||||
|
$token = 'current_package_enterprise';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$token = 'current_package';
|
||||||
|
}
|
||||||
|
|
||||||
|
$value = db_get_value('`value`',
|
||||||
|
'tupdate_settings', '`key`', $token);
|
||||||
|
|
||||||
|
if ($value === false) {
|
||||||
|
db_process_sql_insert('tupdate_settings',
|
||||||
|
array('`value`' => $current_package,
|
||||||
|
'`key`' => $token));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
db_process_sql_update('tupdate_settings',
|
||||||
|
array('`value`' => $current_package),
|
||||||
|
array('`key`' => $token));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_manager_get_current_package() {
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
if (enterprise_installed()) {
|
||||||
|
$token = 'current_package_enterprise';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$token = 'current_package';
|
||||||
|
}
|
||||||
|
|
||||||
|
$current_update = db_get_value(
|
||||||
|
db_encapsule_fields_with_same_name_to_instructions('value'),
|
||||||
|
'tupdate_settings',
|
||||||
|
db_encapsule_fields_with_same_name_to_instructions('key'),
|
||||||
|
$token);
|
||||||
|
|
||||||
|
if ($current_update === false) {
|
||||||
|
$current_update = 0;
|
||||||
|
if (isset($config[$token]))
|
||||||
|
$current_update = $config[$token];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $current_update;
|
||||||
|
}
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user