Merge branch 'develop' of https://192.168.50.5:8081/artica/pandorafms into develop
This commit is contained in:
commit
abf43a4230
|
@ -241,6 +241,7 @@ config_check();
|
|||
if ($check_minor_release_available) {
|
||||
set_pandora_error_for_header('There are one or more minor releases waiting for update, there are required administrator permissions', 'minor release/s available');
|
||||
}
|
||||
echo '<div id="alert_messages" style="display: none"></div>';
|
||||
|
||||
if ($config["alert_cnt"] > 0) {
|
||||
$maintenance_link = 'javascript:';
|
||||
|
|
|
@ -103,8 +103,8 @@ $data[2] = '<span id="alerts_loading" class="invisible">';
|
|||
$data[2] .= html_print_image('images/spinner.png', true);
|
||||
$data[2] .= '</span>';
|
||||
$users_profiles = "";
|
||||
$users_order = array('field' => 'full_name', 'order' => 'ASC');
|
||||
$data[2] .= html_print_select (users_get_info($users_order), 'users_id[]', '', '', '',
|
||||
$users_order = array('field' => 'id_user', 'order' => 'ASC');
|
||||
$data[2] .= html_print_select (users_get_info($users_order,'id_user'), 'users_id[]', '', '', '',
|
||||
'', true, true, true, '', false, 'width: 100%');
|
||||
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ $data[2] .= html_print_image('images/spinner.png', true);
|
|||
$data[2] .= '</span>';
|
||||
$users_profiles = "";
|
||||
$users_order = array('field' => 'id_user', 'order' => 'ASC');
|
||||
$data[2] .= html_print_select (users_get_info($users_order), 'users_id[]', '', '', '',
|
||||
$data[2] .= html_print_select (users_get_info($users_order,'id_user'), 'users_id[]', '', '', '',
|
||||
'', true, true, true, '', false, 'width: 100%');
|
||||
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ $baseurl = ui_get_full_url(false, false, false, false);
|
|||
var package_updated_successfully = "<?php echo __('Package updated successfully.'); ?>\n";
|
||||
var if_there_are_any_database_change = "<?php echo __('If there are any database change, it will be applied on the next login.'); ?>\n";
|
||||
var package_not_updated = "<?php echo __('Package not updated.'); ?>\n";
|
||||
var error_in_mr = "<?php echo __('Error in MR file'); ?>\n";
|
||||
var error_in_mr_accept = "<?php echo __('MR not accepted'); ?>\n";
|
||||
</script>
|
||||
|
||||
<form id="form-offline_update" method="post" enctype="multipart/form-data" class="fileupload_form">
|
||||
|
|
|
@ -40,9 +40,6 @@ if(!enterprise_installed()){
|
|||
$open=true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$memory_limit = ini_get("memory_limit");
|
||||
$memory_limit = str_replace("M", "", $memory_limit);
|
||||
$memory_limit = (int)$memory_limit;
|
||||
|
@ -66,7 +63,6 @@ if ($memory_limit < 100) {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/* Translators: Do not translade Update Manager, it's the name of the program */
|
||||
|
||||
if (is_metaconsole()) {
|
||||
|
@ -86,16 +82,15 @@ echo "<span class='loading' style='font-size:18pt;'>";
|
|||
echo "<img src='images/wait.gif' />";
|
||||
echo "</span><br><br>";
|
||||
|
||||
echo "<div><b>".__('The last version of package installed is:')."</b></div><br>";
|
||||
echo "<div style='color:#82b92e;font-size:40pt;font-weight:bold;'>".$current_package."</div>";
|
||||
echo "<div><b>" . __('The last version of package installed is:') . "</b></div><br>";
|
||||
echo "<div style='color:#82b92e;font-size:40pt;font-weight:bold;'>" . $current_package . "</div>";
|
||||
|
||||
|
||||
echo "<div class='checking_package' style='font-size:18pt;width:100%; text-align: center; display: none;'>";
|
||||
echo __('Checking for the newest package.');
|
||||
echo __('Checking for the newest package.');
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='downloading_package' style='font-size:18pt;width:100%; text-align: center; display: none;'>";
|
||||
echo __('Downloading for the newest package.');
|
||||
echo __('Downloading for the newest package.');
|
||||
echo "</div>";
|
||||
|
||||
echo "<div class='content'></div>";
|
||||
|
@ -103,17 +98,39 @@ echo "<div style='color:#82b92e;font-size:40pt;font-weight:bold;'>".$current_pac
|
|||
echo "<div class='progressbar' style='display: none;'><img class='progressbar_img' src='' /></div>";
|
||||
|
||||
|
||||
/* Hello there! :)
|
||||
/* -------------------------------------------------------------------------
|
||||
|
||||
Hello there! :)
|
||||
|
||||
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
|
||||
We added some of what seems to be "buggy" messages to the openSource version
|
||||
recently. This is not to force open-source users to move to the enterprise
|
||||
version, this is just to inform people using Pandora FMS open source that it
|
||||
requires skilled people to maintain and keep it running smoothly without
|
||||
professional support. This does not imply open-source version is limited
|
||||
in any way. If you check the recently added code, it contains only warnings
|
||||
and messages, no limitations except one: we removed the option to add custom
|
||||
logo in header. In the Update Manager section, it warns about the 'danger’
|
||||
of applying automated updates without a proper backup, remembering in the
|
||||
process that the Enterprise version comes with a human-tested package.
|
||||
Maintaining an OpenSource version with more than 500 agents is not so
|
||||
easy, that's why someone using a Pandora with 8000 agents should consider
|
||||
asking for support. It's not a joke, we know of many setups with a huge
|
||||
number of agents, and we hate to hear that “its becoming unstable and slow” :(
|
||||
|
||||
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
|
||||
You can of course remove the warnings, that's why we include the source and
|
||||
do not use any kind of trick. And that's why we added here this comment, to
|
||||
let you know this does not reflect any change in our opensource mentality of
|
||||
does the last 14 years.
|
||||
|
||||
*/
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
if($open){
|
||||
echo "<br><br><div id='updatemodal' class='publienterprisehide' title='Community version' style=''><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/icono_exclamacion_2.png'></div><br>
|
||||
";
|
||||
echo "
|
||||
<br><br>
|
||||
<div id='updatemodal' class='publienterprisehide' title='Community version' style=''>
|
||||
<img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/icono_exclamacion_2.png'>
|
||||
</div>
|
||||
<br>";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ $check_online_free_packages = (bool)get_parameter('check_online_free_packages');
|
|||
$update_last_free_package = (bool)get_parameter('update_last_free_package');
|
||||
$check_update_free_package = (bool)get_parameter('check_update_free_package');
|
||||
$install_free_package = (bool)get_parameter('install_free_package');
|
||||
$search_minor = (bool)get_parameter('search_minor');
|
||||
|
||||
if ($upload_file) {
|
||||
ob_clean();
|
||||
|
@ -108,128 +109,137 @@ if ($install_package) {
|
|||
global $config;
|
||||
ob_clean();
|
||||
|
||||
$package = (string) get_parameter("package");
|
||||
$package = trim($package);
|
||||
|
||||
$chunks = explode("_", basename($package));
|
||||
$chunks = explode(".", $chunks[1]);
|
||||
$version = $chunks[0];
|
||||
|
||||
// All files extracted
|
||||
$files_total = $package . "/files.txt";
|
||||
// Files copied
|
||||
$files_copied = $package . "/files.copied.txt";
|
||||
$return = array();
|
||||
|
||||
if (file_exists($files_copied)) {
|
||||
unlink($files_copied);
|
||||
}
|
||||
|
||||
if (file_exists($package)) {
|
||||
$accept = (bool)get_parameter("accept", false);
|
||||
if ($accept) {
|
||||
$package = (string) get_parameter("package");
|
||||
$package = trim($package);
|
||||
|
||||
if ($files_h = fopen($files_total, "r")) {
|
||||
$chunks = explode("_", basename($package));
|
||||
$chunks = explode(".", $chunks[1]);
|
||||
$version = $chunks[0];
|
||||
|
||||
// All files extracted
|
||||
$files_total = $package . "/files.txt";
|
||||
// Files copied
|
||||
$files_copied = $package . "/files.copied.txt";
|
||||
$return = array();
|
||||
|
||||
if (file_exists($files_copied)) {
|
||||
unlink($files_copied);
|
||||
}
|
||||
|
||||
if (file_exists($package)) {
|
||||
|
||||
while ($line = stream_get_line($files_h, 65535, "\n")) {
|
||||
$line = trim($line);
|
||||
if ($files_h = fopen($files_total, "r")) {
|
||||
|
||||
// Tries to move the old file to the directory backup inside the extracted package
|
||||
if (file_exists($config["homedir"] . "/" . $line)) {
|
||||
rename($config["homedir"] . "/" . $line,
|
||||
$package . "/backup/" . $line);
|
||||
}
|
||||
// Tries to move the new file to the Pandora directory
|
||||
$dirname = dirname($line);
|
||||
if (!file_exists($config["homedir"] . "/" . $dirname)) {
|
||||
$dir_array = explode("/", $dirname);
|
||||
$temp_dir = "";
|
||||
foreach ($dir_array as $dir) {
|
||||
$temp_dir .= "/" . $dir;
|
||||
if (!file_exists($config["homedir"] . $temp_dir)) {
|
||||
mkdir($config["homedir"] . $temp_dir);
|
||||
while ($line = stream_get_line($files_h, 65535, "\n")) {
|
||||
$line = trim($line);
|
||||
|
||||
// Tries to move the old file to the directory backup inside the extracted package
|
||||
if (file_exists($config["homedir"] . "/" . $line)) {
|
||||
rename($config["homedir"] . "/" . $line,
|
||||
$package . "/backup/" . $line);
|
||||
}
|
||||
// Tries to move the new file to the Pandora directory
|
||||
$dirname = dirname($line);
|
||||
if (!file_exists($config["homedir"] . "/" . $dirname)) {
|
||||
$dir_array = explode("/", $dirname);
|
||||
$temp_dir = "";
|
||||
foreach ($dir_array as $dir) {
|
||||
$temp_dir .= "/" . $dir;
|
||||
if (!file_exists($config["homedir"] . $temp_dir)) {
|
||||
mkdir($config["homedir"] . $temp_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_dir($package . "/" . $line)) {
|
||||
if (!file_exists($config["homedir"] . "/" . $line)) {
|
||||
mkdir($config["homedir"] . "/" . $line);
|
||||
file_put_contents($files_copied, $line."\n", FILE_APPEND | LOCK_EX);
|
||||
if (is_dir($package . "/" . $line)) {
|
||||
if (!file_exists($config["homedir"] . "/" . $line)) {
|
||||
mkdir($config["homedir"] . "/" . $line);
|
||||
file_put_contents($files_copied, $line."\n", FILE_APPEND | LOCK_EX);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (rename($package."/".$line, $config["homedir"]."/".$line)) {
|
||||
|
||||
// Append the moved file to the copied files txt
|
||||
if (!file_put_contents($files_copied, $line."\n", FILE_APPEND | LOCK_EX)) {
|
||||
else {
|
||||
if (rename($package."/".$line, $config["homedir"]."/".$line)) {
|
||||
|
||||
// Append the moved file to the copied files txt
|
||||
if (!file_put_contents($files_copied, $line."\n", FILE_APPEND | LOCK_EX)) {
|
||||
|
||||
// If the copy process fail, this code tries to restore the files backed up before
|
||||
if ($files_copied_h = fopen($files_copied, "r")) {
|
||||
while ($line_c = stream_get_line($files_copied_h, 65535, "\n")) {
|
||||
$line_c = trim($line_c);
|
||||
if (!rename($package."/backup/".$line, $config["homedir"]."/".$line_c)) {
|
||||
$backup_status = __("Some of your files might not be recovered.");
|
||||
}
|
||||
}
|
||||
if (!rename($package."/backup/".$line, $config["homedir"]."/".$line)) {
|
||||
$backup_status = __("Some of your files might not be recovered.");
|
||||
}
|
||||
fclose($files_copied_h);
|
||||
} else {
|
||||
$backup_status = __("Some of your old files might not be recovered.");
|
||||
}
|
||||
|
||||
fclose($files_h);
|
||||
$return["status"] = "error";
|
||||
$return["message"]= __("Line '$line' not copied to the progress file.")." ".$backup_status;
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
// If the copy process fail, this code tries to restore the files backed up before
|
||||
if ($files_copied_h = fopen($files_copied, "r")) {
|
||||
while ($line_c = stream_get_line($files_copied_h, 65535, "\n")) {
|
||||
$line_c = trim($line_c);
|
||||
if (!rename($package."/backup/".$line, $config["homedir"]."/".$line_c)) {
|
||||
$backup_status = __("Some of your files might not be recovered.");
|
||||
if (!rename($package."/backup/".$line, $config["homedir"]."/".$line)) {
|
||||
$backup_status = __("Some of your old files might not be recovered.");
|
||||
}
|
||||
}
|
||||
if (!rename($package."/backup/".$line, $config["homedir"]."/".$line)) {
|
||||
$backup_status = __("Some of your files might not be recovered.");
|
||||
}
|
||||
fclose($files_copied_h);
|
||||
} else {
|
||||
$backup_status = __("Some of your old files might not be recovered.");
|
||||
}
|
||||
else {
|
||||
$backup_status = __("Some of your files might not be recovered.");
|
||||
}
|
||||
|
||||
fclose($files_h);
|
||||
$return["status"] = "error";
|
||||
$return["message"]= __("Line '$line' not copied to the progress file.")." ".$backup_status;
|
||||
$return["message"]= __("File '$line' not copied.")." ".$backup_status;
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
// If the copy process fail, this code tries to restore the files backed up before
|
||||
if ($files_copied_h = fopen($files_copied, "r")) {
|
||||
while ($line_c = stream_get_line($files_copied_h, 65535, "\n")) {
|
||||
$line_c = trim($line_c);
|
||||
if (!rename($package."/backup/".$line, $config["homedir"]."/".$line)) {
|
||||
$backup_status = __("Some of your old files might not be recovered.");
|
||||
}
|
||||
}
|
||||
fclose($files_copied_h);
|
||||
}
|
||||
else {
|
||||
$backup_status = __("Some of your files might not be recovered.");
|
||||
}
|
||||
|
||||
fclose($files_h);
|
||||
$return["status"] = "error";
|
||||
$return["message"]= __("File '$line' not copied.")." ".$backup_status;
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
}
|
||||
fclose($files_h);
|
||||
}
|
||||
else {
|
||||
$return["status"] = "error";
|
||||
$return["message"]= __("An error ocurred while reading a file.");
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
fclose($files_h);
|
||||
}
|
||||
else {
|
||||
$return["status"] = "error";
|
||||
$return["message"]= __("An error ocurred while reading a file.");
|
||||
$return["message"]= __("The package does not exist");
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$return["status"] = "error";
|
||||
$return["message"]= __("The package does not exist");
|
||||
|
||||
update_manager_enterprise_set_version($version);
|
||||
db_pandora_audit("Update Pandora", "Update version: $version of Pandora FMS by ".$config['id_user']);
|
||||
|
||||
$return["status"] = "success";
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$return["status"] = "error";
|
||||
$return["message"]= __("Package not accepted");
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
|
||||
update_manager_enterprise_set_version($version);
|
||||
db_pandora_audit("Update Pandora", "Update version: $version of Pandora FMS by ".$config['id_user']);
|
||||
|
||||
$return["status"] = "success";
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($check_install_package) {
|
||||
|
@ -345,99 +355,115 @@ if ($check_online_free_packages) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($search_minor) {
|
||||
$have_minor_releases = db_check_minor_relase_available();
|
||||
|
||||
$return['have_minor'] = false;
|
||||
if ($have_minor_releases) {
|
||||
$return['have_minor'] = true;
|
||||
$size_mr = get_number_of_mr();
|
||||
$return['mr'] = $size_mr;
|
||||
}
|
||||
|
||||
echo json_encode($return);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($update_last_free_package) {
|
||||
|
||||
$package = get_parameter('package', '');
|
||||
$version = get_parameter('version', '');
|
||||
$accept = (boolean)get_parameter('accept', false);
|
||||
$package_url = base64_decode($package);
|
||||
|
||||
$params = array('action' => 'get_package',
|
||||
if ($accept) {
|
||||
$params = array('action' => 'get_package',
|
||||
'license' => $license,
|
||||
'limit_count' => $users,
|
||||
'current_package' => $current_package,
|
||||
'package' => $package,
|
||||
'version' => $config['version'],
|
||||
'build' => $config['build']);
|
||||
|
||||
$curlObj = curl_init();
|
||||
//curl_setopt($curlObj, CURLOPT_URL, $config['url_updatemanager']);
|
||||
curl_setopt($curlObj, CURLOPT_URL, $package_url);
|
||||
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curlObj, CURLOPT_FOLLOWLOCATION, true);
|
||||
//curl_setopt($curlObj, CURLOPT_POST, true);
|
||||
//curl_setopt($curlObj, CURLOPT_POSTFIELDS, $params);
|
||||
curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, false);
|
||||
if (isset($config['update_manager_proxy_server'])) {
|
||||
curl_setopt($curlObj, CURLOPT_PROXY, $config['update_manager_proxy_server']);
|
||||
}
|
||||
if (isset($config['update_manager_proxy_port'])) {
|
||||
curl_setopt($curlObj, CURLOPT_PROXYPORT, $config['update_manager_proxy_port']);
|
||||
}
|
||||
if (isset($config['update_manager_proxy_user'])) {
|
||||
curl_setopt($curlObj, CURLOPT_PROXYUSERPWD, $config['update_manager_proxy_user'] . ':' . $config['update_manager_proxy_password']);
|
||||
}
|
||||
|
||||
$result = curl_exec($curlObj);
|
||||
$http_status = curl_getinfo($curlObj, CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($curlObj);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (empty($result)) {
|
||||
echo json_encode(array(
|
||||
'in_progress' => false,
|
||||
'message' => __('Fail to update to the last package.')));
|
||||
}
|
||||
else {
|
||||
file_put_contents(
|
||||
$config['attachment_store'] . "/downloads/last_package.tgz" , $result);
|
||||
|
||||
echo json_encode(array(
|
||||
'in_progress' => true,
|
||||
'message' => __('Starting to update to the last package.')));
|
||||
$curlObj = curl_init();
|
||||
curl_setopt($curlObj, CURLOPT_URL, $package_url);
|
||||
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curlObj, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, false);
|
||||
if (isset($config['update_manager_proxy_server'])) {
|
||||
curl_setopt($curlObj, CURLOPT_PROXY, $config['update_manager_proxy_server']);
|
||||
}
|
||||
if (isset($config['update_manager_proxy_port'])) {
|
||||
curl_setopt($curlObj, CURLOPT_PROXYPORT, $config['update_manager_proxy_port']);
|
||||
}
|
||||
if (isset($config['update_manager_proxy_user'])) {
|
||||
curl_setopt($curlObj, CURLOPT_PROXYUSERPWD, $config['update_manager_proxy_user'] . ':' . $config['update_manager_proxy_password']);
|
||||
}
|
||||
|
||||
$result = curl_exec($curlObj);
|
||||
$http_status = curl_getinfo($curlObj, CURLINFO_HTTP_CODE);
|
||||
|
||||
$progress_update_status = db_get_value(
|
||||
'value', 'tconfig', 'token', 'progress_update_status');
|
||||
|
||||
|
||||
|
||||
if (empty($progress_update_status)) {
|
||||
db_process_sql_insert('tconfig',
|
||||
array(
|
||||
'value' => 0,
|
||||
'token' => 'progress_update')
|
||||
);
|
||||
|
||||
db_process_sql_insert('tconfig',
|
||||
array(
|
||||
'value' => json_encode(
|
||||
array(
|
||||
'status' => 'in_progress',
|
||||
'message' => ''
|
||||
)),
|
||||
'token' => 'progress_update_status')
|
||||
);
|
||||
curl_close($curlObj);
|
||||
|
||||
if (empty($result)) {
|
||||
echo json_encode(array(
|
||||
'in_progress' => false,
|
||||
'message' => __('Fail to update to the last package.')));
|
||||
}
|
||||
else {
|
||||
db_process_sql_update('tconfig',
|
||||
array('value' => 0),
|
||||
array('token' => 'progress_update'));
|
||||
file_put_contents(
|
||||
$config['attachment_store'] . "/downloads/last_package.tgz" , $result);
|
||||
|
||||
db_process_sql_update('tconfig',
|
||||
array('value' => json_encode(
|
||||
array(
|
||||
'status' => 'in_progress',
|
||||
'message' => ''
|
||||
echo json_encode(array(
|
||||
'in_progress' => true,
|
||||
'message' => __('Starting to update to the last package.')));
|
||||
|
||||
|
||||
$progress_update_status = db_get_value(
|
||||
'value', 'tconfig', 'token', 'progress_update_status');
|
||||
|
||||
|
||||
|
||||
if (empty($progress_update_status)) {
|
||||
db_process_sql_insert('tconfig',
|
||||
array(
|
||||
'value' => 0,
|
||||
'token' => 'progress_update')
|
||||
);
|
||||
|
||||
db_process_sql_insert('tconfig',
|
||||
array(
|
||||
'value' => json_encode(
|
||||
array(
|
||||
'status' => 'in_progress',
|
||||
'message' => ''
|
||||
)),
|
||||
'token' => 'progress_update_status')
|
||||
);
|
||||
}
|
||||
else {
|
||||
db_process_sql_update('tconfig',
|
||||
array('value' => 0),
|
||||
array('token' => 'progress_update'));
|
||||
|
||||
db_process_sql_update('tconfig',
|
||||
array('value' => json_encode(
|
||||
array(
|
||||
'status' => 'in_progress',
|
||||
'message' => ''
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
array('token' => 'progress_update_status'));
|
||||
),
|
||||
array('token' => 'progress_update_status'));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$return["in_progress"] = false;
|
||||
$return["message"] = __("Package not accepted.");
|
||||
|
||||
echo json_encode($return);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -59,24 +59,14 @@ $(document).ready (function () {
|
|||
});
|
||||
|
||||
$("a.show_systemalert_dialog").click (function () {
|
||||
$('body').append( "<div id='opacidad' style='position:fixed;background:black;opacity:0.6;z-index:1'></div>" );
|
||||
jQuery.get ("ajax.php",
|
||||
{"page": "operation/system_alert"},
|
||||
function (data, status) {
|
||||
$("#alert_messages").html(data);
|
||||
$("#alert_messages").dialog({
|
||||
resizable: false,
|
||||
draggable: true,
|
||||
width: 450,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
open: function (event, ui) {
|
||||
dialog_open = this;
|
||||
}
|
||||
});
|
||||
$("#alert_messages").css('padding','0px');
|
||||
$("#alert_messages").hide ()
|
||||
.empty ()
|
||||
.append (data)
|
||||
.show ();
|
||||
},
|
||||
"html"
|
||||
);
|
||||
|
|
|
@ -193,40 +193,196 @@ function formatFileSize(bytes) {
|
|||
function install_package (package, homeurl) {
|
||||
var home_url = (typeof homeurl !== 'undefined') ? homeurl + '/' : '';
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters['install_package'] = 1;
|
||||
parameters['package'] = package;
|
||||
|
||||
$('#form-offline_update ul').find('li').removeClass('suc');
|
||||
$('#form-offline_update ul').find('li').addClass('loading');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: home_url + 'ajax.php',
|
||||
data: parameters,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#form-offline_update ul').find('li').removeClass('loading');
|
||||
if (data.status == "success") {
|
||||
$('#form-offline_update ul').find('li').addClass('suc');
|
||||
$('#form-offline_update ul').find('li').find('p').html(package_updated_successfully)
|
||||
.append("<i>" + if_there_are_any_database_change + "</i>");
|
||||
$("<div id='pkg_apply_dialog' class= 'dialog ui-dialog-content'></div>").dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: 'black'
|
||||
},
|
||||
width: 600,
|
||||
height: 350,
|
||||
buttons: {
|
||||
"Apply package": function () {
|
||||
$("#pkg_apply_dialog").dialog("close");
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters['search_minor'] = 1;
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: home_url + 'ajax.php',
|
||||
data: parameters,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data['have_minor']) {
|
||||
$("<div id='mr_dialog2' class='dialog ui-dialog-content' title='Menor release available'></div>").dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: 'black'
|
||||
},
|
||||
width: 600,
|
||||
height: 350,
|
||||
buttons: {
|
||||
"Apply minor releases": function () {
|
||||
var no_error = apply_minor_release(data['mr']);
|
||||
$("#apply_rr_button").remove();
|
||||
$("#cancel_rr_button").remove();
|
||||
if (no_error) {
|
||||
var parameters = {};
|
||||
parameters['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters['install_package'] = 1;
|
||||
parameters['package'] = package;
|
||||
parameters['accept'] = 1;
|
||||
|
||||
$('#form-offline_update ul').find('li').removeClass('suc');
|
||||
$('#form-offline_update ul').find('li').addClass('loading');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: home_url + 'ajax.php',
|
||||
data: parameters,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#form-offline_update ul').find('li').removeClass('loading');
|
||||
if (data.status == "success") {
|
||||
$('#form-offline_update ul').find('li').addClass('suc');
|
||||
$('#form-offline_update ul').find('li').find('p').html(package_updated_successfully)
|
||||
.append("<i>" + if_there_are_any_database_change + "</i>");
|
||||
}
|
||||
else {
|
||||
$('#form-offline_update ul').find('li').addClass('error');
|
||||
$('#form-offline_update ul').find('li').find('p').html(package_not_updated)
|
||||
.append("<i>"+data.message+"</i>");
|
||||
}
|
||||
$('#form-offline_update ul').find('li').css("cursor", "pointer");
|
||||
$('#form-offline_update ul').find('li').click(function() {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Check the status of the update
|
||||
check_install_package(package, homeurl);
|
||||
}
|
||||
else {
|
||||
$('#form-offline_update ul').find('li').addClass('error');
|
||||
$('#form-offline_update ul').find('li').find('p').html(error_in_mr)
|
||||
.append("<i>"+data.message+"</i>");
|
||||
}
|
||||
},
|
||||
"Cancel": function () {
|
||||
$("#mr_dialog2").dialog("close");
|
||||
$('#form-offline_update ul').find('li').addClass('error');
|
||||
$('#form-offline_update ul').find('li').find('p').html(error_in_mr_accept)
|
||||
.append("<i>"+data.message+"</i>");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('button:contains(Apply minor releases)').attr("id","apply_rr_button");
|
||||
$('button:contains(Cancel)').attr("id","cancel_rr_button");
|
||||
|
||||
var dialog_text = "<div><h3>Do you want to apply minor releases?</h3></br>";
|
||||
dialog_text = dialog_text + "<h2>We recommend launch a planned downtime to this process</h2></br>";
|
||||
dialog_text = dialog_text + "<a href=\"<?php echo $config['homeurl']; ?>index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">Planned downtimes</a></div>"
|
||||
|
||||
$('#mr_dialog2').html(dialog_text);
|
||||
$('#mr_dialog2').dialog('open');
|
||||
}
|
||||
else {
|
||||
$("#pkg_apply_dialog").dialog("close");
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters['install_package'] = 1;
|
||||
parameters['package'] = package;
|
||||
parameters['accept'] = 1;
|
||||
|
||||
$('#form-offline_update ul').find('li').removeClass('suc');
|
||||
$('#form-offline_update ul').find('li').addClass('loading');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: home_url + 'ajax.php',
|
||||
data: parameters,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#form-offline_update ul').find('li').removeClass('loading');
|
||||
if (data.status == "success") {
|
||||
$('#form-offline_update ul').find('li').addClass('suc');
|
||||
$('#form-offline_update ul').find('li').find('p').html(package_updated_successfully)
|
||||
.append("<i>" + if_there_are_any_database_change + "</i>");
|
||||
}
|
||||
else {
|
||||
$('#form-offline_update ul').find('li').addClass('error');
|
||||
$('#form-offline_update ul').find('li').find('p').html(package_not_updated)
|
||||
.append("<i>"+data.message+"</i>");
|
||||
}
|
||||
$('#form-offline_update ul').find('li').css("cursor", "pointer");
|
||||
$('#form-offline_update ul').find('li').click(function() {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Check the status of the update
|
||||
check_install_package(package, homeurl);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
"Cancel": function () {
|
||||
$(this).dialog("close");
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters['install_package'] = 1;
|
||||
parameters['package'] = package;
|
||||
parameters['accept'] = 0;
|
||||
|
||||
$('#form-offline_update ul').find('li').removeClass('suc');
|
||||
$('#form-offline_update ul').find('li').addClass('loading');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: home_url + 'ajax.php',
|
||||
data: parameters,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$('#form-offline_update ul').find('li').removeClass('loading');
|
||||
if (data.status == "success") {
|
||||
$('#form-offline_update ul').find('li').addClass('suc');
|
||||
$('#form-offline_update ul').find('li').find('p').html(package_updated_successfully)
|
||||
.append("<i>" + if_there_are_any_database_change + "</i>");
|
||||
}
|
||||
else {
|
||||
$('#form-offline_update ul').find('li').addClass('error');
|
||||
$('#form-offline_update ul').find('li').find('p').html(package_not_updated)
|
||||
.append("<i>"+data.message+"</i>");
|
||||
}
|
||||
$('#form-offline_update ul').find('li').css("cursor", "pointer");
|
||||
$('#form-offline_update ul').find('li').click(function() {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Check the status of the update
|
||||
check_install_package(package, homeurl);
|
||||
}
|
||||
else {
|
||||
$('#form-offline_update ul').find('li').addClass('error');
|
||||
$('#form-offline_update ul').find('li').find('p').html(package_not_updated)
|
||||
.append("<i>"+data.message+"</i>");
|
||||
}
|
||||
$('#form-offline_update ul').find('li').css("cursor", "pointer");
|
||||
$('#form-offline_update ul').find('li').click(function() {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var dialog_text = "<div><h3>Do you want to apply the package?</h3></br>";
|
||||
|
||||
// Check the status of the update
|
||||
check_install_package(package, homeurl);
|
||||
$('#pkg_apply_dialog').html(dialog_text);
|
||||
$('#pkg_apply_dialog').dialog('open');
|
||||
}
|
||||
|
||||
function check_install_package(package, homeurl) {
|
||||
|
@ -295,33 +451,171 @@ function update_last_package(package, version, homeurl) {
|
|||
$("#box_online .loading").show();
|
||||
$("#box_online .download_package").show();
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters['update_last_free_package'] = 1;
|
||||
parameters['package'] = package;
|
||||
parameters['version'] = version;
|
||||
|
||||
jQuery.post(
|
||||
home_url + "ajax.php",
|
||||
parameters,
|
||||
function (data) {
|
||||
if (data['in_progress']) {
|
||||
$("#box_online .loading").hide();
|
||||
$("#box_online .download_package").hide();
|
||||
|
||||
$("#box_online .content").html(data['message']);
|
||||
|
||||
install_free_package(package, version, homeurl);
|
||||
setTimeout(function () {
|
||||
check_progress_update(homeurl);
|
||||
}, 1000);
|
||||
}
|
||||
else {
|
||||
$("#box_online .content").html(data['message']);
|
||||
}
|
||||
$("<div id='pkg_apply_dialog' class= 'dialog ui-dialog-content'></div>").dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: 'black'
|
||||
},
|
||||
"json"
|
||||
);
|
||||
width: 600,
|
||||
height: 350,
|
||||
buttons: {
|
||||
"Apply package": function () {
|
||||
$(this).dialog("close");
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters['search_minor'] = 1;
|
||||
|
||||
jQuery.post(
|
||||
home_url + "ajax.php",
|
||||
parameters,
|
||||
function (data) {
|
||||
$("#box_online .loading").hide();
|
||||
$("#box_online .downloading_package").hide();
|
||||
|
||||
if (data['have_minor']) {
|
||||
$("<div id='mr_dialog2' class='dialog ui-dialog-content' title='Menor release available'></div>").dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: 'black'
|
||||
},
|
||||
width: 600,
|
||||
height: 350,
|
||||
buttons: {
|
||||
"Apply minor releases": function () {
|
||||
var no_error = apply_minor_release(data['mr']);
|
||||
|
||||
if (no_error) {
|
||||
var parameters2 = {};
|
||||
parameters2['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters2['update_last_free_package'] = 1;
|
||||
parameters2['package'] = package;
|
||||
parameters2['version'] = version;
|
||||
parameters2['accept'] = 1;
|
||||
|
||||
jQuery.post(
|
||||
home_url + "ajax.php",
|
||||
parameters2,
|
||||
function (data) {
|
||||
if (data['in_progress']) {
|
||||
$("#box_online .loading").hide();
|
||||
$("#box_online .download_package").hide();
|
||||
|
||||
$("#box_online .content").html(data['message']);
|
||||
|
||||
install_free_package(package, version, homeurl);
|
||||
setTimeout(function () {
|
||||
check_progress_update(homeurl);
|
||||
}, 1000);
|
||||
}
|
||||
else {
|
||||
$("#box_online .content").html(data['message']);
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
else {
|
||||
$("#box_online .content").html("Error in MR file");
|
||||
}
|
||||
},
|
||||
"Cancel": function () {
|
||||
$(this).dialog("close");
|
||||
$("#box_online .loading").hide();
|
||||
$("#box_online .downloading_package").hide();
|
||||
$("#box_online .content").html("MR not accepted");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('button:contains(Apply minor releases)').attr("id","apply_rr_button");
|
||||
$('button:contains(Cancel)').attr("id","cancel_rr_button");
|
||||
|
||||
var dialog_text = "<div><h3>Do you want to apply minor releases?</h3></br>";
|
||||
dialog_text = dialog_text + "<h2>We recommend launch a planned downtime to this process</h2></br>";
|
||||
dialog_text = dialog_text + "<a href=\"<?php echo $config['homeurl']; ?>index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">Planned downtimes</a></div>"
|
||||
|
||||
$('#mr_dialog2').html(dialog_text);
|
||||
$('#mr_dialog2').dialog('open');
|
||||
}
|
||||
else {
|
||||
var parameters2 = {};
|
||||
parameters2['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters2['update_last_free_package'] = 1;
|
||||
parameters2['package'] = package;
|
||||
parameters2['version'] = version;
|
||||
parameters2['accept'] = 1;
|
||||
|
||||
jQuery.post(
|
||||
home_url + "ajax.php",
|
||||
parameters2,
|
||||
function (data) {
|
||||
if (data['in_progress']) {
|
||||
$("#box_online .loading").hide();
|
||||
$("#box_online .download_package").hide();
|
||||
|
||||
$("#box_online .content").html(data['message']);
|
||||
|
||||
install_free_package(package, version, homeurl);
|
||||
setTimeout(function () {
|
||||
check_progress_update(homeurl);
|
||||
}, 1000);
|
||||
}
|
||||
else {
|
||||
$("#box_online .content").html(data['message']);
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
"Cancel": function () {
|
||||
$(this).dialog("close");
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = 'include/ajax/update_manager.ajax';
|
||||
parameters['update_last_free_package'] = 1;
|
||||
parameters['package'] = package;
|
||||
parameters['version'] = version;
|
||||
parameters['accept'] = 0;
|
||||
|
||||
jQuery.post(
|
||||
home_url + "ajax.php",
|
||||
parameters,
|
||||
function (data) {
|
||||
if (data['in_progress']) {
|
||||
$("#box_online .loading").hide();
|
||||
$("#box_online .download_package").hide();
|
||||
|
||||
$("#box_online .content").html(data['message']);
|
||||
|
||||
install_free_package(package, version, homeurl);
|
||||
setTimeout(function () {
|
||||
check_progress_update(homeurl);
|
||||
}, 1000);
|
||||
}
|
||||
else {
|
||||
$("#box_online .content").html(data['message']);
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var dialog_text = "<div><h3>Do you want to apply the package?</h3></br>";
|
||||
|
||||
$('#pkg_apply_dialog').html(dialog_text);
|
||||
$('#pkg_apply_dialog').dialog('open');
|
||||
}
|
||||
|
||||
function check_progress_update(homeurl) {
|
||||
|
@ -410,4 +704,45 @@ function install_free_package(package, version, homeurl) {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function apply_minor_release (n_mr) {
|
||||
var error = false;
|
||||
$('#mr_dialog2').empty();
|
||||
$.each(n_mr, function(i, mr) {
|
||||
var params = {};
|
||||
params["updare_rr"] = 1;
|
||||
params["number"] = mr;
|
||||
params["page"] = "include/ajax/rolling_release.ajax";
|
||||
|
||||
jQuery.ajax ({
|
||||
data: params,
|
||||
async: false,
|
||||
dataType: "html",
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
success: function (data) {
|
||||
if (data != "") {
|
||||
$('#mr_dialog2').empty();
|
||||
$('#mr_dialog2').html("<h2>" + data + "</h2>");
|
||||
error = true;
|
||||
}
|
||||
else {
|
||||
$('#mr_dialog2').append("<p>- Applying DB MR #" + mr + "</p>");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (error) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if (error) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
$('#mr_dialog2').append("<h2>Updated finished successfully</h2>");
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -405,14 +405,18 @@ button.ui-button::-moz-focus-inner {
|
|||
outline: 0;
|
||||
}
|
||||
.ui-dialog .ui-dialog-titlebar {
|
||||
display: list-item;
|
||||
text-align: center;
|
||||
padding: .4em 1em;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
padding-bottom: 12px;
|
||||
height: 37px;
|
||||
/*margin: 3px;*/
|
||||
position: relative;
|
||||
}
|
||||
.ui-dialog .ui-dialog-title {
|
||||
float: left;
|
||||
font-family: Nunito;
|
||||
font-size: 13pt;
|
||||
margin: .1em 0;
|
||||
white-space: nowrap;
|
||||
width: 90%;
|
||||
|
@ -421,12 +425,12 @@ button.ui-button::-moz-focus-inner {
|
|||
}
|
||||
.ui-dialog .ui-dialog-titlebar-close {
|
||||
position: absolute;
|
||||
right: .3em;
|
||||
right: 1em;
|
||||
width: 21px;
|
||||
margin: 0px 0 0 0;
|
||||
padding: 1px;
|
||||
height: 20px;
|
||||
bottom: 20%;
|
||||
bottom: 30%;
|
||||
}
|
||||
.ui-dialog .ui-dialog-content {
|
||||
position: relative;
|
||||
|
@ -446,8 +450,12 @@ button.ui-button::-moz-focus-inner {
|
|||
float: right;
|
||||
}
|
||||
.ui-dialog .ui-dialog-buttonpane button {
|
||||
margin: .5em .4em .5em 0;
|
||||
margin: .5em 1em .5em 0;
|
||||
cursor: pointer;
|
||||
background-color: white;
|
||||
border: 1px solid #82b92e;
|
||||
height:30px;
|
||||
width:90px;
|
||||
}
|
||||
.ui-dialog .ui-resizable-se {
|
||||
width: 12px;
|
||||
|
@ -1252,9 +1260,7 @@ body .ui-tooltip {
|
|||
}
|
||||
|
||||
.ui-dialog-titlebar .ui-icon-closethick {
|
||||
background-image: url("../../images/close_button_dialog.png");
|
||||
width: 14px;
|
||||
height: 13px;
|
||||
background-image: url("../../images/icono_cerrar.png");
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
|
|
|
@ -3595,8 +3595,10 @@ div.simple_value > a > span.text p
|
|||
border-bottom-left-radius: 5px;
|
||||
z-index:3;
|
||||
position:fixed;
|
||||
width:650px;
|
||||
top: 30%;
|
||||
width:750px;
|
||||
max-width:750px;
|
||||
min-width:750px;
|
||||
top: 20%;
|
||||
background:white;
|
||||
}
|
||||
.modalheader{
|
||||
|
|
|
@ -3219,13 +3219,12 @@ table#policy_modules td * {
|
|||
-webkit-border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
z-index:2;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
z-index:3;
|
||||
position:fixed;
|
||||
width:650px;
|
||||
width:750px;
|
||||
max-width:750px;
|
||||
min-width:750px;
|
||||
top: 20%;
|
||||
background:white;
|
||||
}
|
||||
.modalheader{
|
||||
|
|
|
@ -3222,13 +3222,12 @@ table#policy_modules td * {
|
|||
-webkit-border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
z-index:2;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
z-index:3;
|
||||
position:fixed;
|
||||
width:650px;
|
||||
width:750px;
|
||||
max-width:750px;
|
||||
min-width:750px;
|
||||
top: 20%;
|
||||
background:white;
|
||||
}
|
||||
.modalheader{
|
||||
|
|
|
@ -445,8 +445,6 @@ if (! isset ($config['id_user'])) {
|
|||
$config['id_user'] = $nick_in_db;
|
||||
|
||||
if (is_user_admin($config['id_user'])) {
|
||||
$have_minor_releases = db_check_minor_relase_available();
|
||||
|
||||
// PHP configuration values
|
||||
$PHPupload_max_filesize = config_return_in_bytes(ini_get('upload_max_filesize'));
|
||||
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
|
||||
|
@ -468,47 +466,6 @@ if (! isset ($config['id_user'])) {
|
|||
ini_set('memory_limit', config_return_in_bytes('500M'));
|
||||
}
|
||||
|
||||
if ($have_minor_releases) {
|
||||
$size_mr = get_number_of_mr();
|
||||
echo "<div class= 'dialog ui-dialog-content' title='".__("Minor release available")."' id='mr_dialog2'>" . __('') . "</div>";
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
$(document).ready (function () {;
|
||||
$('#mr_dialog2').dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: 'black'
|
||||
},
|
||||
width: 600,
|
||||
height: 350,
|
||||
buttons: {
|
||||
"Apply minor releases": function () {
|
||||
var n_mr = '<?php echo implode(",", $size_mr);?>';
|
||||
apply_minor_release(n_mr.split(","));
|
||||
},
|
||||
"Cancel": function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('button:contains(Apply minor releases)').attr("id","apply_rr_button");
|
||||
$('button:contains(Cancel)').attr("id","cancel_rr_button");
|
||||
|
||||
var dialog_text = "<div><h3>Do you want to apply minor releases?</h3></br>";
|
||||
dialog_text = dialog_text + "<h2>We recommend launch a planned downtime to this process</h2></br>";
|
||||
dialog_text = dialog_text + "<a href=\"<?php echo $config['homeurl']; ?>index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">Planned downtimes</a></div>"
|
||||
|
||||
$('#mr_dialog2').html(dialog_text);
|
||||
$('#mr_dialog2').dialog('open');
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
set_time_limit((int)$PHPmax_execution_time);
|
||||
ini_set('upload_max_filesize', $PHPupload_max_filesize);
|
||||
ini_set('memory_limit', $PHPmemory_limit);
|
||||
|
@ -933,7 +890,6 @@ if ($config["pure"] == 0) {
|
|||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div id="alert_messages" style="display: none"></div>';
|
||||
/// Clippy function
|
||||
require_once('include/functions_clippy.php');
|
||||
clippy_start($sec2);
|
||||
|
@ -975,48 +931,6 @@ require('include/php_to_js_values.php');
|
|||
return rv;
|
||||
};
|
||||
})();
|
||||
|
||||
function apply_minor_release (n_mr) {
|
||||
var error = false;
|
||||
$("#apply_rr_button").remove();
|
||||
$("#cancel_rr_button").text("Close");
|
||||
$('#mr_dialog2').empty();
|
||||
$('#mr_dialog2').append("<img id=\"rr_image\" src=\"<?php echo $config['homeurl'] . 'images/spinner.gif'; ?>\">");
|
||||
$.each(n_mr, function(i, mr) {
|
||||
var params = {};
|
||||
params["updare_rr"] = 1;
|
||||
params["number"] = mr;
|
||||
params["page"] = "include/ajax/rolling_release.ajax";
|
||||
|
||||
jQuery.ajax ({
|
||||
data: params,
|
||||
async: false,
|
||||
dataType: "html",
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
success: function (data) {
|
||||
if (data != "") {
|
||||
$('#mr_dialog2').empty();
|
||||
$('#mr_dialog2').html("<h2>" + data + "</h2>");
|
||||
error = true;
|
||||
}
|
||||
else {
|
||||
$('#mr_dialog2').append("<p>- Applying DB MR #" + mr + "</p>");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (error) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#rr_image').remove();
|
||||
|
||||
if (!error) {
|
||||
$('#mr_dialog2').append("<h2>Updated finished successfully</h2>");
|
||||
}
|
||||
}
|
||||
|
||||
function force_run_register () {
|
||||
run_identification_wizard (1, 0, 0);
|
||||
|
|
|
@ -228,7 +228,7 @@ function parse_mysql_dump($url) {
|
|||
$file_content = file($url);
|
||||
$query = "";
|
||||
foreach($file_content as $sql_line) {
|
||||
if (trim($sql_line) != "" && strpos($sql_line, "--") === false) {
|
||||
if (trim($sql_line) != "" && strpos($sql_line, "-- ") === false) {
|
||||
$query .= $sql_line;
|
||||
if(preg_match("/;[\040]*\$/", $sql_line)) {
|
||||
if (!$result = mysql_query($query)) {
|
||||
|
@ -251,7 +251,7 @@ function parse_mysqli_dump($connection, $url) {
|
|||
$file_content = file($url);
|
||||
$query = "";
|
||||
foreach($file_content as $sql_line) {
|
||||
if (trim($sql_line) != "" && strpos($sql_line, "--") === false) {
|
||||
if (trim($sql_line) != "" && strpos($sql_line, "-- ") === false) {
|
||||
$query .= $sql_line;
|
||||
if(preg_match("/;[\040]*\$/", $sql_line)) {
|
||||
if (!$result = mysqli_query($connection, $query)) {
|
||||
|
|
|
@ -115,113 +115,57 @@ if ($searchAgents) {
|
|||
$userGroups = users_get_groups($config['id_user'], 'AR', false);
|
||||
$id_userGroups = array_keys($userGroups);
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
|
||||
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
|
||||
INNER JOIN taddress_agent ON
|
||||
taddress.id_a = taddress_agent.id_a
|
||||
WHERE taddress.ip LIKE '%$stringSearchSQL%'";
|
||||
|
||||
$id = db_get_all_rows_sql($sql);
|
||||
if($id != ''){
|
||||
$aux = $id[0]['id_agent'];
|
||||
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t1.id_agente = $aux";
|
||||
if ($id != '') {
|
||||
$aux = $id[0]['id_agent'];
|
||||
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%cd " . $stringSearchSQL . "%%' OR
|
||||
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t1.id_agente = $aux";
|
||||
|
||||
if(count($id)>=2){
|
||||
for ($i = 1; $i < count($id); $i++){
|
||||
$aux = $id[$i]['id_agent'];
|
||||
$search_sql .= " OR t1.id_agente = $aux";
|
||||
}
|
||||
if (count($id) >= 2) {
|
||||
for ($i = 1; $i < count($id); $i++) {
|
||||
$aux = $id[$i]['id_agent'];
|
||||
$search_sql .= " OR t1.id_agente = $aux";
|
||||
}
|
||||
}else{
|
||||
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t1.direccion COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t1.alias COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%'";
|
||||
}
|
||||
$sql = "
|
||||
FROM tagente t1
|
||||
INNER JOIN tgrupo t2
|
||||
ON t2.id_grupo = t1.id_grupo
|
||||
WHERE (
|
||||
1 = (
|
||||
SELECT is_admin
|
||||
FROM tusuario
|
||||
WHERE id_user = '" . $config['id_user'] . "'
|
||||
)
|
||||
OR t1.id_grupo IN (
|
||||
" . implode(',', $id_userGroups) . "
|
||||
) OR 0 IN (
|
||||
SELECT id_grupo
|
||||
FROM tusuario_perfil
|
||||
WHERE id_usuario = '" . $config['id_user'] . "'
|
||||
AND id_perfil IN (
|
||||
SELECT id_perfil
|
||||
FROM tperfil WHERE agent_view = 1
|
||||
)
|
||||
)
|
||||
)
|
||||
AND (
|
||||
".$search_sql."
|
||||
)
|
||||
";
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
|
||||
INNER JOIN taddress_agent ON
|
||||
taddress.id_a = taddress_agent.id_a
|
||||
WHERE taddress.ip LIKE '%$stringSearchSQL%'";
|
||||
|
||||
$id = db_get_all_rows_sql($sql);
|
||||
if($id != ''){
|
||||
$aux = $id[0]['id_agent'];
|
||||
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%" . strtolower($stringSearchSQL) . "%%' OR
|
||||
t2.nombre COLLATE utf8_general_ci LIKE '%%" . strtolower($stringSearchSQL) . "%%' OR
|
||||
t1.id_agente = $aux";
|
||||
|
||||
if(count($id)>=2){
|
||||
for ($i = 1; $i < count($id); $i++){
|
||||
$aux = $id[$i]['id_agent'];
|
||||
$search_sql .= " OR t1.id_agente = $aux";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$search_sql = " lower(t1.nombre) LIKE '%%" . strtolower($stringSearchSQL) . "%%' OR
|
||||
lower(t2.nombre) LIKE '%%" . strtolower($stringSearchSQL) . "%%' OR
|
||||
lower(t1.direccion) LIKE '%%" . strtolower($stringSearchSQL) . "%%' OR
|
||||
lower(t1.alias) LIKE '%%" . strtolower($stringSearchSQL) . "%%'";
|
||||
}
|
||||
$sql = "
|
||||
FROM tagente t1
|
||||
INNER JOIN tgrupo t2
|
||||
ON t2.id_grupo = t1.id_grupo
|
||||
WHERE (
|
||||
1 = (
|
||||
SELECT is_admin
|
||||
FROM tusuario
|
||||
WHERE id_user = '" . $config['id_user'] . "'
|
||||
)
|
||||
OR t1.id_grupo IN (
|
||||
" . implode(',', $id_userGroups) . "
|
||||
) OR 0 IN (
|
||||
SELECT id_grupo
|
||||
FROM tusuario_perfil
|
||||
WHERE id_usuario = '" . $config['id_user'] . "'
|
||||
AND id_perfil IN (
|
||||
SELECT id_perfil
|
||||
FROM tperfil WHERE agent_view = 1
|
||||
)
|
||||
)
|
||||
)
|
||||
AND (
|
||||
".$search_sql."
|
||||
)
|
||||
";
|
||||
break;
|
||||
}
|
||||
else {
|
||||
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t1.direccion COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||
t1.alias COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%'";
|
||||
}
|
||||
$sql = "
|
||||
FROM tagente t1
|
||||
INNER JOIN tgrupo t2
|
||||
ON t2.id_grupo = t1.id_grupo
|
||||
WHERE (
|
||||
1 = (
|
||||
SELECT is_admin
|
||||
FROM tusuario
|
||||
WHERE id_user = '" . $config['id_user'] . "'
|
||||
)
|
||||
OR t1.id_grupo IN (
|
||||
" . implode(',', $id_userGroups) . "
|
||||
) OR 0 IN (
|
||||
SELECT id_grupo
|
||||
FROM tusuario_perfil
|
||||
WHERE id_usuario = '" . $config['id_user'] . "'
|
||||
AND id_perfil IN (
|
||||
SELECT id_perfil
|
||||
FROM tperfil WHERE agent_view = 1
|
||||
)
|
||||
)
|
||||
)
|
||||
AND (
|
||||
".$search_sql."
|
||||
)
|
||||
";
|
||||
|
||||
$select = "SELECT t1.id_agente, t1.ultimo_contacto, t1.nombre, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled, t1.alias";
|
||||
if ($only_count) {
|
||||
|
@ -235,25 +179,8 @@ if ($searchAgents) {
|
|||
|
||||
$query = $select . $sql;
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$query .= $limit;
|
||||
break;
|
||||
case "oracle":
|
||||
$set = array();
|
||||
$set['limit'] = $config['block_size'];
|
||||
|
||||
if ($only_count)
|
||||
$set['offset'] = 0;
|
||||
else
|
||||
$set['offset'] = (int) get_parameter('offset');
|
||||
|
||||
$query .= " ORDER BY " . $order['field'] . " " . $order['order'];
|
||||
$query = oracle_recode_query ($query, $set);
|
||||
break;
|
||||
}
|
||||
|
||||
$query .= $limit;
|
||||
|
||||
$agents = db_process_sql($query);
|
||||
if (empty($agents))
|
||||
$agents = array();
|
||||
|
|
|
@ -34,6 +34,7 @@ foreach ($arrayKeywords as $keyword) {
|
|||
array_push($temp, "%" . $keyword . "%");
|
||||
}
|
||||
$stringSearchSQL = implode(" ", $temp);
|
||||
$stringSearchSQL = str_replace('_', '\_', $stringSearchSQL);
|
||||
|
||||
if ($config['search_category'] == "all")
|
||||
$searchTab = "main";
|
||||
|
|
|
@ -18,7 +18,7 @@ echo "</span>
|
|||
<img class='modalclosex cerrar' src='".$config['homeurl']."/images/icono_cerrar.png'>
|
||||
</div>";
|
||||
|
||||
echo "<div style='overflow-y:scroll;height:550px;'>";
|
||||
echo "<div style='overflow-y:auto;height:400px;min-height:400px;max-height:400px;'>";
|
||||
echo get_pandora_error_for_header();
|
||||
echo "</div>";
|
||||
|
||||
|
@ -32,7 +32,8 @@ echo "<div class='modalokbutton cerrar'>
|
|||
<script>
|
||||
|
||||
$(".cerrar").click(function(){
|
||||
$("#alert_messages").dialog('close');
|
||||
$("#alert_messages").hide();
|
||||
$( "#opacidad" ).remove();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,7 @@
|
|||
# (c) Ártica ST 2014 <info@artica.es>
|
||||
# Module for network topology discovery.
|
||||
|
||||
package Recon::Base;
|
||||
package PandoraFMS::Recon::Base;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
@ -11,8 +11,8 @@ use lib '/usr/lib/perl5';
|
|||
|
||||
use NetAddr::IP;
|
||||
use POSIX qw/ceil/;
|
||||
use Recon::NmapParser;
|
||||
use Recon::Util;
|
||||
use PandoraFMS::Recon::NmapParser;
|
||||
use PandoraFMS::Recon::Util;
|
||||
use Socket qw/inet_aton/;
|
||||
|
||||
# Some useful OIDs.
|
||||
|
@ -1304,7 +1304,7 @@ sub traceroute_connectivity($$) {
|
|||
|
||||
# Perform a traceroute.
|
||||
my $nmap_args = '-nsP -PE --traceroute --max-retries '.$self->{'icmp_checks'}.' --host-timeout '.$self->{'icmp_timeout'}.'s -T'.$self->{'recon_timing_template'};
|
||||
my $np = Recon::NmapParser->new();
|
||||
my $np = PandoraFMS::Recon::NmapParser->new();
|
||||
eval {
|
||||
$np->parsescan($self->{'nmap'}, $nmap_args, ($host));
|
||||
};
|
|
@ -22,7 +22,7 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
package Recon::NmapParser;
|
||||
package PandoraFMS::Recon::NmapParser;
|
||||
|
||||
use strict;
|
||||
use XML::Twig;
|
|
@ -2,7 +2,7 @@
|
|||
# (c) Ártica ST 2016 <info@artica.es>
|
||||
# Utility functions for the network topology discovery modules.
|
||||
|
||||
package Recon::Util;
|
||||
package PandoraFMS::Recon::Util;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
|
@ -37,7 +37,7 @@ use PandoraFMS::DB;
|
|||
use PandoraFMS::Core;
|
||||
use PandoraFMS::ProducerConsumerServer;
|
||||
use PandoraFMS::GIS qw(get_reverse_geoip_sql get_reverse_geoip_file get_random_close_point);
|
||||
use Recon::Base;
|
||||
use PandoraFMS::Recon::Base;
|
||||
|
||||
# Patched Nmap::Parser. See http://search.cpan.org/dist/Nmap-Parser/.
|
||||
use PandoraFMS::NmapParser;
|
||||
|
@ -156,7 +156,7 @@ sub data_consumer ($$) {
|
|||
my @subnets = split(/,/, $task->{'subnet'});
|
||||
my @communities = split(/,/, $task->{'snmp_community'});
|
||||
|
||||
my $recon = new Recon::Base(
|
||||
my $recon = new PandoraFMS::Recon::Base(
|
||||
communities => \@communities,
|
||||
dbh => $dbh,
|
||||
group_id => $task->{'id_group'},
|
||||
|
@ -245,7 +245,7 @@ sub exec_recon_script ($$$) {
|
|||
##########################################################################
|
||||
# Guess the OS using xprobe2 or nmap.
|
||||
##########################################################################
|
||||
sub Recon::Base::guess_os($$) {
|
||||
sub PandoraFMS::Recon::Base::guess_os($$) {
|
||||
my ($self, $device) = @_;
|
||||
|
||||
# OS detection disabled. Use the device type.
|
||||
|
@ -276,7 +276,7 @@ sub Recon::Base::guess_os($$) {
|
|||
##############################################################################
|
||||
# Returns the number of open ports from the given list.
|
||||
##############################################################################
|
||||
sub Recon::Base::tcp_scan ($$) {
|
||||
sub PandoraFMS::Recon::Base::tcp_scan ($$) {
|
||||
my ($self, $host) = @_;
|
||||
|
||||
my $open_ports = `"$self->{pa_config}->{nmap}" -p$self->{recon_ports} $host | grep open | wc -l`;
|
||||
|
@ -286,7 +286,7 @@ sub Recon::Base::tcp_scan ($$) {
|
|||
##########################################################################
|
||||
# Create network profile modules for the given agent.
|
||||
##########################################################################
|
||||
sub Recon::Base::create_network_profile_modules($$$) {
|
||||
sub PandoraFMS::Recon::Base::create_network_profile_modules($$$) {
|
||||
my ($self, $agent_id, $device) = @_;
|
||||
|
||||
return unless ($self->{'id_network_profile'} > 0);
|
||||
|
@ -312,7 +312,7 @@ sub Recon::Base::create_network_profile_modules($$$) {
|
|||
##########################################################################
|
||||
# Connect the given devices in the Pandora FMS database.
|
||||
##########################################################################
|
||||
sub Recon::Base::connect_agents($$$$$) {
|
||||
sub PandoraFMS::Recon::Base::connect_agents($$$$$) {
|
||||
my ($self, $dev_1, $if_1, $dev_2, $if_2) = @_;
|
||||
|
||||
# Check switch connectivy.
|
||||
|
@ -363,7 +363,7 @@ sub Recon::Base::connect_agents($$$$$) {
|
|||
# Create an agent for the given device. Returns the ID of the new (or
|
||||
# existing) agent, undef on error.
|
||||
##########################################################################
|
||||
sub Recon::Base::create_agent($$) {
|
||||
sub PandoraFMS::Recon::Base::create_agent($$) {
|
||||
my ($self, $device) = @_;
|
||||
|
||||
my @agents = get_db_rows($self->{'dbh'},
|
||||
|
@ -461,13 +461,13 @@ sub Recon::Base::create_agent($$) {
|
|||
my $community = $self->get_community($device);
|
||||
return $agent_id unless defined($community);
|
||||
|
||||
my @output = $self->snmp_get_value_array($device, $Recon::Base::IFINDEX);
|
||||
my @output = $self->snmp_get_value_array($device, $PandoraFMS::Recon::Base::IFINDEX);
|
||||
foreach my $if_index (@output) {
|
||||
next unless ($if_index =~ /^[0-9]+$/);
|
||||
|
||||
# Check the status of the interface.
|
||||
if ($self->{'all_ifaces'} == 0) {
|
||||
my $if_status = $self->snmp_get_value($device, "$Recon::Base::IFOPERSTATUS.$if_index");
|
||||
my $if_status = $self->snmp_get_value($device, "$PandoraFMS::Recon::Base::IFOPERSTATUS.$if_index");
|
||||
next unless $if_status == 1;
|
||||
}
|
||||
|
||||
|
@ -477,7 +477,7 @@ sub Recon::Base::create_agent($$) {
|
|||
my $if_desc = ($mac ne '' ? "MAC $mac " : '') . ($ip ne '' ? "IP $ip" : '');
|
||||
|
||||
# Get the name of the network interface.
|
||||
my $if_name = $self->snmp_get_value($device, "$Recon::Base::IFNAME.$if_index");
|
||||
my $if_name = $self->snmp_get_value($device, "$PandoraFMS::Recon::Base::IFNAME.$if_index");
|
||||
$if_name = "if$if_index" unless defined ($if_name);
|
||||
$if_name =~ s/"//g;
|
||||
|
||||
|
@ -500,7 +500,7 @@ sub Recon::Base::create_agent($$) {
|
|||
'ip_target' => $device,
|
||||
'tcp_send' => 1,
|
||||
'snmp_community' => $community,
|
||||
'snmp_oid' => "$Recon::Base::IFOPERSTATUS.$if_index"
|
||||
'snmp_oid' => "$PandoraFMS::Recon::Base::IFOPERSTATUS.$if_index"
|
||||
);
|
||||
pandora_create_module_from_hash ($self->{'pa_config'}, \%module, $self->{'dbh'});
|
||||
} else {
|
||||
|
@ -523,7 +523,7 @@ sub Recon::Base::create_agent($$) {
|
|||
'ip_target' => $device,
|
||||
'tcp_send' => 1,
|
||||
'snmp_community' => $community,
|
||||
'snmp_oid' => "$Recon::Base::IFINOCTECTS.$if_index");
|
||||
'snmp_oid' => "$PandoraFMS::Recon::Base::IFINOCTECTS.$if_index");
|
||||
pandora_create_module_from_hash ($self->{'pa_config'}, \%module, $self->{'dbh'});
|
||||
} else {
|
||||
my %module = (
|
||||
|
@ -544,7 +544,7 @@ sub Recon::Base::create_agent($$) {
|
|||
'ip_target' => $device,
|
||||
'tcp_send' => 1,
|
||||
'snmp_community' => $community,
|
||||
'snmp_oid' => "$Recon::Base::IFOUTOCTECTS.$if_index");
|
||||
'snmp_oid' => "$PandoraFMS::Recon::Base::IFOUTOCTECTS.$if_index");
|
||||
pandora_create_module_from_hash ($self->{'pa_config'}, \%module, $self->{'dbh'});
|
||||
} else {
|
||||
my %module = (
|
||||
|
@ -561,7 +561,7 @@ sub Recon::Base::create_agent($$) {
|
|||
##########################################################################
|
||||
# Delete already existing connections.
|
||||
##########################################################################
|
||||
sub Recon::Base::delete_connections($) {
|
||||
sub PandoraFMS::Recon::Base::delete_connections($) {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->call('message', "Deleting connections...", 10);
|
||||
|
@ -571,7 +571,7 @@ sub Recon::Base::delete_connections($) {
|
|||
#######################################################################
|
||||
# Print log messages.
|
||||
#######################################################################
|
||||
sub Recon::Base::message($$$) {
|
||||
sub PandoraFMS::Recon::Base::message($$$) {
|
||||
my ($self, $message, $verbosity) = @_;
|
||||
|
||||
logger($self->{'pa_config'}, "[Recon task " . $self->{'task_id'} . "] $message", $verbosity);
|
||||
|
@ -580,7 +580,7 @@ sub Recon::Base::message($$$) {
|
|||
##########################################################################
|
||||
# Connect the given hosts to its parent.
|
||||
##########################################################################
|
||||
sub Recon::Base::set_parent($$$) {
|
||||
sub PandoraFMS::Recon::Base::set_parent($$$) {
|
||||
my ($self, $host, $parent) = @_;
|
||||
|
||||
return unless ($self->{'parent_detection'} == 1);
|
||||
|
@ -615,7 +615,7 @@ sub Recon::Base::set_parent($$$) {
|
|||
##########################################################################
|
||||
# Update recon task status.
|
||||
##########################################################################
|
||||
sub Recon::Base::update_progress ($$) {
|
||||
sub PandoraFMS::Recon::Base::update_progress ($$) {
|
||||
my ($self, $progress) = @_;
|
||||
|
||||
db_do ($self->{'dbh'}, 'UPDATE trecon_task SET utimestamp = ?, status = ? WHERE id_rt = ?', time (), $progress, $self->{'task_id'});
|
||||
|
|
Loading…
Reference in New Issue