diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index 292f0f801e..5e580ef1a3 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -270,10 +270,10 @@ vmware_dependencies=" \ execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies" # Instant client Oracle -oracle_dependencier=" \ +oracle_dependencies=" \ https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm \ https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm" -execute_cmd "yum install -y $vmware_dependencies" "Installing Oracle Instant client" +execute_cmd "yum install -y $oracle_dependencies" "Installing Oracle Instant client" # Disabling SELINUX and firewalld setenforce 0 diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 42200192b9..2630849da9 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.754-210506 +Version: 7.0NG.754-210507 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 472c9a3333..781e81f4e3 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.754-210506" +pandora_version="7.0NG.754-210507" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1e66f30de8..518185c093 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.754'; -use constant AGENT_BUILD => '210506'; +use constant AGENT_BUILD => '210507'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index b227006b34..40586c0508 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.754 -%define release 210506 +%define release 210507 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 8c824b369e..9b1013caeb 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.754 -%define release 210506 +%define release 210507 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index f0976bb83e..344dc88a15 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210506" +PI_BUILD="210507" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cbd3ff9976..c69a9adf9a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210506} +{210507} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index d8abbf4558..33c03caa6e 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.754(Build 210506)") +#define PANDORA_VERSION ("7.0NG.754(Build 210507)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index b74dd8a3f7..26de75bdde 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.754(Build 210506))" + VALUE "ProductVersion", "(7.0NG.754(Build 210507))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 31ef8ccfc5..4fa3fc5456 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.754-210506 +Version: 7.0NG.754-210507 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 47e688372b..740bad70d5 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.754-210506" +pandora_version="7.0NG.754-210507" package_pear=0 package_pandora=1 diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index bc8d247994..923a6c20aa 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -1006,7 +1006,7 @@ echo '
"; } else { - echo ""; + echo "
'; @@ -1147,7 +1147,7 @@ if ($step == 2) { '', true, '', - $is_central_policies_on_node | $disabled + ($is_central_policies_on_node | $disabled) ); $table->data[2][0] = __('Priority'); @@ -1162,7 +1162,7 @@ if ($step == 2) { false, false, '', - $is_central_policies_on_node | $disabled + ($is_central_policies_on_node | $disabled) ); if (defined('METACONSOLE')) { diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 046c8a9366..f806096ea9 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -585,133 +585,21 @@ if ($update_alert || $duplicate_alert) { // Duplicate alert snmp if ($duplicate_alert) { - $sql = sprintf( - 'insert into talert_snmp ( - id_alert, al_field1, al_field2, al_field3, - al_field4, al_field5, al_field6, al_field7, - al_field8, al_field9, al_field10, al_field11, - al_field12, al_field13, al_field14, al_field15, - al_field16, al_field17, al_field18, al_field19, - al_field20, description, alert_type, agent, custom_oid, - oid, time_threshold, times_fired, last_fired, - max_alerts, min_alerts, internal_counter, priority, - '.db_escape_key_identifier('_snmp_f1_').', - '.db_escape_key_identifier('_snmp_f2_').', - '.db_escape_key_identifier('_snmp_f3_').', - '.db_escape_key_identifier('_snmp_f4_').', - '.db_escape_key_identifier('_snmp_f5_').', - '.db_escape_key_identifier('_snmp_f6_').', - '.db_escape_key_identifier('_snmp_f7_').', - '.db_escape_key_identifier('_snmp_f8_').', - '.db_escape_key_identifier('_snmp_f9_').', - '.db_escape_key_identifier('_snmp_f10_').', - '.db_escape_key_identifier('_snmp_f11_').', - '.db_escape_key_identifier('_snmp_f12_').', - '.db_escape_key_identifier('_snmp_f13_').', - '.db_escape_key_identifier('_snmp_f14_').', - '.db_escape_key_identifier('_snmp_f15_').', - '.db_escape_key_identifier('_snmp_f16_').', - '.db_escape_key_identifier('_snmp_f17_').', - '.db_escape_key_identifier('_snmp_f18_').', - '.db_escape_key_identifier('_snmp_f19_').', - '.db_escape_key_identifier('_snmp_f20_').", - trap_type, single_value, position, disable_event, id_group, - order_1, order_2, order_3, order_4, order_5, order_6, order_7, order_8, - order_9, order_10, order_11, order_12, order_13, order_14, order_15, - order_16, order_17, order_18, order_19, order_20) - VALUES - (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', - '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, %d, '%s', '%s', '%s', - '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', - '%s', '%s', '%s', '%s', %d, '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, - %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", - $id_alert, - $al_field1, - $al_field2, - $al_field3, - $al_field4, - $al_field5, - $al_field6, - $al_field7, - $al_field8, - $al_field9, - $al_field10, - $al_field11, - $al_field12, - $al_field13, - $al_field14, - $al_field15, - $al_field16, - $al_field17, - $al_field18, - $al_field19, - $al_field20, - $description, - $alert_type, - $source_ip, - $custom_value, - $oid, - $time_threshold, - $times_fired, - $last_fired, - $max_alerts, - $min_alerts, - $internal_counter, - $priority, - $custom_oid_data_1, - $custom_oid_data_2, - $custom_oid_data_3, - $custom_oid_data_4, - $custom_oid_data_5, - $custom_oid_data_6, - $custom_oid_data_7, - $custom_oid_data_8, - $custom_oid_data_9, - $custom_oid_data_10, - $custom_oid_data_11, - $custom_oid_data_12, - $custom_oid_data_13, - $custom_oid_data_14, - $custom_oid_data_15, - $custom_oid_data_16, - $custom_oid_data_17, - $custom_oid_data_18, - $custom_oid_data_19, - $custom_oid_data_20, - $trap_type, - $single_value, - $position, - $disable_event, - $group, - $order_1, - $order_2, - $order_3, - $order_4, - $order_5, - $order_6, - $order_7, - $order_8, - $order_9, - $order_10, - $order_11, - $order_12, - $order_13, - $order_14, - $order_15, - $order_16, - $order_17, - $order_18, - $order_19, - $order_20 - ); - $result = db_process_sql($sql); + $values_duplicate = $alert; + if (!empty($values_duplicate)) { + unset($values_duplicate['id_as']); + $result = db_process_sql_insert('talert_snmp', $values_duplicate); - if (!$result) { + if (!$result) { + db_pandora_audit('SNMP management', "Fail try to duplicate snmp alert #$id_as"); + ui_print_error_message(__('There was a problem duplicating the alert')); + } else { + db_pandora_audit('SNMP management', "Duplicate snmp alert #$id_as"); + ui_print_success_message(__('Successfully Duplicate')); + } + } else { db_pandora_audit('SNMP management', "Fail try to duplicate snmp alert #$id_as"); ui_print_error_message(__('There was a problem duplicating the alert')); - } else { - db_pandora_audit('SNMP management', "Duplicate snmp alert #$id_as"); - ui_print_success_message(__('Successfully Duplicate')); } } diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 09c2e1af48..f2819b4e74 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -898,7 +898,7 @@ class HostDevices extends Wizard ], [ 'label' => ''.__('Networks (current)').':'.ui_print_help_tip( - __('Plese upload a new file to overwrite this content.'), + __('Please upload a new file to overwrite this content.'), true ), 'arguments' => [ diff --git a/pandora_console/include/class/AgentsAlerts.class.php b/pandora_console/include/class/AgentsAlerts.class.php index f566e3a4d9..c577842485 100644 --- a/pandora_console/include/class/AgentsAlerts.class.php +++ b/pandora_console/include/class/AgentsAlerts.class.php @@ -765,7 +765,7 @@ class AgentsAlerts extends HTML // Start Header form. $headerForm = [ - 'action' => ui_get_full_url(), + 'action' => ui_get_full_url('index.php?sec=view&sec2=extensions/agents_alerts'), 'id' => 'form-header-filters', 'method' => 'POST', 'class' => 'modal flex flex-row', diff --git a/pandora_console/include/class/ExternalTools.class.php b/pandora_console/include/class/ExternalTools.class.php index 403cd72fa6..30cd41067c 100644 --- a/pandora_console/include/class/ExternalTools.class.php +++ b/pandora_console/include/class/ExternalTools.class.php @@ -462,6 +462,12 @@ class ExternalTools extends HTML $ids[] = join(',', $address); } + // Must be an a IP at least for work. + if (empty($ids) === true) { + ui_print_message(__('The agent doesn`t have an IP yet'), 'error', true); + return; + } + $ips = db_get_all_rows_sql( sprintf( 'SELECT ip FROM taddress WHERE id_a IN (%s)', @@ -469,18 +475,6 @@ class ExternalTools extends HTML ) ); - // Must be an a IP at least for work. - if (empty($ips) === true) { - html_print_div( - [ - 'class' => 'error', - 'style' => 'margin-top:5px', - 'content' => __('The agent hasn\'t got IP'), - ] - ); - return; - } - // Make the data for show in table. $ipsSelect = array_reduce( $ips, diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 9f5a807037..dc0dca6df4 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1020,7 +1020,7 @@ class Tree $agent_search_filter = $this->getAgentSearchFilter(); $agent_status_filter = $this->getAgentStatusFilter(); $module_search_filter = $this->getModuleSearchFilter(); - $module_status_filter = $this->getModuleStatusFilter(); + $module_status_filter = $this->getModuleStatusFilterFromTestado($this->filter['statusModule']); $condition = $this->L2condition; $condition_inside = $this->L2conditionInside; diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 972e0b9657..53ba322f9f 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC210506'; +$build_version = 'PC210507'; $pandora_version = 'v7.0NG.754'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index d6cd569c91..bfa2733840 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -2755,7 +2755,7 @@ function alerts_ui_update_or_create_actions($update=true) $al_action = alerts_get_alert_action($id); if ($al_action !== false) { if ($al_action['id_group'] == 0) { - if (! check_acl($config['id_user'], 0, 'PM')) { + if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( 'ACL Violation', 'Trying to access Alert Management' diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index de094fabad..026af0da76 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -2121,9 +2121,9 @@ function api_get_all_agents($thrash1, $thrash2, $other, $returnType) } $ag_groups = implode(',', (array) $ag_groups); - } - $where .= ' AND (id_grupo IN ('.$ag_groups.') OR id_group IN ('.$ag_groups.'))'; + $where .= ' AND (id_grupo IN ('.$ag_groups.') OR id_group IN ('.$ag_groups.'))'; + } } if (isset($other['data'][3])) { @@ -11248,10 +11248,10 @@ function api_set_add_user_profile($id, $thrash1, $other, $thrash2) return; } - $group = $other['data'][0]; + $group = (int) $other['data'][0]; $profile = $other['data'][1]; - if (db_get_value('id_grupo', 'tgrupo', 'id_grupo', $group) === false) { + if ($group !== 0 && db_get_value('id_grupo', 'tgrupo', 'id_grupo', $group) === false) { returnError('There is not any group with the ID provided.'); return; } diff --git a/pandora_console/include/functions_io.php b/pandora_console/include/functions_io.php index cad1dbf91a..d22641d4c7 100755 --- a/pandora_console/include/functions_io.php +++ b/pandora_console/include/functions_io.php @@ -590,3 +590,32 @@ function io_output_password($password) return io_safe_output($plaintext); } + + +/** + * Clean html tags symbols for prevent use JS + * + * @param string $string String for safe. + * + * @return string + */ +function io_safe_html_tags(string $string) +{ + // Must have safe output for work properly. + $string = io_safe_output($string); + if (strpos($string, '<') !== false && strpos($string, '>') !== false) { + $output = strstr($string, '<', true); + $tmpOutput = strstr($string, '<'); + $output .= strstr(substr($tmpOutput, 1), '>', true); + $tmpOutput = strstr($string, '>'); + $output .= substr($tmpOutput, 1); + // If the string still contains tags symbols. + if (strpos($string, '<') !== false && strpos($string, '>') !== false) { + $output = io_safe_html_tags($output); + } + } else { + $output = $string; + } + + return $output; +} diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index 89aacde9c6..1896078e5d 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -1187,7 +1187,7 @@ function snmp_browser_create_modules_snmp( } } - $fail_modules = []; + $fail_modules = []; foreach ($targets_oids as $key => $target_oid) { $oid = snmp_browser_get_oid( @@ -1243,7 +1243,7 @@ function snmp_browser_create_modules_snmp( 'min' => 0, 'tcp_send' => $snmp_version, 'tcp_rcv' => '', - 'tcp_port' => 0, + 'tcp_port' => $target_port, 'snmp_oid' => $oid['numeric_oid'], 'snmp_community' => $community, 'id_module_group' => 3, diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 90a5a45ea1..2ff84de751 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -1609,6 +1609,7 @@ function paint_graph_status( svg .append("g") .attr("transform", "translate(100, 150)") + .attr("class", "invert_filter") .call(yAxis); //legend Normal text @@ -1623,6 +1624,7 @@ function paint_graph_status( .style("font-family", "arial") .style("font-weight", "bold") .style("font-size", "8pt") + .attr("class", "invert_filter") .html(legend_normal) .style("text-anchor", "first") .attr("width", 300) @@ -1649,6 +1651,7 @@ function paint_graph_status( .style("font-family", "arial") .style("font-weight", "bold") .style("font-size", "8pt") + .attr("class", "invert_filter") .html(legend_warning) .style("text-anchor", "first"); @@ -1673,6 +1676,7 @@ function paint_graph_status( .style("font-family", "arial") .style("font-weight", "bold") .style("font-size", "8pt") + .attr("class", "invert_filter") .html(legend_critical) .style("text-anchor", "first"); diff --git a/pandora_console/install.php b/pandora_console/install.php index 8323680a9d..d57b9b4c21 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
false, @@ -92,7 +94,7 @@ ui_print_page_header( // Read a message. if ($read_message) { $message_id = (int) get_parameter('id_message'); - if ($show_sent) { + if ((bool) $show_sent === true) { $message = messages_get_message_sent($message_id); } else { $message = messages_get_message($message_id); @@ -196,26 +198,36 @@ if ($read_message) { return; } -// Create message (destination user). -if (($new_msg) && (!empty($dst_user)) && (!$reply)) { - $return = messages_create_message( - $config['id_user'], - [$dst_user], - [], - $subject, - $message - ); +if ($send_mes === true) { + if (empty($dst_user) === true && empty($dst_group) === true) { + // The user or group must be selected for send the message. + ui_print_error_message(__('User or group must be selected.')); + } else { + // Create message (destination user). + $return = messages_create_message( + $config['id_user'], + [$dst_user], + [], + $subject, + $message + ); - $user_name = get_user_fullname($dst_user); - if (!$user_name) { - $user_name = $dst_user; + $user_name = get_user_fullname($dst_user); + if (empty($user_name) === true) { + $user_name = $dst_user; + } + + ui_print_result_message( + $return, + __('Message successfully sent to user %s', $user_name), + __('Error sending message to user %s', $user_name) + ); + + // If is a reply, is not necessary do more. + if ($replied === true) { + return; + } } - - ui_print_result_message( - $return, - __('Message successfully sent to user %s', $user_name), - __('Error sending message to user %s', $user_name) - ); } // Message creation form. @@ -230,11 +242,7 @@ $table->data = []; $table->data[0][0] = __('Sender'); -if (!empty($own_info['fullname'])) { - $table->data[0][1] = $own_info['fullname']; -} else { - $table->data[0][1] = $config['id_user']; -} +$table->data[0][1] = (empty($own_info['fullname']) === false) ? $own_info['fullname'] : $config['id_user']; $table->data[1][0] = __('Destination'); @@ -245,7 +253,7 @@ $is_admin = (bool) db_get_value( $config['id_user'] ); -if ($is_admin) { +if ($is_admin === true) { $users_full = db_get_all_rows_filter( 'tusuario', [], @@ -264,51 +272,58 @@ if ($is_admin) { $users = []; foreach ($users_full as $user_id => $user_info) { - $users[$user_info['id_user']] = $user_info['fullname']; + $users[$user_info['id_user']] = (empty($user_info['fullname']) === true) ? $user_info['id_user'] : $user_info['fullname']; } // Check if the user to reply is in the list, if not add reply user. -if ($reply) { - if (!array_key_exists($dst_user, $users)) { - // Add the user to reply. - $user_reply = db_get_row('tusuario', 'id_user', $dst_user); - $users[$user_reply['id_user']] = $user_reply['fullname']; - } -} - - -if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { - $return_all_groups = true; +if ($reply === true) { + $table->data[1][1] = (array_key_exists($dst_user, $users) === true) ? $users[$dst_user] : $dst_user; + $table->data[1][1] .= html_print_input_hidden( + 'dst_user', + $dst_user, + true + ); + $table->data[1][1] .= html_print_input_hidden( + 'replied', + '1', + true + ); } else { - $return_all_groups = false; -} + $return_all_groups = ((bool) $own_info['is_admin'] === true + || check_acl($config['id_user'], 0, 'PM') === true); -$groups = users_get_groups($config['id_user'], 'AR'); -// Get a list of all groups. -$table->data[1][1] = html_print_select( - $users, - 'dst_user', - $dst_user, - '', - __('Select user'), - false, - true, - false, - '', - false -); -$table->data[1][1] .= '  '.__('OR').'  '; -$table->data[1][1] .= '
'.html_print_select_groups( - $config['id_user'], - 'AR', - $return_all_groups, - 'dst_group', - $dst_group, - '', - __('Select group'), - '', - true -).'
'; + $groups = users_get_groups($config['id_user'], 'AR'); + // Get a list of all groups. + $table->data[1][1] = html_print_select( + $users, + 'dst_user', + $dst_user, + 'changeStatusOtherSelect(\'dst_user\', \'dst_group\')', + __('Select user'), + false, + true, + false, + '' + ); + $table->data[1][1] .= '  '.__('OR').'  '; + $table->data[1][1] .= html_print_div( + [ + 'class' => 'w250px inline', + 'content' => html_print_select_groups( + $config['id_user'], + 'AR', + $return_all_groups, + 'dst_group', + $dst_group, + 'changeStatusOtherSelect(\'dst_group\', \'dst_user\')', + __('Select group'), + '', + true + ), + ], + true + ); +} $table->data[2][0] = __('Subject'); $table->data[2][1] = html_print_input_text( @@ -330,15 +345,40 @@ $table->data[3][1] = html_print_textarea( true ); -echo '
'; -html_print_table($table); +$jsOutput = ''; +ob_start(); +?> + +width.'">'; - html_print_submit_button( - __('Send message'), - 'send_mes', - false, - 'class="sub wand"' - ); - echo '
'; - echo '
'; +echo '
'; +// Print the main table. +html_print_table($table); +// Print the action buttons section. +html_print_div( + [ + 'class' => 'action-buttons', + 'style' => 'width: '.$table->width, + 'content' => html_print_submit_button( + __('Send message'), + 'send_mes', + false, + 'class="sub wand"', + true + ), + ] +); + +echo '
'; +echo $jsOutput; \ No newline at end of file diff --git a/pandora_console/operation/snmpconsole/snmp_browser.php b/pandora_console/operation/snmpconsole/snmp_browser.php index 9b5a194410..dc2b373e82 100644 --- a/pandora_console/operation/snmpconsole/snmp_browser.php +++ b/pandora_console/operation/snmpconsole/snmp_browser.php @@ -141,6 +141,7 @@ function snmp_browser_show_add_module_massive(module_target = 'agent') { var title = ''; var snmp_extradata = snmp_browser_create_modules(module_target); + snmp_extradata.push({name:"target_port", value:$("#target_port").val()}); // Load dinamically modal form. load_modal({ form: 'snmp_browser_add_module_form', diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index 676e0085c6..93e1c18813 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -356,27 +356,33 @@ enterprise_hook('close_meta_frame'); if (data.success) { $(".loading_tree").hide(); var foundMessage = ''; - switch (parameters['type']) { - case 'policies': - foundMessage = ""; - break; - case 'os': - foundMessage = ""; - break; - case 'tag': - foundMessage = ""; - break; - case 'module_group': - foundMessage = ""; - break; - case 'module': - foundMessage = ""; - break; - case 'group': - default: - foundMessage = ""; - break; + if (data.tree.length === 0) { + foundMessage = ""; + $("div#tree-controller-recipient").append(foundMessage); + } else { + switch (parameters['type']) { + case 'policies': + foundMessage = ""; + break; + case 'os': + foundMessage = ""; + break; + case 'tag': + foundMessage = ""; + break; + case 'module_group': + foundMessage = ""; + break; + case 'module': + foundMessage = ""; + break; + case 'group': + default: + foundMessage = ""; + break; + } } + treeController.init({ recipient: $("div#tree-controller-recipient"), diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index c9ef8c7f57..f9e81b1656 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210506 +%define release 210507 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index b692e69efb..d6226ddaff 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210506 +%define release 210507 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index a0041c0056..6fa09ebf1f 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.754 -%define release 210506 +%define release 210507 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 3fb80f7859..6329c822c1 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.754-210506 +Version: 7.0NG.754-210507 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index 22453d8184..6e6378090e 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.754-210506" +pandora_version="7.0NG.754-210507" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index f873219bcc..a578e288c1 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -45,7 +45,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210506"; +my $pandora_build = "210507"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 95631effb5..31ec32907d 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.754"; -my $pandora_build = "210506"; +my $pandora_build = "210507"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 766bf7985a..3a9f99e1ad 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.754 -%define release 210506 +%define release 210507 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index eb976af8bf..3cc33a297f 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.754 -%define release 210506 +%define release 210507 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index bd1ce6011e..e5fdc92b71 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.754" -PI_BUILD="210506" +PI_BUILD="210507" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ca9bfdd131..e3dcddcdbd 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.754 PS210506"; +my $version = "7.0NG.754 PS210507"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a36c937a71..1f5d51370a 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.754 PS210506"; +my $version = "7.0NG.754 PS210507"; # save program name for logging my $progname = basename($0);