Merge remote-tracking branch 'origin/develop' into ent-8564-operaciones-masivas-metaconsola-edicion-de-agentes

This commit is contained in:
Daniel Barbero Martin 2022-07-21 10:58:37 +02:00
commit ac23665244
43 changed files with 370 additions and 137 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.763-220714
Version: 7.0NG.763-220721
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.763-220714"
pandora_version="7.0NG.763-220721"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
@ -61,7 +61,7 @@ chmod 755 -R temp_package/DEBIAN
#cp -aRf * temp_package/usr/share/pandora_agent/
#but don't copy recursive the temp_package into temp_package
for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v HP-UX | grep -v SunOS | grep -v temp_package`
for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v NetBSD | grep -v HP-UX | grep -v SunOS | grep -v Darwin | grep -v OpenWRT | grep -v pandorafms.agent_unix | grep -v temp_package`
do
#if [ \( $item != 'temp_package' \) -a \( $item != 'NT4' \) ]
#then
@ -133,9 +133,9 @@ echo "END"
echo "Make the package \"Pandorafms agent\"."
if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package
eval $DPKG_DEB --root-owner-group --build temp_package
else
dpkg-deb --build temp_package
dpkg-deb --root-owner-group --build temp_package
fi
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.763';
use constant AGENT_BUILD => '220714';
use constant AGENT_BUILD => '220721';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.763
%define release 220714
%define release 220721
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.763
%define release 220714
%define release 220721
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.763"
PI_BUILD="220714"
PI_BUILD="220721"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{220714}
{220721}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.763 Build 220714")
#define PANDORA_VERSION ("7.0NG.763 Build 220721")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.763(Build 220714))"
VALUE "ProductVersion", "(7.0NG.763(Build 220721))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1 +0,0 @@
/var/www/pandora_console/include/config.php

View File

@ -1,10 +1,10 @@
package: pandorafms-console
Version: 7.0NG.763-220714
Version: 7.0NG.763-220721
Architecture: all
Priority: optional
Section: admin
Installed-Size: 42112
Maintainer: Artica ST <deptec@artica.es>
Homepage: http://pandorafms.org/
Depends: php | php7.2, php7.2-snmp | php-snmp, php7.2-gd | php-gd, php7.2-mysqlnd | php-mysqlnd, php-db, php7.2-xmlrpc | php-xmlrpc, php-gettext, php7.2-curl | php-curl, graphviz, dbconfig-common, php7.2-ldap | php-ldap, mysql-client | virtual-mysql-client, php-xmlrpc, php7.2-zip | php-zip
Homepage: https://pandorafms.com/
Depends: php, php-snmp, php-gd, php-mysqlnd, php-db, php-xmlrpc, php-curl, graphviz, dbconfig-common, php-ldap, mysql-client | virtual-mysql-client, php-xmlrpc, php-zip, php-mbstring
Description: Pandora FMS is an Open Source monitoring tool. It monitor your systems and applications, and allows you to control the status of any element of them. The web console is the graphical user interface (GUI) to manage the pool and to generate reports and graphs from the Pandora FMS monitoring process.

View File

@ -1,6 +1,6 @@
#!/bin/bash
#Pandora FMS- http:#pandorafms.com
#Pandora FMS - https://pandorafms.com
# ==================================================
# Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
# Please see http:#pandorafms.org for full contribution list
@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.763-220714"
pandora_version="7.0NG.763-220721"
package_pear=0
package_pandora=1
@ -94,17 +94,19 @@ echo "Make a \"temp_package\" temporary dir for job."
mkdir -p temp_package
if [ $package_pandora -eq 1 ]
then
mkdir -p temp_package/var/www/pandora_console
mkdir -p temp_package/var/www/html/pandora_console
mkdir -p temp_package/var/log/pandora
mkdir -p temp_package/etc/logrotate.d
mkdir -p temp_package/etc/init.d
echo "Make directory system tree for package."
cp -R $(ls | grep -v temp_package | grep -v DEBIAN ) temp_package/var/www/pandora_console
cp -R $(ls | grep -v temp_package | grep -v DEBIAN | grep -v pandorafms.console_$pandora_version.deb) temp_package/var/www/html/pandora_console
cp -R DEBIAN temp_package
cp -aRf pandora_console_logrotate_ubuntu temp_package/etc/logrotate.d/pandora_console
find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf
rm -Rf temp_package/var/www/pandora_console/pandora_console.spec
cp -aRf pandora_websocket_engine temp_package/etc/init.d/
find temp_package/var/www/html/pandora_console -name ".svn" | xargs rm -Rf
rm -Rf temp_package/var/www/html/pandora_console/pandora_console.spec
chmod 755 -R temp_package/DEBIAN
touch temp_package/var/www/pandora_console/include/config.php
echo "Remove the SVN files and other temp files."
@ -128,30 +130,31 @@ then
echo "END"
echo "Calculate md5sum for md5sums package control file."
for item in `find temp_package`
FILES=`find temp_package`
while read item
do
echo -n "."
if [ ! -d $item ]
if [ ! -d "$item" ]
then
echo $item | grep "DEBIAN" > /dev/null
echo "$item" | grep "DEBIAN" > /dev/null
#last command success
if [ $? -eq 1 ]
then
md5=`md5sum $item | cut -d" " -f1`
md5=`md5sum "$item" | cut -d" " -f1`
#delete "temp_package" in the path
final_path=${item#temp_package}
echo $md5" "$final_path >> temp_package/DEBIAN/md5sums
fi
fi
done
done < <(echo "$FILES")
echo "END"
echo "Make the package \"Pandorafms console\"."
if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package
eval $DPKG_DEB --root-owner-group --build temp_package
else
dpkg-deb --build temp_package
dpkg-deb --root-owner-group --build temp_package
fi
mv temp_package.deb pandorafms.console_$pandora_version.deb
fi

View File

@ -1,20 +1,15 @@
#!/bin/bash
echo Change the user and group to /var/www/pandora_console.
chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/pandora_console
chgrp www-data /var/www/pandora_console -R
chown www-data /var/www/pandora_console -R
if [ -d /var/www/html ]; then mv /var/www/pandora_console /var/www/html/; fi
echo Change the user and group to /var/www/html/pandora_console.
chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/html/pandora_console
chgrp www-data /var/www/html/pandora_console -R
chown www-data /var/www/html/pandora_console -R
if [ -f /etc/init.d/apache2 ]; then
echo Restart the apache.
/etc/init.d/apache2 restart
fi
# Install pandora_websocket_engine service.
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
chmod +x /etc/init.d/pandora_websocket_engine
echo "You can now start the Pandora FMS Websocket service by executing"
echo " /etc/init.d/pandora_websocket_engine start"

View File

@ -925,7 +925,9 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
layout: '%M%nn%M:%S%nn%S',
labels: ['', '', '', '', '', '', ''],
onExpiry: function () {
dt_events.draw(false);
$("#table_events")
.DataTable()
.draw(false);
}
});
}

View File

@ -662,7 +662,7 @@ class DiscoveryTaskList extends HTML
$data[0] .= '\'';
if ($task['type'] == DISCOVERY_HOSTDEVICES) {
$title = __('Are you sure?');
$message = 'This action will rescan the target networks.';
$message = __('This action will rescan the target networks.');
$data[0] .= ', {title: \''.$title.'\', message: \''.$message.'\'}';
}

View File

@ -97,29 +97,27 @@ if ($get_comments === true) {
$eventsGrouped = [];
// Consider if the event is grouped.
$whereGrouped = '1=1';
if (isset($event['event_rep']) === true && $event['event_rep'] > 0) {
// Default grouped message filtering (evento and estado).
$whereGrouped = sprintf(
'`evento` = "%s" AND `estado` = "%s" AND `event_type` = "%s" ',
$event['evento'],
$event['estado'],
$event['event_type']
// Default grouped message filtering (evento and estado).
$whereGrouped = sprintf(
'`evento` = "%s" AND `estado` = "%s" AND `event_type` = "%s" ',
$event['evento'],
$event['estado'],
$event['event_type']
);
// If id_agente is reported, filter the messages by them as well.
if ((int) $event['id_agente'] > 0) {
$whereGrouped .= sprintf(
' AND `id_agente` = %d',
(int) $event['id_agente']
);
}
// If id_agente is reported, filter the messages by them as well.
if ((int) $event['id_agente'] > 0) {
$whereGrouped .= sprintf(
' AND `id_agente` = %d',
(int) $event['id_agente']
);
}
if ((int) $event['id_agentmodule'] > 0) {
$whereGrouped .= sprintf(
' AND `id_agentmodule` = %d',
(int) $event['id_agentmodule']
);
}
if ((int) $event['id_agentmodule'] > 0) {
$whereGrouped .= sprintf(
' AND `id_agentmodule` = %d',
(int) $event['id_agentmodule']
);
}
try {

View File

@ -2483,14 +2483,12 @@ class ConsoleSupervisor
SERVER_TYPE_ENTERPRISE_SATELLITE
)
);
$missed = 0;
if (is_array($server_version_list) === true) {
foreach ($server_version_list as $server) {
if (strpos(
$server['version'],
(string) floor($config['current_package'])
(string) floor((int) $config['current_package'])
) === false
) {
$missed++;

View File

@ -252,6 +252,7 @@ class TreeService extends Tree
protected function getProcessedServices()
{
$is_favourite = $this->getServiceFavouriteFilter();
$service_search = $this->getServiceNameSearchFilter();
if (users_can_manage_group_all('AR')) {
$groups_acl = '';
@ -259,6 +260,16 @@ class TreeService extends Tree
$groups_acl = 'AND ts.id_group IN ('.implode(',', $this->userGroupsArray).')';
}
$exclude_children = 'ts.id NOT IN (
SELECT DISTINCT id_service_child
FROM tservice_element
WHERE id_server_meta = 0
)';
if ($service_search !== '') {
$exclude_children = '1=1';
}
$sql = sprintf(
'SELECT
ts.id,
@ -277,15 +288,14 @@ class TreeService extends Tree
FROM tservice ts
LEFT JOIN tservice_element tse
ON tse.id_service = ts.id
WHERE ts.id NOT IN (
SELECT DISTINCT id_service_child
FROM tservice_element
WHERE id_server_meta = 0
)
WHERE %s
%s
%s
%s
GROUP BY ts.id',
$exclude_children,
$is_favourite,
$service_search,
$groups_acl
);
@ -722,6 +732,23 @@ class TreeService extends Tree
}
/**
* Retrieve SQL filter for current filter
*
* @return string SQL filter.
*/
protected function getServiceNameSearchFilter()
{
if (isset($this->filter['searchService']) === true
&& empty($this->filter['searchService']) === false
) {
return " AND (ts.name LIKE '%".$this->filter['searchService']."%' OR ts.description LIKE '%".$this->filter['searchService']."%')";
}
return '';
}
/**
* Overwrites partial functionality of general Tree.class.
*

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC220714';
$build_version = 'PC220721';
$pandora_version = 'v7.0NG.763';
// Do not overwrite default timezone set if defined.

View File

@ -5996,6 +5996,18 @@ function send_test_email(
}
/**
* Microtime float number.
*
* @return float
*/
function microtime_float()
{
list($usec, $sec) = explode(' ', microtime());
return ((float) $usec + (float) $sec);
}
/**
* Return array of ancestors of item, given array.
*

View File

@ -2199,9 +2199,9 @@ function events_create_event(
'id_usuario' => $id_user,
'id_grupo' => $id_group,
'estado' => $status,
'timestamp' => 'NOW()',
'timestamp' => date('Y-m-d H:i:s'),
'evento' => $event,
'utimestamp' => 'UNIX_TIMESTAMP(NOW())',
'utimestamp' => time(),
'event_type' => $event_type,
'id_agentmodule' => $id_agent_module,
'id_alert_am' => $id_aam,

View File

@ -1013,13 +1013,17 @@ function html_print_select(
if(count_shift_'.$id.' == 2 ){
if(shift_array_'.$id.'[0] <= shift_array_'.$id.'[1]) {
for (var i = shift_array_'.$id.'[0]; i <= shift_array_'.$id.'[1]; i++) {
var option_value = $("#'.$id.' option").eq(i).val();
options_selecteds_'.$id.'.push(option_value);
if ($("#'.$id.' option").eq(i).text().includes($(".select2-search__field").val()) == true) {
var option_value = $("#'.$id.' option").eq(i).val();
options_selecteds_'.$id.'.push(option_value);
}
}
} else {
for (var i = shift_array_'.$id.'[0]; i >= shift_array_'.$id.'[1]; i--) {
var option_value = $("#'.$id.' option").eq(i).val();
options_selecteds_'.$id.'.push(option_value);
if ($("#'.$id.' option").eq(i).text().includes($(".select2-search__field").val()) == true) {
var option_value = $("#'.$id.' option").eq(i).val();
options_selecteds_'.$id.'.push(option_value);
}
}
}
@ -6134,3 +6138,36 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
return $output;
}
/**
* Prints a simple 'Go Back' button.
*
* @param string $url Destination Url.
* @param array $options Options.
* `button_class`: Class for button. 'w100p' by default.
* `title`: Title of the button. 'Go Back' by default.
* `action_class`: Class of icon of button. 'cancel' by default.
* @param boolean $return If true, return a formed HTML element.
*
* @return mixed
*/
function html_print_go_back_button(string $url, array $options=[], bool $return=false)
{
$output = html_print_div(
[
'class' => ($options['button_class'] ?? 'w100p'),
'content' => html_print_button(
($options['title'] ?? __('Go back')),
'go_back',
false,
'window.location.href = \''.$url.'\'',
'class="sub '.($options['action_class'] ?? ' cancel').' right"',
true
),
],
$return
);
return $output;
}

View File

@ -11121,7 +11121,7 @@ function reporting_get_group_stats($id_group=0, $access='AR', $recursion=true)
*
* @return array Group statistics
*/
function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_permissions=false)
function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_permissions=false, $recursive=false)
{
global $config;
@ -11165,6 +11165,8 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_per
$id_group = array_keys(
users_get_groups($config['id_user'], $access, false)
);
} else if ($recursive === true) {
$id_group = groups_get_children_ids($id_group);
}
// -----------------------------------------------------------------
@ -11295,7 +11297,7 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_per
$group_stat = db_get_all_rows_sql($sql);
$data = [
'monitor_checks' => (int) $group_stat[0]['modules'],
'monitor_alerts' => (int) groups_monitor_alerts($group_array),
'monitor_alerts' => (int) groups_monitor_alerts($group_stat[0]['id_group']),
'monitor_alerts_fired' => (int) $group_stat[0]['alerts_fired'],
'monitor_alerts_fire_count' => (int) $group_stat[0]['alerts_fired'],
'monitor_ok' => (int) $group_stat[0]['normal'],
@ -11309,10 +11311,33 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_per
'agent_warning' => (int) $group_stat[0]['agents_warnings'],
'agent_critical' => (int) $group_stat[0]['agents_critical'],
'total_checks' => (int) $group_stat[0]['modules'],
'total_alerts' => (int) groups_monitor_alerts($group_array),
'total_alerts' => (int) groups_monitor_alerts($group_stat[0]['id_group']),
'total_agents' => (int) $group_stat[0]['agents'],
'utimestamp' => (int) $group_stat[0]['utimestamp'],
];
if ($recursive === true) {
unset($group_stat[0]);
foreach ($group_stat as $value) {
$data['monitor_checks'] = ($data['monitor_checks'] + $value['modules']);
$data['monitor_alerts'] = ($data['monitor_alerts'] + groups_monitor_alerts($value['id_group']));
$data['monitor_alerts_fired'] = ($data['monitor_alerts_fired'] + $value['alerts_fired']);
$data['monitor_alerts_fire_count'] = ($data['monitor_alerts_fire_count'] + $value['alerts_fired']);
$data['monitor_ok'] = ($data['monitor_ok'] + $value['normal']);
$data['monitor_warning'] = ($data['monitor_warning'] + $value['warning']);
$data['monitor_critical'] = ($data['monitor_critical'] + $value['critical']);
$data['monitor_unknown'] = ($data['monitor_unknown'] + $value['unknown']);
$data['monitor_not_init'] = ($data['monitor_not_init'] + $value['non-init']);
$data['agent_not_init'] = ($data['agent_not_init'] + $value['agents_not_init']);
$data['agent_unknown'] = ($data['agent_unknown'] + $value['agents_unknown']);
$data['agent_ok'] = ($data['agent_ok'] + $value['agents_normal']);
$data['agent_warning'] = ($data['agent_warning'] + $value['agents_warnings']);
$data['agent_critical'] = ($data['agent_critical'] + $value['agents_critical']);
$data['total_checks'] = ($data['total_checks'] + $value['modules']);
$data['total_alerts'] = ($data['total_alerts'] + groups_monitor_alerts($value['id_group']));
$data['total_agents'] = ($data['total_agents'] + $value['agents']);
}
}
}
}

View File

@ -3416,7 +3416,17 @@ function ui_print_datatable(array $parameters)
}
// Languages.
$processing = __('Processing');
$processing = '<div class=\'processing-datatables-inside\'>';
$processing .= '<i>'.__('Processing').'</i> ';
$processing .= str_replace(
'"',
"'",
html_print_image(
'images/spinner.gif',
true
)
);
$processing .= '</div>';
// Extra html.
$extra = '';
@ -3524,6 +3534,10 @@ function ui_print_datatable(array $parameters)
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
type: "POST",
dataSrc: function (json) {
if($("#'.$form_id.'_search_bt") != undefined) {
$("#'.$form_id.'_loading").remove();
}
if (json.error) {
console.error(json.error);
$("#error-'.$table_id.'").html(json.error);
@ -3570,6 +3584,18 @@ function ui_print_datatable(array $parameters)
}
},
data: function (data) {
if($("#'.$form_id.'_search_bt") != undefined) {
var loading = \''.html_print_image(
'images/spinner.gif',
true,
[
'id' => $form_id.'_loading',
'class' => 'loading-search-datatables-button',
]
).'\';
$("#'.$form_id.'_search_bt").parent().append(loading);
}
inputs = $("#'.$form_id.' :input");
values = {};

View File

@ -193,6 +193,10 @@ class GroupsStatusWidget extends Widget
$values['groupId'] = $decoder['groupId'];
}
if (isset($decoder['groupRecursion']) === true) {
$values['groupRecursion'] = $decoder['groupRecursion'];
}
return $values;
}
@ -224,6 +228,16 @@ class GroupsStatusWidget extends Widget
],
];
$inputs[] = [
'label' => __('Group recursion'),
'arguments' => [
'name' => 'groupRecursion',
'id' => 'groupRecursion',
'type' => 'switch',
'value' => $values['groupRecursion'],
],
];
return $inputs;
}
@ -239,6 +253,7 @@ class GroupsStatusWidget extends Widget
$values = parent::getPost();
$values['groupId'] = \get_parameter('groupId', 0);
$values['groupRecursion'] = \get_parameter_switch('groupRecursion', 0);
return $values;
}
@ -260,9 +275,12 @@ class GroupsStatusWidget extends Widget
$output = '';
$user_groups = \users_get_groups(false, 'AR', false);
$stats = \reporting_get_group_stats_resume($this->values['groupId'], 'AR', true);
$stats = \reporting_get_group_stats_resume(
$this->values['groupId'],
'AR',
true,
(bool) $this->values['groupRecursion']
);
$data = '<div class="widget-groups-status"><span>';
$data .= ui_print_group_icon(
@ -393,7 +411,7 @@ class GroupsStatusWidget extends Widget
$table->data[0][0] .= '</span>';
$table->data[0][1] = '<span>';
$table->data[0][1] .= '<b>';
$table->data[0][1] .= $stats['monitor_total'];
$table->data[0][1] .= $stats['total_checks'];
$table->data[0][1] .= '</b>';
$table->data[0][1] .= '</span>';

View File

@ -9078,3 +9078,33 @@ div#err_msg_centralised {
margin-bottom: 4px !important;
padding: 2px 5px !important;
}
.dataTables_wrapper {
overflow: auto;
}
.dataTables_wrapper .dataTables_processing {
margin-top: -37px !important;
top: 50px !important;
padding-top: 0px !important;
height: 0px !important;
background: transparent !important;
}
.dataTables_wrapper .dataTables_processing .processing-datatables-inside {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 100%;
}
.dataTables_wrapper .dataTables_processing .processing-datatables-inside img {
margin-left: 20px;
}
.loading-search-datatables-button {
float: right;
margin-right: -110px;
margin-top: 13px;
}

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.763';
$build = '220714';
$build = '220721';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -182,24 +182,47 @@ class User
$password = $system->getRequest('password', null);
}
if (!empty($user) && !empty($password)) {
$user_in_db = process_user_login($user, $password);
if ($user_in_db !== false) {
$this->logged = true;
$this->user = $user_in_db;
$this->loginTime = time();
$this->errorLogin = false;
if (empty($user) === false
&& empty($password) === false
) {
$user_in_db = db_get_row_filter(
'tusuario',
['id_user' => $user],
'*'
);
// The user login was successful, but the second step is not completed
if ($this->isDobleAuthRequired()) {
$this->needDoubleAuth = true;
}
} else {
$this->logged = false;
$this->logged = false;
$this->loginTime = false;
$this->errorLogin = true;
$this->needDoubleAuth = false;
$this->errorDoubleAuth = false;
if ($user_in_db !== false) {
if (((bool) $user_in_db['is_admin'] === false)
&& ((bool) $user_in_db['not_login'] === true
|| (is_metaconsole() === false
&& has_metaconsole() === true
&& is_management_allowed() === false
&& (bool) $user_in_db['metaconsole_access_node'] === false))
) {
$this->logged = false;
$this->loginTime = false;
$this->errorLogin = true;
$this->needDoubleAuth = false;
$this->errorDoubleAuth = false;
} else {
$user_proccess_login = process_user_login($user, $password);
if ($user_proccess_login !== false) {
$this->logged = true;
$this->user = $user_proccess_login;
$this->loginTime = time();
$this->errorLogin = false;
// The user login was successful, but the second step is not completed.
if ($this->isDobleAuthRequired()) {
$this->needDoubleAuth = true;
}
}
}
}
}

View File

@ -193,15 +193,23 @@ switch ($action) {
if ($user->isWaitingDoubleAuth()) {
if ($user->validateDoubleAuthCode()) {
// Logged. Refresh the page
header('Location: .');
$url = ui_get_full_url('');
$url = str_replace("\n", '', $url);
$url = str_replace('?action=logout', '', $url);
// Logged. Refresh the page.
header('Location: '.$url);
return;
} else {
$user->showDoubleAuthPage();
}
} else {
// Logged. Refresh the page
header('Location: .');
$url = ui_get_full_url('');
$url = str_replace("\n", '', $url);
$url = str_replace('?action=logout', '', $url);
// Logged. Refresh the page.
header('Location: '.$url);
return;
}
} else {
@ -294,6 +302,42 @@ switch ($action) {
$_GET['id'] = $id_map;
break;
case 'External link':
$full_url = ui_get_full_url();
$section_data = io_safe_output($section_data);
$host_full = parse_url($full_url, PHP_URL_HOST);
$host_section = parse_url($section_data, PHP_URL_HOST);
if ($host_full !== $host_section) {
$has_mobile = strpos($section_data, 'mobile');
if ($has_mobile === false) {
$pos = strpos($section_data, '/index');
if ($pos !== false) {
$section_data = substr_replace($section_data, '/mobile', $pos, 0);
}
}
echo '<script type="text/javascript">document.location="'.$section_data.'"</script>';
} else {
if (strpos($full_url, 'event') !== false) {
$page = 'events';
}
if (strpos($full_url, 'alert') !== false) {
$page = 'alerts';
}
if (strpos($full_url, 'tactical') !== false) {
$page = 'tactical';
}
if (strpos($full_url, 'visual_console') !== false) {
$page = 'visualmap';
}
}
break;
case 'Group view':
default:
// No content.

View File

@ -363,12 +363,6 @@ class Agent
$events = new Events();
$events->addJavascriptDialog();
$options = $events->get_event_dialog_options();
$ui->addDialog($options);
$options = $events->get_event_dialog_error_options($options);
$ui->addDialog($options);
$ui->contentAddHtml("<a id='detail_event_dialog_hook' href='#detail_event_dialog' class='invisible'>detail_event_hook</a>");
$ui->contentAddHtml("<a id='detail_event_dialog_error_hook' href='#detail_event_dialog_error' class='invisible'>detail_event_dialog_error_hook</a>");

View File

@ -482,21 +482,23 @@ if (is_ajax() === true) {
$tmp->b64 = base64_encode(json_encode($tmp));
// Show comments events.
$tmp->user_comment = $tmp->comments;
if ($tmp->comments !== 'undefined' && strlen($tmp->comments) > 80) {
$tmp->user_comment .= '&nbsp;&nbsp;';
$tmp->user_comment .= '<a id="show_comments" href="javascript:" onclick="show_event_dialog(\'';
$tmp->user_comment .= $tmp->b64;
$tmp->user_comment .= '\',\'comments\')>;';
$tmp->user_comment .= html_print_image(
'images/operation.png',
true,
[
'title' => __('Show more'),
'class' => 'invert_filter',
]
);
$tmp->user_comment .= '</a>';
if (empty($tmp->comments) === false) {
$tmp->user_comment = $tmp->comments;
if ($tmp->comments !== 'undefined' && strlen($tmp->comments) > 80) {
$tmp->user_comment .= '&nbsp;&nbsp;';
$tmp->user_comment .= '<a id="show_comments" href="javascript:" onclick="show_event_dialog(\'';
$tmp->user_comment .= $tmp->b64;
$tmp->user_comment .= '\',\'comments\')>;';
$tmp->user_comment .= html_print_image(
'images/operation.png',
true,
[
'title' => __('Show more'),
'class' => 'invert_filter',
]
);
$tmp->user_comment .= '</a>';
}
}
// Grouped events.

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.763
%define release 220714
%define release 220721
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.763
%define release 220714
%define release 220721
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.763
%define release 220714
%define release 220721
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.763-220714
Version: 7.0NG.763-220721
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.763-220714"
pandora_version="7.0NG.763-220721"
package_cpan=0
package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.763";
my $pandora_build = "220714";
my $pandora_build = "220721";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.763";
my $pandora_build = "220714";
my $pandora_build = "220721";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.763
%define release 220714
%define release 220721
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.763
%define release 220714
%define release 220721
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.763"
PI_BUILD="220714"
PI_BUILD="220721"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.763 Build 220714";
my $version = "7.0NG.763 Build 220721";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.763 Build 220714";
my $version = "7.0NG.763 Build 220721";
# save program name for logging
my $progname = basename($0);