Merge remote-tracking branch 'origin' into ent-9034-Alert-SNMP-como-agent-name-vista-tactica

This commit is contained in:
José González 2022-06-21 14:47:28 +02:00
commit b2b64ae014
129 changed files with 104438 additions and 79993 deletions

View File

@ -4,7 +4,7 @@
# define variables
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2021100601'
S_VERSION='2022052301'
LOGFILE="/tmp/pandora-agent-deploy-$(date +%F).log"
# Ansi color code variables
@ -49,7 +49,6 @@ check_cmd_status () {
}
check_repo_connection () {
execute_cmd "ping -c 2 8.8.8.8" "Checking internet connection"
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo"
}
@ -79,10 +78,15 @@ echo "Starting PandoraFMS Agent deployment ver. $S_VERSION"
execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP'
#Detect OS
os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"')
execute_cmd "echo $os_name" "OS detected: ${os_name}"
# Check OS.
OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release | cut -d '=' -f2 | tr -d '"' || grep ^ID= /etc/os-release | cut -d '=' -f2 | tr -d '"')
[[ $OS =~ 'rhel' ]] && OS_RELEASE=$OS
[[ $OS =~ 'fedora' ]] && OS_RELEASE=$OS
[[ $OS =~ 'debian' ]] && OS_RELEASE=$OS
#[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS
#[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS
@ -113,17 +117,40 @@ execute_cmd "cd $HOME/pandora_deploy_tmp" "Moving to workspace: $HOME/pandora_d
# Downloading and installing packages
if [[ $OS_RELEASE =~ 'rhel' ]]; then
yum install -y perl wget curl perl-Sys-Syslog unzip &>> $LOGFILE
echo -e "${cyan}Instaling agent dependencies...${reset}" ${green}OK${reset}
if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
## Extra steps on redhat
if [ "$(grep -Ei 'Red Hat Enterprise' /etc/redhat-release)" ]; then
## In case REDHAT
# Check susbscription manager status:
echo -en "${cyan}Checking Red Hat Enterprise subscription... ${reset}"
subscription-manager list &>> "$LOGFILE"
subscription-manager status &>> "$LOGFILE"
check_cmd_status 'Error checking subscription status, make sure your server is activated and suscribed to Red Hat Enterprise repositories'
fi
# Check rh version
if [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] ; then
package_manager_cmd=dnf
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '7' ] ; then
package_manager_cmd=yum
fi
# Install dependencies
$package_manager_cmd install -y perl wget curl perl-Sys-Syslog unzip &>> $LOGFILE
echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset}
yum install -y http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm &>> $LOGFILE
echo -e "${cyan}Instaling Pandora FMS agent...${reset}" ${green}OK${reset}
# Insatall pandora agent
$package_manager_cmd install -y http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm &>> $LOGFILE
echo -en "${cyan}Installing Pandora FMS agent...${reset}"
check_cmd_status 'Error installing Pandora FMS agent'
fi
if [[ $OS_RELEASE == 'debian' ]]; then
execute_cmd "apt update" 'Updating repos'
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Instaling agent dependencies'
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
execute_cmd 'wget http://firefly.artica.es/pandorafms/latest/Debian_Ubuntu/pandorafms.agent_unix_7.0NG.deb' 'Downloading Pandora FMS agent dependencies'
execute_cmd 'apt install -y ./pandorafms.agent_unix_7.0NG.deb' 'Installing Pandora FMS agent'
fi

View File

@ -11,7 +11,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2022020801'
S_VERSION='2022050901'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
@ -82,7 +82,6 @@ check_pre_pandora () {
}
check_repo_connection () {
execute_cmd "ping -c 2 8.8.8.8" "Checking internet connection"
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo"
execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo"
}
@ -257,6 +256,8 @@ console_dependencies=" \
poppler-data \
php-yaml \
mod_ssl \
libzstd \
openldap-clients \
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
@ -422,7 +423,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_unix-7.0NG.noarch.rpm ${PANDORA
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
# Copy gotty utility
execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'

View File

@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2022050501'
S_VERSION='2022052501'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
@ -86,7 +86,6 @@ check_pre_pandora () {
}
check_repo_connection () {
execute_cmd "ping -c 2 8.8.8.8" "Checking internet connection"
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo"
execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo"
}
@ -308,6 +307,8 @@ console_dependencies=" \
poppler-data \
php-yaml \
mod_ssl \
libzstd \
openldap-clients \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
@ -420,7 +421,9 @@ echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST
check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support."
echo "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -uroot -P$DBPORT -h$DBHOST
echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -uroot -P$DBPORT -h$DBHOST
export MYSQL_PWD=$DBPASS
#Generating my.cnf
@ -495,7 +498,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_unix-7.0NG.noarch.rpm ${PANDORA
execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages"
# Copy gotty utility
execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.762-220526
Version: 7.0NG.762-220621
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.762-220526"
pandora_version="7.0NG.762-220621"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.762';
use constant AGENT_BUILD => '220526';
use constant AGENT_BUILD => '220621';
# 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.762
%define release 220526
%define release 220621
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.762"
PI_BUILD="220526"
PI_BUILD="220621"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{220526}
{220621}
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.762 Build 220526")
#define PANDORA_VERSION ("7.0NG.762 Build 220621")
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.762(Build 220526))"
VALUE "ProductVersion", "(7.0NG.762(Build 220621))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.762-220526
Version: 7.0NG.762-220621
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.762-220526"
pandora_version="7.0NG.762-220621"
package_pear=0
package_pandora=1

View File

@ -1665,3 +1665,4 @@ godmode/um_client/vendor/sebastian/object-enumerator/tests
godmode/um_client/vendor/sebastian/object-enumerator
godmode/um_client/vendor/sebastian
godmode/um_client/vendor
/update_manager_client/resources/styles/pandora.css

View File

@ -0,0 +1,54 @@
START TRANSACTION;
ALTER TABLE `tuser_double_auth` DROP FOREIGN KEY `tuser_double_auth_ibfk_1`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
ALTER TABLE `tnotification_user` DROP FOREIGN KEY `tnotification_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
ALTER TABLE `tnotification_source_user` DROP FOREIGN KEY `tnotification_source_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
ALTER TABLE `tnotification_source_group_user` DROP FOREIGN KEY `tnotification_source_group_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
ALTER TABLE `tvisual_console_elements_cache` DROP FOREIGN KEY `tvisual_console_elements_cache_ibfk_3`, MODIFY COLUMN `user_id` VARCHAR(255) DEFAULT NULL;
ALTER TABLE `tusuario` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `tuser_double_auth` ADD CONSTRAINT `tuser_double_auth_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE;
ALTER TABLE `tnotification_user` ADD CONSTRAINT `tnotification_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tnotification_source_user` ADD CONSTRAINT `tnotification_source_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tnotification_source_group_user` ADD CONSTRAINT `tnotification_source_group_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tvisual_console_elements_cache` ADD CONSTRAINT `tvisual_console_elements_cache_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tattachment` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `tevento` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `tincidencia` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `tnota` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `tsesion` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `ttrap` MODIFY COLUMN `id_usuario` VARCHAR(255) DEFAULT '';
ALTER TABLE `tusuario_perfil` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `treset_pass_history` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
ALTER TABLE `tmensajes` MODIFY COLUMN `id_usuario_origen` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `tgraph` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `treport` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `tplanned_downtime` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `tnetwork_map` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
ALTER TABLE `tpassword_history` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
ALTER TABLE `tupdate_journal` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `tmap` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `tdashboard` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `treport_template` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `tmetaconsole_event` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `tmetaconsole_event_history` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `treset_pass` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `tuser_task_scheduled` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
ALTER TABLE `tbackup` MODIFY COLUMN `id_user` VARCHAR(255) DEFAULT '';
ALTER TABLE `tservice` ADD COLUMN `enable_sunburst` tinyint(1) NOT NULL default 0;
ALTER TABLE `tdashboard` MODIFY `name` TEXT NOT NULL DEFAULT '';
ALTER TABLE `tagente` ADD COLUMN `satellite_server` INT NOT NULL default 0;
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `satellite_server` INT NOT NULL default 0;
SET @st_oum763 = (SELECT IF(
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tautoconfig' AND table_schema = DATABASE() AND column_name = 'disabled') > 0,
"SELECT 1",
"ALTER TABLE `tautoconfig` ADD COLUMN `disabled` TINYINT DEFAULT 0"
));
PREPARE pr_oum763 FROM @st_oum763;
EXECUTE pr_oum763;
DEALLOCATE PREPARE pr_oum763;
COMMIT;

View File

@ -37,7 +37,7 @@ ui_require_css_file('first_task');
ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clusters defined yet.') ]);
?>
<div class="new_task_cluster">
<div class="new_task">
<div class="image_task_cluster">
<?php echo html_print_image('images/first_task/slave-mode.png', true, ['title' => __('Clusters')]); ?>
</div>

View File

@ -954,7 +954,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
$("a.autorefresh").click (function () {
$("a.autorefresh_txt").toggle ();
$("#combo_refr").toggle ();
$("#combo_refr").toggle();
$("select#ref").change (function () {
href = $("a.autorefresh").attr ("href");

View File

@ -26,6 +26,8 @@
* ============================================================================
*/
use function PHPSTORM_META\map;
// Begin.
if (isset($config['id_user']) === false) {
include 'general/login_page.php';
@ -57,52 +59,22 @@ if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_men
// Start of full lateral menu.
echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
if (defined('PANDORA_ENTERPRISE') === false) {
$logo_title = get_product_name().' Opensource';
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
} else {
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
}
$logo_title = get_product_name().' Enterprise';
}
echo '<div class="logo_green"><a href="index.php?sec=main">';
if (isset($config['custom_logo']) === true) {
echo html_print_image(
$custom_logo,
true,
[
'border' => '0',
'width' => '215',
'alt' => $logo_title,
'class' => 'logo_full',
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
]
);
}
if (isset($config['custom_logo_collapsed']) === true) {
echo html_print_image(
$custom_logo_collapsed,
true,
[
'border' => '0',
'width' => '60',
'alt' => $logo_title,
'class' => 'logo_icon',
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
]
);
}
echo '</a></div>';
// Header logo.
html_print_div(
[
'class' => 'logo_green',
'content' => html_print_anchor(
[
'href' => ui_get_full_url('index.php'),
'content' => html_print_header_logo_image(
$menuCollapsed,
true
),
],
true
),
]
);
require 'operation/menu.php';
require 'godmode/menu.php';

View File

@ -245,8 +245,11 @@ if (!$new_agent && $alias != '') {
}
// Remote configuration available.
$remote_agent = false;
if (isset($filename)) {
if (file_exists($filename['md5'])) {
$remote_agent = true;
$agent_name = agents_get_name($id_agente);
$agent_name = io_safe_output($agent_name);
$agent_md5 = md5($agent_name, false);
@ -427,6 +430,42 @@ $table_server .= html_print_select(
true
).'<div class="label_select_child_icons"></div></div></div>';
$table_satellite = '';
if ($remote_agent === true) {
// Satellite server selector.
$satellite_servers = db_get_all_rows_filter(
'tserver',
['server_type' => SERVER_TYPE_ENTERPRISE_SATELLITE],
[
'id_server',
'name',
]
);
$satellite_names = [];
if (empty($satellite_servers) === false) {
foreach ($satellite_servers as $s_server) {
$satellite_names[$s_server['id_server']] = $s_server['name'];
}
$table_satellite = '<div class="label_select"><p class="input_label">'.__('Satellite').'</p>';
$table_satellite .= '<div class="label_select_parent">';
$table_satellite .= html_print_input(
[
'type' => 'select',
'fields' => $satellite_names,
'name' => 'satellite_server',
'selected' => $satellite_server,
'nothing' => __('None'),
'nothinf_value' => 0,
'return' => true,
]
).'<div class="label_select_child_icons"></div></div></div>';
}
}
// Description.
$table_description = '<div class="label_select"><p class="input_label">'.__('Description').'</p>';
$table_description .= html_print_textarea(
@ -443,7 +482,7 @@ $table_description .= html_print_textarea(
echo '<div class="first_row">
<div class="box-shadow agent_options '.$agent_options_update.' white_box">
<div class="agent_options_column_left">'.$table_agent_name.$table_alias.$table_ip.$table_primary_group.'</div>
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_description.'</div>
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_satellite.$table_description.'</div>
</div>';
if (!$new_agent && $alias != '') {
echo $table_qr_code;
@ -523,7 +562,6 @@ if (enterprise_installed()) {
$table_adv_cascade .= $cps_html;
}
$table_adv_parent = '<div class="label_select"><label class="input_label">'.__('Parent').'</label>';
$params = [];
$params['return'] = true;
@ -536,6 +574,11 @@ $params['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
$params['selectbox_id'] = 'cascade_protection_module';
$params['javascript_is_function_select'] = true;
$params['cascade_protection'] = true;
if ($id_agente !== 0) {
// Deletes the agent's offspring.
$params['delete_offspring_agents'] = $id_agente;
}
$table_adv_parent .= '<div class="label_simple_items">';
$table_adv_parent .= ui_print_agent_autocomplete_input($params);
if (enterprise_installed()) {

View File

@ -155,6 +155,7 @@ $alert_d7 = 1;
$alert_recovery = 0;
$alert_priority = 0;
$server_name = '';
$satellite_server = 0;
$grupo = 0;
$id_os = 9;
// Windows.
@ -985,6 +986,7 @@ if ($update_agent) {
$old_values = db_get_row('tagente', 'id_agente', $id_agente);
$fields = db_get_all_fields_in_table('tagent_custom_fields');
$secondary_groups = (string) get_parameter('secondary_hidden', '');
$satellite_server = (int) get_parameter('satellite_server', 0);
if ($fields === false) {
$fields = [];
@ -1092,6 +1094,7 @@ if ($update_agent) {
'quiet' => $quiet,
'cps' => $cps,
'safe_mode_module' => $safe_mode_module,
'satellite_server' => $satellite_server,
];
if ($config['metaconsole_agent_cache'] == 1) {
@ -1230,6 +1233,7 @@ if ($id_agente) {
$cps = $agent['cps'];
$safe_mode_module = $agent['safe_mode_module'];
$safe_mode = ($safe_mode_module) ? 1 : 0;
$satellite_server = (int) $agent['satellite_server'];
}
$update_module = (bool) get_parameter('update_module');

View File

@ -315,7 +315,20 @@ html_print_select_groups(
'',
false
);
echo '</div>';
echo '</div></td>';
// Recursion checkbox.
echo '<td>';
echo __('Recursion').'&nbsp;';
html_print_checkbox(
'recursion',
1,
$recursion,
false,
false,
'this.form.submit()'
);
echo '</td>';
echo '<td>';
echo __('Show Agents').'&nbsp;';
$fields = [
@ -346,19 +359,6 @@ foreach ($pre_fields as $key => $value) {
html_print_select($fields, 'os', $os, 'this.form.submit()', 'All', 0);
echo '</td>';
echo '<td>';
echo __('Recursion').'&nbsp;';
html_print_checkbox(
'recursion',
1,
$recursion,
false,
false,
'this.form.submit()'
);
echo '</td><td>';
echo __('Search').'&nbsp;';
html_print_input_text('search', $search, '', 12);

View File

@ -539,6 +539,12 @@ if ($id_downtime > 0) {
// only action to postpone on once type is enabled and the other are disabled.
$disabled_in_execution = (int) $running;
$return_all_group = false;
if (users_can_manage_group_all('AW') === true || $disabled) {
$return_all_group = true;
}
$table = new StdClass();
$table->class = 'databox filters';
$table->width = '100%';
@ -557,7 +563,7 @@ $table->data[1][0] = __('Group');
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
false,
$access,
true,
$return_all_group,
'id_group',
$id_group,
'',
@ -793,7 +799,7 @@ $table->width = '100%';
$table->data = [];
$table->data[0][0] = __('Group filter');
$table->data[0][1] = html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', true, false, true, '', false, 'min-width:180px;margin-right:15px;');
$table->data[0][1] = html_print_select_groups(false, $access, $return_all_group, 'filter_group', $filter_group, '', '', '', true, false, true, '', false, 'min-width:180px;margin-right:15px;');
$table->data[0][2] = __('Recursion').'&nbsp&nbsp'.html_print_checkbox('recursion', 1, $recursion, true, false, '');
$table->data[1][0] = __('Available agents');

View File

@ -261,7 +261,7 @@ $table->data[2][1] = html_print_select_from_sql(
'id_command',
$id_command,
'',
__('None'),
'',
0,
true,
false,

View File

@ -140,7 +140,7 @@ function process_manage_delete($id_agents)
}
$id_group = (int) get_parameter('id_group');
$id_group = (is_metaconsole() === true) ? get_parameter('id_group', '') : (int) get_parameter('id_group');
$id_agents = get_parameter('id_agents');
$recursion = get_parameter('recursion');
$delete = (bool) get_parameter_post('delete');
@ -282,15 +282,15 @@ $table->data[3][0] .= '<span id="agent_loading" class="invisible">';
$table->data[3][0] .= html_print_image('images/spinner.png', true);
$table->data[3][0] .= '</span>';
$agents = agents_get_group_agents(
array_keys(users_get_groups($config['id_user'], 'AW', false)),
['disabled' => 2],
'none',
false,
false,
is_metaconsole(),
'|'
);
$agents = [];
if (is_metaconsole() === false) {
$agents = agents_get_group_agents(
array_keys(users_get_groups($config['id_user'], 'AW', false)),
['disabled' => 2],
'none'
);
}
$table->data[3][1] = html_print_select(
$agents,

View File

@ -258,9 +258,9 @@ $table->style[0] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold;';
$table->size = [];
$table->size[0] = '15%';
$table->size[1] = '40%';
$table->size[1] = '35%';
$table->size[2] = '15%';
$table->size[3] = '40%';
$table->size[3] = '35%';
$table->data = [];
@ -276,7 +276,12 @@ $table->data[0][1] = html_print_select(
false,
__('Select'),
0,
true
true,
false,
true,
'',
false,
'width: 100%;'
);
$table->data[0][2] = '';
$table->data[0][3] = '';
@ -295,7 +300,8 @@ $table->data[1][1] = html_print_select_groups(
false,
true,
'',
$id_alert_template == 0
$id_alert_template == 0,
'width: 100%;'
);
$table->data[0][2] = __('Show alerts on disabled modules');

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -89,9 +89,9 @@ if ($update) {
$agents_ = [];
}
// If the option to select all of one group or module type is checked
// If the option to select all of one group or module type is checked.
if ($force) {
if ($force == 'type') {
if ($force === 'type') {
$type_condition = '';
if ($module_type != 0) {
$type_condition = "AND tam.id_tipo_modulo = $module_type";
@ -109,7 +109,7 @@ if ($update) {
$agents_ = [];
}
// Create an array of agent ids
// Create an array of agent ids.
$agents_ = extract_column($agents_, 'id_agente');
foreach ($agents_ as $id_agent) {
@ -136,7 +136,7 @@ if ($update) {
if ($success == 0) {
$error_msg = __('Error updating the modules from a module type');
}
} else if ($force == 'group') {
} else if ($force === 'group') {
$agents_ = array_keys(agents_get_group_agents($group_select, false, 'none'));
foreach ($agents_ as $id_agent) {
@ -2226,28 +2226,30 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
$values['quiet'] = get_parameter('quiet_select');
}
$filter_modules = false;
if (!is_numeric($module_name) or ($module_name != 0)) {
$filter_modules['nombre'] = $module_name;
}
// Whether to update module tag info
// Whether to update module tag info.
$update_tags = get_parameter('id_tag', false);
if (array_search(0, $agents_select) !== false) {
// Apply at All agents.
$modules = db_get_all_rows_filter(
'tagente_modulo',
$filter_modules,
[
'id_agente_modulo',
'id_tipo_modulo',
]
if (is_numeric($module_name) === false || ($module_name !== 0)) {
$filterModules = sprintf('AND tam.nombre = \'%s\'', $module_name);
} else {
$filterModules = '';
}
// Apply at All agents (within valid groups).
$modules = db_get_all_rows_sql(
sprintf(
'SELECT tam.id_agente_modulo, tam.id_tipo_modulo
FROM tagente_modulo tam INNER JOIN tagente ta
ON ta.id_agente = tam.id_agente
WHERE ta.id_grupo IN (%s) %s;',
implode(',', array_keys(users_get_groups())),
$filterModules
)
);
} else {
if ($module_name == '0') {
// Any module
if ($module_name === '0') {
// Any module.
$modules = db_get_all_rows_filter(
'tagente_modulo',
['id_agente' => $agents_select],
@ -2275,12 +2277,12 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
return false;
}
if (($module_status == 'unknown') && ($module_name == '0')) {
if (($module_status === 'unknown') && ($module_name == '0')) {
$modules_to_delete = [];
foreach ($modules as $mod_id) {
$mod_status = (int) db_get_value_filter('estado', 'tagente_estado', ['id_agente_modulo' => $mod_id]);
// Unknown, not init and no data modules
// Unknown, not init and no data modules.
if ($mod_status == 3 || $mod_status == 4 || $mod_status == 5) {
$modules_to_delete[$mod_id] = $mod_id;
}

View File

@ -525,21 +525,21 @@ $menu_godmode['links']['sub'] = $sub;
// Update Manager
if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager']) {
$menu_godmode['messages']['text'] = __('Update manager');
$menu_godmode['messages']['text'] = __('Warp Update');
$menu_godmode['messages']['id'] = 'god-um_messages';
$menu_godmode['messages']['sec2'] = '';
$sub = [];
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update offline');
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update Manager online');
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update online');
$sub['godmode/update_manager/update_manager&tab=online']['id'] = 'Online';
$sub['godmode/update_manager/update_manager&tab=setup']['text'] = __('Update Manager options');
$sub['godmode/update_manager/update_manager&tab=setup']['text'] = __('Options');
$sub['godmode/update_manager/update_manager&tab=setup']['id'] = 'Options';
$sub['godmode/update_manager/update_manager&tab=history']['text'] = __('Update Manager journal');
$sub['godmode/update_manager/update_manager&tab=history']['text'] = __('Warp journal');
$sub['godmode/update_manager/update_manager&tab=history']['id'] = 'Journal';
$menu_godmode['messages']['sub'] = $sub;

View File

@ -178,6 +178,7 @@ switch ($type) {
break;
}
$query_filter = [];
if (empty($query_filter) === false) {
$query_filter = json_decode($query_filter, true);
}

View File

@ -606,6 +606,7 @@ switch ($action) {
$event_graph_by_criticity = $style['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$include_extended_events = $item['show_extended_events'];
$custom_data_events = $style['custom_data_events'];
$filter_search = $style['event_filter_search'];
$filter_exclude = $style['event_filter_exclude'];
@ -631,6 +632,7 @@ switch ($action) {
$include_extended_events = $item['show_extended_events'];
$custom_data_events = $style['custom_data_events'];
break;
case 'event_report_module':
@ -665,6 +667,7 @@ switch ($action) {
$include_extended_events = $item['show_extended_events'];
$custom_data_events = $style['custom_data_events'];
break;
case 'general':
@ -2911,6 +2914,23 @@ $class = 'databox filters';
</td>
</tr>
<tr id="row_custom_data_events" class="datos">
<td class="bolder">
<?php
echo __('Show custom data');
?>
</td>
<td>
<?php
html_print_checkbox_switch(
'custom_data_events',
true,
$custom_data_events
);
?>
</td>
</tr>
<tr id="row_event_graphs" class="datos">
<td class="bolder"><?php echo __('Event graphs'); ?></td>
<td>
@ -5974,6 +5994,7 @@ function chooseType() {
$("#row_event_graph_by_criticity").hide();
$("#row_event_graph_by_validated").hide();
$("#row_extended_events").hide();
$("#row_custom_data_events").hide();
$("#row_netflow_filter").hide();
$("#row_max_values").hide();
$("#row_resolution").hide();
@ -6044,6 +6065,7 @@ function chooseType() {
$("#row_event_graph_by_criticity").show();
$("#row_event_graph_by_validated").show();
$("#row_extended_events").show();
$("#row_custom_data_events").show();
$("#row_filter_search").show();
$("#row_filter_exclude").show();
@ -6371,6 +6393,7 @@ function chooseType() {
$("#row_event_graph_by_validated").show();
$("#row_event_type").show();
$("#row_extended_events").show();
$("#row_custom_data_events").show();
$("#row_filter_search").show();
$("#row_filter_exclude").show();
@ -6389,7 +6412,7 @@ function chooseType() {
$("#row_event_graphs").show();
$("#row_event_type").show();
$("#row_extended_events").show();
$("#row_extended_events").show();
$("#row_custom_data_events").show();
$("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show();
@ -6414,6 +6437,7 @@ function chooseType() {
$("#row_event_graphs").show();
$("#row_event_type").show();
$("#row_extended_events").show();
$("#row_custom_data_events").show();
$("#row_event_graph_by_user").show();
$("#row_event_graph_by_criticity").show();

View File

@ -2224,12 +2224,18 @@ switch ($action) {
$filter_event_status
);
$custom_data_events = get_parameter_switch(
'custom_data_events',
0
);
$style['event_graph_by_agent'] = $event_graph_by_agent;
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
$style['event_filter_search'] = $event_filter_search;
$style['event_filter_exclude'] = $event_filter_exclude;
$style['custom_data_events'] = $custom_data_events;
if ($label != '') {
@ -2957,6 +2963,11 @@ switch ($action) {
''
);
$custom_data_events = get_parameter_switch(
'custom_data_events',
0
);
// Added for events items.
$style['show_summary_group'] = $show_summary_group;
@ -2976,6 +2987,7 @@ switch ($action) {
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
$style['event_filter_search'] = $event_filter_search;
$style['event_filter_exclude'] = $event_filter_exclude;
$style['custom_data_events'] = $custom_data_events;
if ($label != '') {
$style['label'] = $label;

View File

@ -256,16 +256,18 @@ $table->style[0] = 'font-weight: bold';
$table->size[0] = '70%';
$table->size[1] = '30%';
// enterprise_hook('enterprise_warnings_history_days');
$table->data[1][0] = __('Max. days before delete events');
$table->data[1][1] = html_print_input_text(
'event_purge',
$config['event_purge'],
'',
5,
5,
true
$table->data[1][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => 99999,
'name' => 'event_purge',
'value' => $config['event_purge'],
'return' => true,
'min' => ((((bool) $config['history_event_enabled'] === true) && $config['history_event_days'] > 0) ? $config['history_event_days'] + 1 : null),
'style' => 'width:43px',
]
);
$table->data[2][0] = __('Max. days before delete traps');

File diff suppressed because it is too large Load Diff

View File

@ -203,20 +203,22 @@ if (is_ajax() !== true) {
var clientMode = '<?php echo $mode; ?>';
</script>
<?php
$server_version = (string) db_get_value_sql(
'SELECT `version` FROM `tserver` ORDER BY `master` DESC'
);
if ($server_version !== false
&& preg_match('/NG\.(\d\.*\d*?) /', $server_version, $matches) > 0
) {
if ((float) $matches[1] !== (float) $current_package) {
ui_print_warning_message(
__(
'Master server version %s does not match console version %s.',
(float) $matches[1],
(float) $current_package
)
);
if (function_exists('db_get_value_sql') === true) {
$server_version = (string) db_get_value_sql(
'SELECT `version` FROM `tserver` ORDER BY `master` DESC'
);
if ($server_version !== false
&& preg_match('/NG\.(\d\.*\d*?) /', $server_version, $matches) > 0
) {
if ((float) $matches[1] !== floor((float) $current_package)) {
ui_print_warning_message(
__(
'Master server version %s does not match console version %s.',
(float) $matches[1],
(float) $current_package
)
);
}
}
}
@ -313,7 +315,7 @@ if (is_array($config) === true) {
if ($mode === Manager::MODE_ONLINE
&& ($puid === null || $puid === 'OFFLINE')
) {
ui_print_error_message(__('Update manager online requires registration.'));
ui_print_error_message(__('Update online requires registration.'));
}
if ($mode === Manager::MODE_OFFLINE) {

View File

@ -1,21 +1,36 @@
<?php
/**
* Update manager.
*
* @category Update Manager
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Begin.
global $config;
check_login();
// The ajax is in
// include/ajax/update_manager.php
// The ajax is in include/ajax/update_manager.php.
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -36,59 +51,65 @@ if ($php_version_array[0] < 7) {
$tab = get_parameter('tab', 'online');
$buttons['setup'] = [
'active' => ($tab == 'setup') ? true : false,
'active' => ($tab === 'setup') ? true : false,
'text' => '<a href="'.ui_get_full_url(
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup'
).'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Options'), 'class' => 'invert_filter']).'</a>',
).'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup'), 'class' => 'invert_filter']).'</a>',
];
$buttons['history'] = [
'active' => ($tab == 'history') ? true : false,
'active' => ($tab === 'history') ? true : false,
'text' => '<a href="'.ui_get_full_url(
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=histo'
).'ry">'.html_print_image('images/gm_db.png', true, ['title' => __('Journal'), 'class' => 'invert_filter']).'</a>',
];
$buttons['offline'] = [
'active' => ($tab == 'offline') ? true : false,
'active' => ($tab === 'offline') ? true : false,
'text' => '<a href="'.ui_get_full_url(
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offli'
).'ne">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager'), 'class' => 'invert_filter']).'</a>',
).'ne">'.html_print_image('images/box.png', true, ['title' => __('Offline update'), 'class' => 'invert_filter']).'</a>',
];
$buttons['online'] = [
'active' => ($tab == 'online') ? true : false,
'active' => ($tab === 'online') ? true : false,
'text' => '<a href="'.ui_get_full_url(
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=onlin'
).'e">'.html_print_image('images/op_gis.png', true, ['title' => __('Online update manager'), 'class' => 'invert_filter']).'</a>',
).'e">'.html_print_image('images/op_gis.png', true, ['title' => __('Online update'), 'class' => 'invert_filter']).'</a>',
];
switch ($tab) {
case 'history':
$title = __('Update manager » Journal');
$title = __('Journal');
break;
case 'setup':
$title = __('Update manager » Setup');
$title = __('Setup');
break;
case 'offline':
$title = __('Update manager » Offline');
$title = __('Offline');
break;
case 'online':
default:
$title = __('Update manager » Online');
$title = __('Online');
break;
}
ui_print_page_header(
ui_print_standard_header(
$title,
'images/gm_setup.png',
false,
'',
true,
$buttons
$buttons,
[
[
'link' => '',
'label' => 'Warp Update',
],
]
);
switch ($tab) {
@ -107,6 +128,39 @@ switch ($tab) {
case 'online':
default:
if (is_metaconsole() === false && has_metaconsole() === true) {
$meta_puid = null;
$server_id = $config['metaconsole_node_id'];
$dbh = (object) $config['dbconnection'];
// Connect to metaconsole.
$result_code = metaconsole_load_external_db(
[
'dbhost' => $config['replication_dbhost'],
'dbuser' => $config['replication_dbuser'],
'dbpass' => io_output_password($config['replication_dbpass']),
'dbname' => $config['replication_dbname'],
]
);
if ($result_code < 0) {
break;
}
$value = db_get_value('value', 'tconfig', 'token', 'pandora_uid');
$meta_puid = $value;
// Return connection to node.
metaconsole_restore_db();
if ($meta_puid === false || $meta_puid === null) {
ui_print_warning_message(__('Please register on metaconsole first.'));
break;
}
}
$mode = \UpdateManager\UI\Manager::MODE_ONLINE;
include $config['homedir'].'/godmode/um_client/index.php';
break;

View File

@ -268,17 +268,18 @@ $table->style[$i] = 'font-weight: bolder;width:250px';
$url_update_manager = update_manager_get_url();
$table->data[$i][0] = __('URL update manager:');
$table->data[$i][0] = __('Warp Update URL');
$table->data[$i++][1] = html_print_input_text(
'url_update_manager',
$url_update_manager,
__('URL update manager'),
80,
60,
255,
true,
true
);
$table->data[$i][0] = __('Use secured update manager:');
$table->data[$i][0] = __('Use secured Warp Update');
$table->data[$i++][1] = html_print_input(
[
'type' => 'switch',
@ -287,7 +288,7 @@ $table->data[$i++][1] = html_print_input(
]
);
$table->data[$i][0] = __('Proxy server:');
$table->data[$i][0] = __('Proxy server');
$table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_server',
$update_manager_proxy_server,
@ -297,7 +298,7 @@ $table->data[$i++][1] = html_print_input_text(
true
);
$table->data[$i][0] = __('Proxy port:');
$table->data[$i][0] = __('Proxy port');
$table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_port',
$update_manager_proxy_port,
@ -307,7 +308,7 @@ $table->data[$i++][1] = html_print_input_text(
true
);
$table->data[$i][0] = __('Proxy user:');
$table->data[$i][0] = __('Proxy user');
$table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_user',
$update_manager_proxy_user,
@ -317,7 +318,7 @@ $table->data[$i++][1] = html_print_input_text(
true
);
$table->data[$i][0] = __('Proxy password:');
$table->data[$i][0] = __('Proxy password');
$table->data[$i++][1] = html_print_input_password(
'update_manager_proxy_password',
$update_manager_proxy_password,
@ -327,7 +328,7 @@ $table->data[$i++][1] = html_print_input_password(
true
);
$table->data[$i][0] = __('Allow no-consecutive patches:');
$table->data[$i][0] = __('Allow no-consecutive patches');
$table->data[$i++][1] = html_print_switch(
[
'name' => 'allow_offline_patches',
@ -336,7 +337,7 @@ $table->data[$i++][1] = html_print_switch(
]
);
$table->data[$i][0] = __('Limit to LTS updates:');
$table->data[$i][0] = __('Limit to LTS updates');
$table->data[$i++][1] = html_print_switch(
[
'name' => 'lts_updates',
@ -346,11 +347,11 @@ $table->data[$i++][1] = html_print_switch(
);
$table->data[$i][0] = __('Registration ID:');
$table->data[$i++][1] = '<i>'.$config['pandora_uid'].'</i>';
$table->data[$i][0] = __('Registration ID');
$table->data[$i++][1] = '<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>';
if (update_manager_verify_registration() === true && users_is_admin()) {
$table->data[$i][0] = __('Cancel registration:');
$table->data[$i][0] = __('Cancel registration');
$table->data[$i][1] = '<a href="';
if ((bool) is_metaconsole() === true) {
$table->data[$i][1] .= ui_get_full_url(
@ -367,7 +368,7 @@ if (update_manager_verify_registration() === true && users_is_admin()) {
if (license_free()) {
$config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1;
$table->data[$i][0] = __('Pandora FMS community reminder').ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this Pandora instance'), true);
$table->data[$i][0] = __('%s community reminder', get_product_name()).ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this %s instance', get_product_name()), true);
$table->data[$i][1] = __('Yes').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 1, '', $config['identification_reminder'], true).'&nbsp;&nbsp;';
$table->data[$i++][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 0, '', $config['identification_reminder'], true);
}

View File

@ -860,7 +860,7 @@ if (!$new_user) {
'',
'',
20,
100,
255,
!$new_user || $view_mode,
'',
[

View File

@ -713,7 +713,7 @@ class DiscoveryTaskList extends HTML
}
if ($task['id_recon_script'] == 0 || $ipam === true) {
$data[4] = $subnet;
$data[4] = ui_print_truncate_text($subnet, 50, true, true, true, '[&hellip;]');
} else {
$data[4] = '-';
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -86,6 +86,8 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
$addedItems = json_decode($addedItems);
$all = (string) get_parameter('all', 'all');
$delete_offspring_agents = (int) get_parameter('delete_offspring_agents', 0);
if ($addedItems != null) {
foreach ($addedItems as $item) {
echo $item."|\n";
@ -111,21 +113,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
}
$data = [];
// Get agents for only the alias
// Get agents for only the alias.
$filter_alias = $filter;
switch ($config['dbtype']) {
case 'mysql':
$filter_alias[] = '(UPPER(alias) LIKE "%'.$string.'%")';
break;
case 'postgresql':
$filter_alias[] = '(UPPER(alias) LIKE \'%'.$string.'%\')';
break;
case 'oracle':
$filter_alias[] = '(UPPER(alias) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$filter_alias[] = '(UPPER(alias) LIKE "%'.$string.'%")';
$agents = agents_get_agents($filter_alias, ['id_agente', 'nombre', 'direccion', 'alias']);
if ($agents !== false) {
@ -142,19 +132,7 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
// Get agents for only the name.
$filter_agents = $filter;
switch ($config['dbtype']) {
case 'mysql':
$filter_agents[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) LIKE "%'.$string.'%")';
break;
case 'postgresql':
$filter_agents[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) LIKE \'%'.$string.'%\')';
break;
case 'oracle':
$filter_agents[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$filter_agents[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) LIKE "%'.$string.'%")';
$agents = agents_get_agents($filter_agents, ['id_agente', 'nombre', 'direccion', 'alias']);
if ($agents !== false) {
@ -169,21 +147,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
}
}
// Get agents for only the address
// Get agents for only the address.
$filter_address = $filter;
switch ($config['dbtype']) {
case 'mysql':
$filter_address[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) LIKE "%'.$string.'%")';
break;
case 'postgresql':
$filter_address[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) NOT LIKE \'%'.$string.'%\' AND UPPER(direccion) LIKE \'%'.$string.'%\')';
break;
case 'oracle':
$filter_address[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$filter_address[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) LIKE "%'.$string.'%")';
$agents = agents_get_agents($filter_address, ['id_agente', 'nombre', 'direccion', 'alias']);
if ($agents !== false) {
@ -198,21 +164,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
}
}
// Get agents for only the description
// Get agents for only the description.
$filter_description = $filter;
switch ($config['dbtype']) {
case 'mysql':
$filter_description[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) NOT LIKE "%'.$string.'%" AND UPPER(comentarios) LIKE "%'.$string.'%")';
break;
case 'postgresql':
$filter_description[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) NOT LIKE \'%'.$string.'%\' AND UPPER(direccion) NOT LIKE \'%'.$string.'%\' AND UPPER(comentarios) LIKE \'%'.$string.'%\')';
break;
case 'oracle':
$filter_description[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))';
break;
}
$filter_description[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) NOT LIKE "%'.$string.'%" AND UPPER(comentarios) LIKE "%'.$string.'%")';
$agents = agents_get_agents($filter_description, ['id_agente', 'nombre', 'direccion', 'alias']);
if ($agents !== false) {
@ -227,6 +181,18 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
}
}
if (empty($data) === false && $delete_offspring_agents !== 0) {
// Gets offspring and deletes them, including himself.
$agents_offspring = agents_get_offspring($delete_offspring_agents);
if (empty($agents_offspring) === false) {
foreach ($data as $key => $value) {
if (isset($agents_offspring[$value['id']]) === true) {
unset($data[$key]);
}
}
}
}
echo json_encode($data);
return;
} else if ($search_agents && is_metaconsole()) {

View File

@ -136,7 +136,7 @@ if ($get_comments === true) {
// Default grouped message filtering (evento and estado).
$whereGrouped = sprintf(
'`evento` = "%s" AND `estado` = "%s"',
io_safe_output($event['evento']),
$event['evento'],
$event['estado']
);
// If id_agente is reported, filter the messages by them as well.

View File

@ -3559,7 +3559,8 @@ class AgentWizard extends HTML
$this->targetPort,
$this->server,
$this->extraArguments,
(($full_output === false) ? '-Oa -On' : '-Oa')
(($full_output === false) ? '-On' : '-Oa'),
''
);
if ($pure === true) {
@ -3572,7 +3573,12 @@ class AgentWizard extends HTML
if ($full_output === true) {
$output[] = $key.' = '.$oid_unit;
} else {
preg_match('/\.\d+$/', $key, $index);
$index = [];
$index[] = preg_replace('/^'.$oid.'/', '', $key);
if (empty($index) === true) {
preg_match('/\.\d+$/', $key, $index);
}
$tmp = explode(': ', $oid_unit);
$output[$index[0]] = str_replace('"', '', ($tmp[1] ?? ''));
}

View File

@ -245,7 +245,7 @@ class AgentsAlerts extends HTML
);
$table->width = '100%';
$table->class = 'databox data';
$table->class = 'info_table';
$table->id = 'table_agent_module';
$table->data = [];
@ -537,7 +537,7 @@ class AgentsAlerts extends HTML
'alerts_agents'
);
echo '<table cellpadding="4" cellspacing="4" border="0" class="agents_modules_table table">';
echo '<table cellpadding="4" cellspacing="4" border="0" class="info_table">';
echo '<tr>';
echo '<th class="header_table_principal_cell">'.__('Agents').' / '.__('Alerts').'</th>';
@ -576,10 +576,11 @@ class AgentsAlerts extends HTML
'images/arrow_left_green.png',
true,
[
'style' => 'float: right;',
'style' => 'display:flex;justify-content: center',
'title' => __('Previous alerts'),
]
),
'style' => 'display:flex;justify-content: center',
]
);
echo '</th>';
@ -612,9 +613,9 @@ class AgentsAlerts extends HTML
$outputLine = html_print_div(
[
'id' => 'line_header_'.$id,
'class' => 'rotate_text_module position_text_module',
'class' => 'position_text_module',
'style' => '',
'content' => '<div title="'.io_safe_output($name).'">'.ui_print_truncate_text(io_safe_output($name), 20).'</div>',
'content' => '<div style="font-size: 7.5pt !important" title="'.io_safe_output($name).'">'.ui_print_truncate_text(io_safe_output($name), 20).'</div>',
],
true
);
@ -657,7 +658,7 @@ class AgentsAlerts extends HTML
$alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
echo '<tr>';
// Name of the agent.
echo '<td class="bolder" style="text-align: right" >'.$alias['alias'].'</td>';
echo '<td style="text-align: left;font-weight: bold;color: #3f3f3f;">'.$alias['alias'].'</td>';
// Alerts of the agent.
foreach ($templates as $tid => $tname) {
$anyfired = 0;
@ -669,18 +670,6 @@ class AgentsAlerts extends HTML
echo '<td class="center">';
if (isset($agent_alerts[$alias['alias']][$tid])) {
foreach ($agent_alerts[$alias['alias']][$tid] as $alert) {
if ((int) $alert['times_fired'] > 0) {
$anyfired = true;
}
}
if ($anyfired) {
$cellstyle = 'background:'.COL_ALERTFIRED.';';
} else {
$cellstyle = 'background:'.COL_NORMAL.';';
}
$uniqid = uniqid();
html_print_anchor(
@ -689,8 +678,7 @@ class AgentsAlerts extends HTML
'content' => html_print_div(
[
'id' => 'line_header_'.$temp['id'],
'class' => 'status_rounded_rectangles text_inside',
'style' => $cellstyle,
'style' => 'font-size: 13pt;',
'content' => count($agent_alerts[$alias['alias']][$tid]),
],
true

View File

@ -1528,7 +1528,7 @@ class ConsoleSupervisor
$this->cleanNotifications('NOTIF.PHP.UPLOAD_MAX_FILESIZE');
}
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
if ($PHPmemory_limit < $PHPmemory_limit_min && (int) $PHPmemory_limit !== -1) {
$url = 'http://php.net/manual/en/ini.core.php#ini.memory-limit';
if ($config['language'] == 'es') {
$url = 'http://php.net/manual/es/ini.core.php#ini.memory-limit';
@ -2145,8 +2145,8 @@ class ConsoleSupervisor
[
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
'title' => __('This instance is not registered in the Update manager section'),
'message' => __('Click <a class="bolder underline" href="javascript: force_run_register();"> here</a> to start the registration process'),
'url' => 'javascript: force_run_register();',
'message' => __('Click here to start the registration process'),
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
]
);
} else {
@ -2166,7 +2166,7 @@ class ConsoleSupervisor
// Check default password for "admin".
$admin_with_default_pass = db_get_value_sql(
'SELECT count(*) FROM tusuario
WHERE
WHERE
id_user="admin"
AND password="1da7ee7d45b96d0e1f45ee4ee23da560"
AND is_admin=1
@ -2441,11 +2441,11 @@ class ConsoleSupervisor
config_update_value('last_um_check', $future, true);
$messages = update_manager_get_messages();
if (is_array($messages) === true) {
$source_id = get_notification_source_id(
'Official&#x20;communication'
);
foreach ($messages as $message) {
if (isset($message['url']) === false) {
$message['url'] = '#';
@ -2476,8 +2476,8 @@ class ConsoleSupervisor
// List all servers except satellite server.
$server_version_list = db_get_all_rows_sql(
sprintf(
'SELECT `name`, `version`
FROM tserver
'SELECT `name`, `version`
FROM tserver
WHERE server_type != %d
GROUP BY `version`',
SERVER_TYPE_ENTERPRISE_SATELLITE
@ -2490,7 +2490,7 @@ class ConsoleSupervisor
foreach ($server_version_list as $server) {
if (strpos(
$server['version'],
$config['current_package']
(string) floor($config['current_package'])
) === false
) {
$missed++;
@ -2511,6 +2511,8 @@ class ConsoleSupervisor
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
]
);
break;
}
}
}

View File

@ -336,7 +336,7 @@ class OrderInterpreter extends Wizard
),
],
[
'name' => __('Update Manager'),
'name' => __('Warp Update'),
'icon' => ui_get_full_url(
'images/menu/um_messages.menu_gray.png'
),
@ -404,10 +404,10 @@ class OrderInterpreter extends Wizard
'.$value['name'].'</a><br>';
}
$iterator ++;
$iterator++;
if ($iterator > 10) {
$more_results ++;
$more_results++;
}
}
}

View File

@ -523,6 +523,14 @@ class TreeService extends Tree
continue 2;
}
$title = get_parameter('title', '');
if (empty($title) === true) {
$tmp['title'] = '';
} else {
$tmp['title'] = $title.'/';
}
$tmp['title'] .= $service->name();
$tmp['id'] = (int) $item->service()->id();
$tmp['name'] = $item->service()->name();
$tmp['alias'] = $item->service()->name();
@ -530,33 +538,6 @@ class TreeService extends Tree
$tmp['elementDescription'] = $item->description();
$tmp['disabled'] = $item->service()->disabled();
if ($this->connectedToNode === false
&& is_metaconsole() === true
&& $tmp['metaID'] > 0
) {
// Impersonate node.
\enterprise_include_once('include/functions_metaconsole.php');
\enterprise_hook(
'metaconsole_connect',
[
null,
$tmp['metaID'],
]
);
}
if (check_acl($config['id_user'], $item->service()->id_group(), 'AR')) {
$grandchildren = $item->service()->children();
}
if ($this->connectedToNode === false
&& is_metaconsole() === true
&& $tmp['metaID'] > 0
) {
// Restore connection.
\enterprise_hook('metaconsole_restore_db');
}
$counters = [
'total_modules' => 0,
'total_agents' => 0,
@ -565,29 +546,66 @@ class TreeService extends Tree
'total' => 0,
];
if (is_array($grandchildren) === true) {
$counters = array_reduce(
$grandchildren,
function ($carry, $item) {
if ($item->type() === SERVICE_ELEMENT_MODULE) {
$carry['total_modules']++;
} else if ($item->type() === SERVICE_ELEMENT_AGENT) {
$carry['total_agents']++;
} else if ($item->type() === SERVICE_ELEMENT_SERVICE) {
$carry['total_services']++;
} else if ($item->type() === SERVICE_ELEMENT_DYNAMIC) {
$carry['total_dynamic']++;
}
if (is_metaconsole() === false
|| (isset($config['realtimestats']) === true
&& $config['realtimestats'] === true
&& $tmp['metaID'] > 0)
) {
// Look for counters.
if ($this->connectedToNode === false
&& is_metaconsole() === true
&& $tmp['metaID'] > 0
) {
// Impersonate node.
\enterprise_include_once('include/functions_metaconsole.php');
\enterprise_hook(
'metaconsole_connect',
[
null,
$tmp['metaID'],
]
);
}
$carry['total']++;
if (check_acl($config['id_user'], $item->service()->id_group(), 'AR')) {
$grandchildren = $item->service()->children();
}
return $carry;
},
$counters
);
}
if ($this->connectedToNode === false
&& is_metaconsole() === true
&& $tmp['metaID'] > 0
) {
// Restore connection.
\enterprise_hook('metaconsole_restore_db');
}
if ($counters['total'] > 0) {
if (is_array($grandchildren) === true) {
$counters = array_reduce(
$grandchildren,
function ($carry, $item) {
if ($item->type() === SERVICE_ELEMENT_MODULE) {
$carry['total_modules']++;
} else if ($item->type() === SERVICE_ELEMENT_AGENT) {
$carry['total_agents']++;
} else if ($item->type() === SERVICE_ELEMENT_SERVICE) {
$carry['total_services']++;
} else if ($item->type() === SERVICE_ELEMENT_DYNAMIC) {
$carry['total_dynamic']++;
}
$carry['total']++;
return $carry;
},
$counters
);
}
if ($counters['total'] > 0) {
$tmp['searchChildren'] = 1;
}
} else {
// Always search for.
$tmp['searchChildren'] = 1;
}

View File

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

View File

@ -294,7 +294,11 @@ define('SERVICE_ELEMENT_DYNAMIC', 'dynamic');
define('SERVICE_MODE_MANUAL', 0);
define('SERVICE_MODE_SMART', 1);
// New installation Product Logo.
define('HEADER_LOGO_DEFAULT_CLASSIC', 'logo-default-pandorafms.png');
define('HEADER_LOGO_DEFAULT_COLLAPSED', 'logo-default-pandorafms-collapsed.png');
define('HEADER_LOGO_BLACK_CLASSIC', 'logo-black-pandorafms.png');
define('HEADER_LOGO_BLACK_COLLAPSED', 'logo-default-pandorafms-collapsed.png');
// Status images.
// For modules.
@ -802,7 +806,7 @@ define('AUDIT_LOG_SNMP_MANAGEMENT', 'SNMP management');
define('AUDIT_LOG_DASHBOARD_MANAGEMENT', 'Dashboard management');
define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management');
define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management');
define('AUDIT_LOG_UMC', 'Update Manager');
define('AUDIT_LOG_UMC', 'Warp Manager');
// MIMEs.
define(

View File

@ -1993,7 +1993,8 @@ function get_snmpwalk(
$snmp_port='',
$server_to_exec=0,
$extra_arguments='',
$format='-Oa'
$format='-Oa',
$load_mibs='-m ALL'
) {
global $config;
@ -2057,15 +2058,15 @@ function get_snmpwalk(
case '3':
switch ($snmp3_security_level) {
case 'authNoPriv':
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
case 'noAuthNoPriv':
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
default:
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
}
break;
@ -2074,7 +2075,7 @@ function get_snmpwalk(
case '2c':
case '1':
default:
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
}
@ -5986,6 +5987,56 @@ function send_test_email(
}
/**
* Return array of ancestors of item, given array.
*
* @param integer $item From index.
* @param array $data Array data.
* @param string $key Pivot key (identifies the parent).
* @param string|null $extract Extract certain column or index.
* @param array $visited Cycle detection.
*
* @return array Array of ancestors.
*/
function get_ancestors(
int $item,
array $data,
string $key,
?string $extract=null,
array &$visited=[]
) :array {
if (isset($visited[$item]) === true) {
return [];
}
$visited[$item] = 1;
if (isset($data[$item]) === false) {
return [];
}
if (isset($data[$item][$key]) === false) {
if ($extract !== null) {
return [$data[$item][$extract]];
}
return [$item];
}
if ($extract !== null) {
return array_merge(
get_ancestors($data[$item][$key], $data, $key, $extract, $visited),
[$data[$item][$extract]]
);
}
return array_merge(
get_ancestors($data[$item][$key], $data, $key, $extract, $visited),
[$item]
);
}
if (function_exists('str_contains') === false) {

View File

@ -4268,3 +4268,30 @@ function get_status_data_agent_modules($id_group, $agents=[], $modules=[])
return $res;
}
function agents_get_offspring(int $id_agent)
{
$return = [];
// Get parent.
$agents = db_get_all_rows_filter(
'tagente',
[
'id_parent' => $id_agent,
'disabled' => 0,
],
'id_agente'
);
if ($agents !== false) {
foreach ($agents as $agent) {
if ((int) $agent['id_agente'] !== 0) {
$return += agents_get_offspring((int) $agent['id_agente']);
}
}
}
$return += [$id_agent => 0];
return $return;
}

View File

@ -118,6 +118,9 @@ function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby
$sql .= ' AND t3.id_agente = '.$id_agent;
}
// Only enabled agent.
$sql .= ' AND t3.disabled = 0';
$row_alerts = db_get_all_rows_sql($sql);
if ($total) {

View File

@ -1469,22 +1469,22 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3)
// Check parameters.
if ($idGroup == 0) {
$agent_update_error = __('The agent could not be modified. For security reasons, use a group other than 0.');
returnError('generic error', $agent_update_error);
returnError($agent_update_error);
return;
}
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE BINARY name LIKE "'.$nameServer.'"');
if ($alias == '' && $alias_as_name === 0) {
returnError('alias_not_specified', 'No agent alias specified');
returnError('No agent alias specified');
return;
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$idGroup) === false) {
returnError('id_grupo_not_exist', 'The group doesn`t exist.');
returnError('The group doesn`t exist.');
return;
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$idOS) === false) {
returnError('id_os_not_exist', 'The OS doesn`t exist.');
returnError('The OS doesn`t exist.');
return;
} else if ($server_name === false) {
returnError('server_not_exist', 'The '.get_product_name().' Server doesn`t exist.');
returnError('The '.get_product_name().' Server doesn`t exist.');
return;
}
@ -1525,6 +1525,14 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3)
returnError('The user cannot access to parent agent.');
return;
}
$agents_offspring = agents_get_offspring($id_agent);
if (empty($agents_offspring) === false) {
if (isset($agents_offspring[$idParent]) === true) {
returnError('The parent cannot be a offspring');
return;
}
}
}
$values_old = db_get_row_filter(
@ -1751,6 +1759,14 @@ function api_set_update_agent_field($id_agent, $use_agent_alias, $params)
returnError('The user cannot access to parent agent.');
return;
}
$agents_offspring = agents_get_offspring($id_agent);
if (empty($agents_offspring) === false) {
if (isset($agents_offspring[$data]) === true) {
returnError('The parent cannot be a offspring');
return;
}
}
break;
default:
@ -1855,7 +1871,19 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
return;
}
$alias = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $other['data'][0])));
$alias = io_safe_input(
trim(
preg_replace(
'/[\/\\\|%#&$]/',
'',
preg_replace(
'/x20;/',
' ',
$other['data'][0]
)
)
)
);
$direccion_agente = io_safe_input($other['data'][1]);
$nombre_agente = hash('sha256', $direccion_agente.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
$id_parent = (int) $other['data'][2];
@ -5088,7 +5116,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3)
function api_set_new_network_component($id, $thrash1, $other, $thrash2)
{
global $config;
if (is_metaconsole() === true) {
if (defined('METACONSOLE')) {
return;
}
@ -5190,7 +5218,7 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2)
{
global $config;
if (is_metaconsole() === true) {
if (defined('METACONSOLE')) {
return;
}
@ -5470,7 +5498,7 @@ function api_set_new_local_component($id, $thrash1, $other, $thrash2)
{
global $config;
if (is_metaconsole() === true) {
if (defined('METACONSOLE')) {
return;
}

View File

@ -1607,7 +1607,7 @@ function config_update_config()
'port' => $config['history_db_port'],
'name' => $config['history_db_name'],
'user' => $config['history_db_user'],
'pass' => $config['history_db_pass'],
'pass' => io_output_password($config['history_db_pass']),
]
);
@ -1619,48 +1619,47 @@ function config_update_config()
$dbm->process();
} else if ($dbm->check() !== true) {
$errors[] = $dbm->getLastError();
config_update_value('history_db_enabled', false);
}
if ($dbm->check() === true) {
// Historical configuration tokens (stored in historical db).
if ($dbm->setConfigToken(
'days_purge',
get_parameter('history_dbh_purge')
) !== true
) {
$error_update[] = __('Historical database purge');
}
if ($dbm->setConfigToken(
'history_partitions_auto',
get_parameter_switch('history_partitions_auto', 0)
) !== true
) {
$error_update[] = __('Historical database partitions');
}
if ($dbm->setConfigToken(
'event_purge',
get_parameter('history_dbh_events_purge')
) !== true
) {
$error_update[] = __('Historical database events purge');
}
if ($dbm->setConfigToken(
'string_purge',
get_parameter('history_dbh_string_purge')
) !== true
) {
$error_update[] = __('Historical database string purge');
}
// Disable history db in history db.
$dbm->setConfigToken('history_db_enabled', 0);
}
}
// Historical configuration tokens (stored in historical db).
if (Config::set(
'days_purge',
get_parameter('history_dbh_purge'),
true
) !== true
) {
$error_update[] = __('Historical database purge');
}
if (Config::set(
'history_partitions_auto',
get_parameter_switch('history_partitions_auto', 0),
true
) !== true
) {
$error_update[] = __('Historical database partitions');
}
if (Config::set(
'event_purge',
get_parameter('history_dbh_events_purge'),
true
) !== true
) {
$error_update[] = __('Historical database events purge');
}
if (Config::set(
'string_purge',
get_parameter('history_dbh_string_purge'),
true
) !== true
) {
$error_update[] = __('Historical database string purge');
}
// Disable history db in history db.
Config::set('history_db_enabled', 0, true);
break;
case 'ehorus':
@ -2096,6 +2095,10 @@ function config_process_config()
config_update_value('metaconsole_events_history', 0);
}
if (!isset($config['realtimestats'])) {
config_update_value('realtimestats', 1);
}
if (!isset($config['trap_purge'])) {
config_update_value('trap_purge', 7);
}
@ -2353,12 +2356,12 @@ function config_process_config()
config_update_value('custom_favicon', '');
}
if (!isset($config['custom_logo'])) {
config_update_value('custom_logo', 'pandora_logo_head_4.png');
if (isset($config['custom_logo']) === false) {
config_update_value('custom_logo', HEADER_LOGO_DEFAULT_CLASSIC);
}
if (!isset($config['custom_logo_collapsed'])) {
config_update_value('custom_logo_collapsed', 'pandora_logo_green_collapsed.png');
if (isset($config['custom_logo_collapsed']) === false) {
config_update_value('custom_logo_collapsed', HEADER_LOGO_DEFAULT_COLLAPSED);
}
if (is_metaconsole()) {

View File

@ -2297,6 +2297,7 @@ function events_comment(
$comments_format = 'new';
} else {
// If comments are not stored in json, the format is old.
$event_comments[0]['user_comment'] = str_replace(["\n", '&#x0a;'], '<br>', $event_comments[0]['user_comment']);
$event_comments_array = json_decode($event_comments[0]['user_comment']);
if (empty($event_comments_array) === true) {
@ -5227,6 +5228,8 @@ function events_page_comments($event, $ajax=false, $groupedComments=[])
$comm = $comm['user_comment'];
}
$comm = str_replace(["\n", '&#x0a;'], '<br>', $comm);
$comments_array[] = io_safe_output(json_decode($comm, true));
}

View File

@ -4237,6 +4237,82 @@ function html_print_image(
}
/**
* Function for print the logo in menu header.
*
* @param boolean $menuCollapsed If true, the menu is collapsed.
* @param boolean $return If true, the formed element is returned.
*
* @return mixed.
*/
function html_print_header_logo_image(bool $menuCollapsed, bool $return=false)
{
global $config;
if (defined('PANDORA_ENTERPRISE') === false) {
if ($config['style'] === 'pandora_black') {
$custom_logo = 'images/custom_logo/'.HEADER_LOGO_BLACK_CLASSIC;
$custom_logo_collapsed = 'images/custom_logo/'.HEADER_LOGO_DEFAULT_COLLAPSED;
} else if ($config['style'] === 'pandora') {
$custom_logo = 'images/custom_logo/'.HEADER_LOGO_DEFAULT_CLASSIC;
$custom_logo_collapsed = 'images/custom_logo/'.HEADER_LOGO_DEFAULT_COLLAPSED;
}
$logo_title = get_product_name().' Opensource';
} else {
// Handle default logos when change theme.
if ($config['style'] === 'pandora_black' && $config['custom_logo'] === HEADER_LOGO_DEFAULT_CLASSIC) {
$config['custom_logo'] = HEADER_LOGO_BLACK_CLASSIC;
} else if ($config['style'] === 'pandora' && $config['custom_logo'] === HEADER_LOGO_BLACK_CLASSIC) {
$config['custom_logo'] = HEADER_LOGO_DEFAULT_CLASSIC;
}
$logo_title = get_product_name().' Enterprise';
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
}
}
if (isset($config['custom_logo']) === true) {
$output = html_print_image(
$custom_logo,
true,
[
'border' => '0',
'width' => '215',
'alt' => $logo_title,
'class' => 'logo_full',
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
]
);
}
if (isset($config['custom_logo_collapsed']) === true) {
$output .= html_print_image(
$custom_logo_collapsed,
true,
[
'border' => '0',
'width' => '60',
'alt' => $logo_title,
'class' => 'logo_icon',
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
]
);
}
if ($return === false) {
echo $output;
} else {
return $output;
}
}
/**
* Render an input text element. Extended version, use html_print_input_text() to simplify.
*

View File

@ -1133,7 +1133,7 @@ function modules_get_table_data(?int $id_agent_module, ?int $id_type)
function modules_get_raw_data($id_agent_module, $date_init, $date_end)
{
$table = modules_get_table_data($id_agent_module);
$table = modules_get_table_data($id_agent_module, null);
$datelimit = ($date_init - $date_end);
$search_in_history_db = db_search_in_history_db($datelimit);
@ -4213,7 +4213,7 @@ function modules_get_min_max_data($id_agent_module, $time_init=0)
$data[0]['max'] = $min_max['max'];
} else {
// Search limits of the last two days.
$table = modules_get_table_data($id_agent_module);
$table = modules_get_table_data($id_agent_module, null);
$data = db_get_all_rows_sql(
'SELECT min(datos) as min, max(datos) as max
FROM '.$table.'

View File

@ -84,10 +84,7 @@ function get_notification_targets(int $id_message)
if (is_array($ret)) {
foreach ($ret as $row) {
array_push(
$targets['users'],
get_user_fullname($row['id_user'])
);
array_push($targets['users'], get_user_fullname($row['id_user']));
}
}
@ -227,8 +224,10 @@ function check_notification_readable(int $id_message)
*
* @return array [users] and [groups] with the targets.
*/
function get_notification_source_targets(int $id_source, ?string $subtype=null)
{
function get_notification_source_targets(
int $id_source,
?string $subtype=null
) {
$ret = [];
$filter = '';
@ -484,7 +483,8 @@ function notifications_add_group_to_source($source_id, $groups)
continue;
}
$res = $res && db_process_sql_insert(
$res = $res &&
db_process_sql_insert(
'tnotification_source_group',
[
'id_group' => $group,
@ -525,7 +525,8 @@ function notifications_add_users_to_source($source_id, $users)
continue;
}
$res = $res && db_process_sql_insert(
$res = $res &&
db_process_sql_insert(
'tnotification_source_user',
[
'id_user' => $user,
@ -551,7 +552,13 @@ function notifications_add_users_to_source($source_id, $users)
function notifications_get_group_source_not_configured($source_id)
{
$groups_selected = notifications_get_group_sources_for_select($source_id);
$all_groups = users_get_groups_for_select(false, 'AR', false, true, $groups_selected);
$all_groups = users_get_groups_for_select(
false,
'AR',
false,
true,
$groups_selected
);
return array_diff($all_groups, $groups_selected);
}
@ -566,12 +573,10 @@ function notifications_get_group_source_not_configured($source_id)
*/
function notifications_get_user_source_not_configured($source_id)
{
$users_selected = array_keys(notifications_get_user_sources_for_select($source_id));
$users = get_users(
'id_user',
['!id_user' => $users_selected],
['id_user']
$users_selected = array_keys(
notifications_get_user_sources_for_select($source_id)
);
$users = get_users('id_user', ['!id_user' => $users_selected], ['id_user']);
return index_array($users, 'id_user', 'id_user');
}
@ -587,8 +592,8 @@ function notifications_get_user_source_not_configured($source_id)
function notifications_build_user_enable_return($status, $enabled)
{
return [
'status' => ((bool) $status === true) ? 1 : 0,
'enabled' => ((bool) $enabled === true) ? 1 : 0,
'status' => (bool) $status === true ? 1 : 0,
'enabled' => (bool) $enabled === true ? 1 : 0,
];
}
@ -625,16 +630,11 @@ function notifications_get_user_label_status($source, $user, $label)
$common_groups = array_intersect(
array_keys(users_get_groups($user)),
array_keys(
notifications_get_group_sources_for_select($source['id'])
)
array_keys(notifications_get_group_sources_for_select($source['id']))
);
// No group found, return no permissions.
$value = empty($common_groups) ? false : $source[$label];
return notifications_build_user_enable_return(
$value,
false
);
return notifications_build_user_enable_return($value, false);
}
@ -681,13 +681,7 @@ function notifications_get_counters()
{
$num_notifications = 0;
$last_id = 0;
$last_message = messages_get_overview(
'timestamp',
'DESC',
false,
false,
1
);
$last_message = messages_get_overview('timestamp', 'DESC', false, false, 1);
if (!empty($last_message)) {
$num_notifications = messages_get_count();
$last_id = $last_message[0]['id_mensaje'];
@ -718,7 +712,9 @@ function notifications_get_counters()
function notifications_print_ball($num_notifications, $last_id)
{
$no_notifications = (int) $num_notifications === 0;
$class_status = ($no_notifications) ? 'notification-ball-no-messages' : 'notification-ball-new-messages';
$class_status = $no_notifications
? 'notification-ball-no-messages'
: 'notification-ball-new-messages';
return sprintf(
'<div
%s
@ -728,7 +724,7 @@ function notifications_print_ball($num_notifications, $last_id)
>
%s
</div>',
($no_notifications) ? '' : 'onclick="addNotifications(event)"',
$no_notifications ? '' : 'onclick="addNotifications(event)"',
$class_status,
$last_id,
$num_notifications
@ -799,7 +795,7 @@ function notifications_print_global_source_configuration($source)
'type' => 'switch',
'id' => 'nt-'.$source['id'].'.'.$type.'-subtype',
'class' => 'elem-clickable',
'value' => (isset($blacklist[$type]) === false),
'value' => isset($blacklist[$type]) === false,
'return' => true,
]
);
@ -833,14 +829,11 @@ function notifications_print_global_source_configuration($source)
*
* @return string HTML with the generated selector
*/
function notifications_print_source_select_box(
$info_selec,
$id,
$source_id
) {
$title = ($id === 'users') ? __('Notified users') : __('Notified groups');
$add_title = ($id === 'users') ? __('Add users') : __('Add groups');
$delete_title = ($id === 'users') ? __('Delete users') : __('Delete groups');
function notifications_print_source_select_box($info_selec, $id, $source_id)
{
$title = $id === 'users' ? __('Notified users') : __('Notified groups');
$add_title = $id === 'users' ? __('Add users') : __('Add groups');
$delete_title = $id === 'users' ? __('Delete users') : __('Delete groups');
// Generate the HTML.
return sprintf(
@ -873,11 +866,7 @@ function notifications_print_source_select_box(
true,
[
'title' => $add_title,
'onclick' => sprintf(
"add_source_dialog('%s', '%s')",
$id,
$source_id
),
'onclick' => sprintf("add_source_dialog('%s', '%s')", $id, $source_id),
]
),
html_print_image(
@ -1062,7 +1051,6 @@ function notifications_print_dropdown()
function notifications_print_dropdown_element($message_info)
{
$action = '';
switch ($message_info['description']) {
case 'Official&#x20;communication':
$action = 'show_modal(this.id);';

View File

@ -14,54 +14,190 @@
// Get critical agents by using the status code in modules.
function os_agents_critical($id_os)
{
// TODO REVIEW ORACLE AND POSTGRES
return db_get_sql(
"
SELECT COUNT(*)
FROM tagente
WHERE tagente.disabled=0 AND
critical_count>0 AND id_os=$id_os"
);
global $config;
$table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
if (users_is_admin() === true) {
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count>0 AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count>0 AND
id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
}
// Get ok agents by using the status code in modules.
function os_agents_ok($id_os)
{
return db_get_sql(
"
SELECT COUNT(*)
FROM tagente
WHERE tagente.disabled=0 AND
normal_count=total_count AND id_os=$id_os"
);
global $config;
$table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
if (users_is_admin() === true) {
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
normal_count=total_count AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
normal_count=total_count AND
id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
}
// Get warning agents by using the status code in modules.
function os_agents_warning($id_os)
{
return db_get_sql(
"
SELECT COUNT(*)
FROM tagente
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count>0 AND id_os=$id_os"
);
global $config;
$table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
if (users_is_admin() === true) {
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count>0
AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count>0 AND
id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
}
// Get unknown agents by using the status code in modules.
function os_agents_unknown($id_os)
{
return db_get_sql(
"
SELECT COUNT(*)
FROM tagente
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count=0 AND
unknown_count>0 AND id_os=$id_os"
);
global $config;
$table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
if (users_is_admin() === true) {
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count=0 AND
unknown_count>0 AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND
critical_count=0 AND warning_count=0 AND
unknown_count>0 AND id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
}
/**
* Get total agents
*
* @param integer $id_os OS id.
*
* @return array|boolean
*/
function os_agents_total(int $id_os)
{
global $config;
$table = (is_metaconsole() === true) ? 'tmetaconsole_agent' : 'tagente';
if (users_is_admin() === true) {
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND id_os=%d',
$table,
$id_os
)
);
} else {
$groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
return db_get_sql(
sprintf(
'SELECT COUNT(*)
FROM %s
WHERE tagente.disabled=0 AND id_os=%d AND id_grupo IN (%s)',
$table,
$id_os,
implode(',', $groups)
)
);
}
}

View File

@ -810,7 +810,7 @@ function reporting_make_reporting_data(
break;
}
$report['contents'][] = $report_control;
$report['contents'][] = $report_control;
break;
case 'event_report_module':
@ -826,7 +826,7 @@ function reporting_make_reporting_data(
break;
}
$report['contents'][] = $report_control;
$report['contents'][] = $report_control;
break;
case 'event_report_group':
@ -1943,6 +1943,8 @@ function reporting_event_report_group(
$event_filter = $content['style'];
$return['show_summary_group'] = $event_filter['show_summary_group'];
$return['show_custom_data'] = (isset($event_filter['custom_data_events']) === true) ? (bool) $event_filter['custom_data_events'] : false;
// Filter.
$show_summary_group = $event_filter['show_summary_group'];
$filter_event_severity = json_decode($event_filter['filter_event_severity'], true);
@ -2246,6 +2248,8 @@ function reporting_event_report_module(
$event_filter = $content['style'];
$return['show_summary_group'] = $event_filter['show_summary_group'];
$return['show_custom_data'] = (isset($event_filter['custom_data_events']) === true) ? (bool) $event_filter['custom_data_events'] : false;
// Filter.
$show_summary_group = $event_filter['show_summary_group'];
$filter_event_severity = json_decode(
@ -3779,6 +3783,8 @@ function reporting_event_report_agent(
$filter_event_status = json_decode($style['filter_event_status'], true);
$filter_event_filter_search = $style['event_filter_search'];
$filter_event_filter_exclude = $style['event_filter_exclude'];
$show_custom_data = (isset($style['custom_data_events']) === true) ? (bool) $style['custom_data_events'] : false;
$return['show_custom_data'] = $show_custom_data;
// Graph.
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
@ -3798,7 +3804,8 @@ function reporting_event_report_agent(
$filter_event_status,
$filter_event_filter_search,
$filter_event_filter_exclude,
$id_server
$id_server,
$show_custom_data
);
if (is_metaconsole() === true) {
@ -6954,7 +6961,7 @@ function sla_truncate($num, $accurancy=2)
*
* @param integer $value Value.
* @param integer $min Treshold min SLA.
* @param boolean $max Treshold max SLA.
* @param integer $max Treshold max SLA.
* @param boolean $inverse_interval Treshold inverse SLA.
*
* @return boolean Returns the interval in downtime (false if no matches).
@ -10594,7 +10601,8 @@ function reporting_get_agents_detailed_event(
$filter_event_status=false,
$filter_event_filter_search=false,
$filter_event_filter_exclude=false,
$id_server=0
$id_server=0,
$show_custom_data=false
) {
global $config;
@ -10651,6 +10659,7 @@ function reporting_get_agents_detailed_event(
'validated_by' => $e['id_usuario'],
'timestamp' => $e['timestamp_rep'],
'id_evento' => $e['id_evento'],
'custom_data' => ($show_custom_data === true) ? $e['custom_data'] : '',
];
} else {
$return_data[] = [
@ -10661,6 +10670,7 @@ function reporting_get_agents_detailed_event(
'validated_by' => $e['id_usuario'],
'timestamp' => $e['timestamp'],
'id_evento' => $e['id_evento'],
'custom_data' => ($show_custom_data === true) ? $e['custom_data'] : '',
];
}
}
@ -14739,8 +14749,10 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
if ($modules_is_string === false) {
if ($agentmodule_info['max_critical'] == 0) {
$max_value_critical = null;
if ((bool) $content['dinamic_proc'] === true) {
$max_value_critical = 0.01;
if ($agentmodule_info['min_critical'] == 0) {
if ((bool) $content['dinamic_proc'] === true) {
$max_value_critical = 0.01;
}
}
} else {
$max_value_critical = $agentmodule_info['max_critical'];

View File

@ -1025,6 +1025,7 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
global $config;
$show_extended_events = $item['show_extended_events'];
$show_custom_data = (bool) $item['show_custom_data'];
if ($item['total_events']) {
$table1 = new stdClass();
@ -1060,6 +1061,10 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
$table1->head[6] = __('Timestamp');
}
if ($show_custom_data === true) {
$table1->head[8] = __('Custom data');
}
foreach ($item['data'] as $k => $event) {
// First pass along the class of this row.
if ($item['show_summary_group']) {
@ -1132,6 +1137,16 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
$data[] = '<font class="font_6pt">'.date($config['date_format'], strtotime($event['timestamp'])).'</font>';
}
if ($show_custom_data === true) {
$custom_data = json_decode($event['custom_data'], true);
$custom_data_text = '';
foreach ($custom_data as $key => $value) {
$custom_data_text .= $key.' = '.$value.'<br>';
}
$data[] = $custom_data_text;
}
array_push($table1->data, $data);
if ($show_extended_events == 1 && events_has_extended_info($event['id_evento'])) {
@ -1246,10 +1261,10 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
function reporting_html_event_report_module($table, $item, $pdf=0)
{
global $config;
$show_extended_events = $item['show_extended_events'];
$show_summary_group = $item['show_summary_group'];
$show_custom_data = (bool) $item['show_custom_data'];
if ($item['total_events']) {
if (!empty($item['failed'])) {
$table->colspan['events']['cell'] = 3;
@ -1279,6 +1294,10 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
$table1->style[0] = 'text-align: center;';
}
if ($show_custom_data === true) {
$table1->head[6] = __('Custom data');
}
if (is_array($item['data']) || is_object($item['data'])) {
$item_data = array_reverse($item['data']);
}
@ -1331,6 +1350,16 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
$data[4] = date($config['date_format'], strtotime($event['timestamp']));
}
if ($show_custom_data === true) {
$custom_data = json_decode($event['custom_data'], true);
$custom_data_text = '';
foreach ($custom_data as $key => $value) {
$custom_data_text .= $key.' = '.$value.'<br>';
}
$data[6] = $custom_data_text;
}
$table1->data[] = $data;
if ($show_extended_events == 1 && events_has_extended_info($event['id_evento'])) {
@ -2341,6 +2370,13 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
$table1->align[0] = 'center';
$table1->align[1] = 'center';
$table1->align[3] = 'center';
if ((bool) $item['show_custom_data'] === true) {
if ($item['show_summary_group']) {
$table1->align[7] = 'left';
} else {
$table1->align[6] = 'left';
}
}
$table1->data = [];
@ -2355,6 +2391,9 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
$table1->head[4] = __('Severity');
$table1->head[5] = __('Val. by');
$table1->head[6] = __('Timestamp');
if ((bool) $item['show_custom_data'] === true) {
$table1->head[7] = __('Custom data');
}
foreach ($item['data'] as $i => $event) {
if ($item['show_summary_group']) {
@ -2420,6 +2459,16 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
$data[] = '<font class="font_6pt">'.date($config['date_format'], strtotime($event['timestamp'])).'</font>';
}
if ((bool) $item['show_custom_data'] === true) {
$custom_data = json_decode($event['custom_data'], true);
$custom_data_text = '';
foreach ($custom_data as $key => $value) {
$custom_data_text .= $key.' = '.$value.'<br>';
}
$data[] = $custom_data_text;
}
array_push($table1->data, $data);
if ($show_extended_events == 1 && events_has_extended_info($event['id_evento'])) {

View File

@ -5448,6 +5448,10 @@ function ui_print_agent_autocomplete_input($parameters)
'q' => 'term',
];
if (isset($parameters['delete_offspring_agents']) === true) {
$javascript_change_ajax_params_original['delete_offspring_agents'] = $parameters['delete_offspring_agents'];
}
if (!$metaconsole_enabled) {
$javascript_change_ajax_params_original['force_local'] = 1;
}

View File

@ -15,6 +15,8 @@ function pandoraFlotPie(
colors,
hide_labels
) {
height = parseInt(height);
labels = labels.split(separator);
var data = values.split(separator);
@ -79,11 +81,22 @@ function pandoraFlotPie(
break;
}
var discount = 20;
if (water_mark) {
discount = 40;
}
var plot = $.plot($("#" + graph_id), data, conf_pie);
var legends = $("#" + graph_id + " .legendLabel");
legends.css("font-size", font_size + "pt");
var tableDiv = $("#" + graph_id + " .legend > div");
tableDiv.css("max-height", height - discount + "px");
var tableLegend = $("#" + graph_id + " .legend table");
tableLegend.css("max-height", height - discount + "px");
// Events
$("#" + graph_id).bind("plothover", pieHover);
//$("#" + graph_id).bind("plotclick", pieClick);
@ -443,14 +456,15 @@ function pandoraFlotHBars(
"pt !important;" +
"margin: 0; max-width: 200px;" +
"margin-right:5px;" +
"margin-left: -1.5em" +
"text-align: right" +
"margin-left: -1.5em;" +
"text-align: right;" +
"text-overflow: ellipsis;" +
"overflow: hidden;" +
"white-space: pre;";
if (label.indexOf("<br>") != -1) {
div_attributes += "min-height: 2.5em;";
var label_array = label.split("<br>");
label = label_array[0] + label_array[1];
}
div_attributes += '" title="' + label + '" style="overflow: hidden;"';

View File

@ -150,7 +150,7 @@ function d3_tree_map_graph($data, $width=700, $height=700, $return=false)
}
function d3_sunburst_graph($data, $width=700, $height=700, $return=false)
function d3_sunburst_graph($data, $width=700, $height=700, $return=false, $tooltip=true)
{
global $config;
@ -167,7 +167,7 @@ function d3_sunburst_graph($data, $width=700, $height=700, $return=false)
}
</style>';
$output .= "<script language=\"javascript\" type=\"text/javascript\">
sunburst('#sunburst', $data, '$width', '$height');
sunburst('#sunburst', $data, '$width', '$height', '$tooltip');
</script>";
if (!$return) {

View File

@ -29,6 +29,12 @@ function chordDiagram(recipient, elements, matrix, width) {
var width = 700;
var margin = 150;
var padding = 0.02;
var consoleStyle = document.getElementById("hidden-selected_style_theme")
.value;
var textColor =
consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)";
var tooltipColor =
consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)";
function chart(selection) {
selection.each(function(data) {
@ -103,7 +109,6 @@ function chordDiagram(recipient, elements, matrix, width) {
const chords = chord.chords();
let aux = 0;
$.each(chords, function(key, value) {
console.log(aux);
if (aux < 5) {
if (
(value.source.index == i && value.target.subindex == i) ||
@ -159,6 +164,7 @@ function chordDiagram(recipient, elements, matrix, width) {
.attr("text-anchor", function(d) {
return d.angle > Math.PI ? "end" : null;
})
.attr("style", "fill: " + textColor)
.attr("transform", function(d) {
return (
"rotate(" +
@ -266,7 +272,12 @@ function chordDiagram(recipient, elements, matrix, width) {
$("#tooltip").attr(
"style",
"background: #fff;" +
"background: " +
tooltipColor +
";" +
"color: " +
textColor +
";" +
"position: absolute;" +
"display: inline-block;" +
"width: auto;" +
@ -393,6 +404,16 @@ function treeMap(recipient, data, width, height) {
var isIE = true;
var chartWidth = width;
var chartHeight = height;
var consoleStyle = document.getElementById("hidden-selected_style_theme")
.value;
$("#tooltip").css(
"color",
consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)"
);
$("#tooltip").css(
"background-color",
consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)"
);
if (width === "auto") {
chartWidth = $(recipient).innerWidth();
}
@ -761,6 +782,7 @@ function treeMap(recipient, data, width, height) {
$("#tooltip").attr(
"style",
"background: #fff;" +
"color: #111;" +
"position: absolute;" +
"display: block;" +
"width: 200px;" +
@ -796,7 +818,7 @@ function treeMap(recipient, data, width, height) {
// The area (or angle, depending on implementation) of each arc corresponds to its value.
// Sunburst design by John Stasko. Data courtesy Jeff Heer.
// http://bl.ocks.org/mbostock/4348373
function sunburst(recipient, data, width, height) {
function sunburst(recipient, data, width, height, tooltip = true) {
if (width === "auto") {
width = $(recipient).innerWidth();
}
@ -858,11 +880,14 @@ function sunburst(recipient, data, width, height) {
})
.style("cursor", "pointer")
.on("click", click)
.on("mouseover", over_user)
.on("mouseover", tooltip === "1" ? over_user : "")
.on("mouseout", out_user)
.on("mousemove", move_tooltip);
function computeTextRotation(d) {
if (d.type === "central_service") {
return 0;
}
var ang = ((x(d.x + d.dx / 2) - Math.PI / 2) / Math.PI) * 180;
return ang > 90 ? 180 + ang : ang;
}
@ -882,9 +907,18 @@ function sunburst(recipient, data, width, height) {
return computeTextRotation(d) > 180 ? -40 : -30;
})
.attr("dx", "6") // margin
.attr("dy", ".35em") // vertical-align
.attr("dy", function(d) {
if (d.type === "central_service") {
return "-7em";
}
return ".35em";
}) // vertical-align
.attr("opacity", function(d) {
if (typeof d.show_name != "undefined" && d.show_name) return 1;
if (
(typeof d.show_name != "undefined" && d.show_name) ||
d.type === "central_service"
)
return 1;
else return 0;
})
.text(function(d) {
@ -899,7 +933,11 @@ function sunburst(recipient, data, width, height) {
window.location.href = d.link;
} else {
// fade out all text elements
text.transition().attr("opacity", 0);
if (d.type === "central_service") {
text.transition().attr("opacity", 1);
} else {
text.transition().attr("opacity", 0);
}
path
.transition()
@ -965,8 +1003,8 @@ function sunburst(recipient, data, width, height) {
}
function move_tooltip(d) {
var x = d3.event.pageX + 10;
var y = d3.event.pageY + 10;
var x = d3.event.pageX + 10 - $("#menu_full").width();
var y = d3.event.pageY - 90;
$("#tooltip").css("left", x + "px");
$("#tooltip").css("top", y + "px");
@ -1007,6 +1045,7 @@ function sunburst(recipient, data, width, height) {
$("#tooltip").attr(
"style",
"background: #fff;" +
"color: #111;" +
"position: absolute;" +
"display: block;" +
"width: 200px;" +
@ -1017,10 +1056,10 @@ function sunburst(recipient, data, width, height) {
"-moz-box-shadow: 7px 7px 5px rgba(50, 50, 50, 0.75);" +
"box-shadow: 7px 7px 5px rgba(50, 50, 50, 0.75);" +
"left: " +
x +
100 +
"px;" +
"top: " +
y +
100 +
"px;"
);
}

View File

@ -2027,3 +2027,33 @@ function inArray(needle, haystack) {
}
return false;
}
/**
* Filter selector item by text based on a text input.
*
* @param {string} textbox Text input.
*
* @return {void}
*/
$.fn.filterByText = function(textbox) {
var select = this;
$(textbox).bind("change keyup", function() {
var search = $.trim($(textbox).val());
var regex = new RegExp(search, "gi");
$(select)
.find("option")
.each(function() {
if (
$(this)
.text()
.match(regex) !== null
) {
$(this).show();
} else {
$(this).hide();
}
});
});
};

View File

@ -849,7 +849,8 @@ function add_macro_field(macro, row_model_id, type_copy, k) {
$macro_field
.find("input")
.first()
.attr("name", macro_macro);
.attr("name", macro_macro)
.val(macro_value);
$macro_field.attr("class", "macro_field");

View File

@ -861,7 +861,7 @@ var TreeController = {
'<span><img class="invert_filter" src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") +
'images/help.png" class="img_help" title="' +
element.name +
(element.title ? element.title : element.name) +
'" alt="' +
element.name +
'"/></span> ';
@ -1314,6 +1314,7 @@ var TreeController = {
serverID: element.serverID,
rootType: element.rootType,
metaID: element.metaID,
title: element.title,
filter: controller.filter,
auth_class: controller.auth_class,
id_user: controller.id_user,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -384,7 +384,7 @@ final class DBMaintainer
*
* @return boolean Success or not.
*/
private function setConfigToken(string $token, $value)
public function setConfigToken(string $token, $value)
{
$prev = $this->getValue('tconfig', 'value', ['token' => $token]);
// If failed or not found, then insert.

View File

@ -412,6 +412,10 @@ class Widget
$className .= '\WuxWidget';
break;
case 'os_quick_report':
$className .= '\OsQuickReportWidget';
break;
default:
$className = false;
break;

View File

@ -0,0 +1,350 @@
<?php
/**
* Widget Tree view Pandora FMS Console
*
* @category Console Class
* @package Pandora FMS
* @subpackage Widget Tree view
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
namespace PandoraFMS\Dashboard;
/**
* OS quick report Widgets.
*/
class OsQuickReportWidget extends Widget
{
/**
* Name widget.
*
* @var string
*/
protected $name;
/**
* Title widget.
*
* @var string
*/
protected $title;
/**
* Page widget;
*
* @var string
*/
protected $page;
/**
* Class name widget.
*
* @var [type]
*/
protected $className;
/**
* Values options for each widget.
*
* @var [type]
*/
protected $values;
/**
* Configuration required.
*
* @var boolean
*/
protected $configurationRequired;
/**
* Error load widget.
*
* @var boolean
*/
protected $loadError;
/**
* Width.
*
* @var integer
*/
protected $width;
/**
* Heigth.
*
* @var integer
*/
protected $height;
/**
* Dashboard ID.
*
* @var integer
*/
protected $dashboardId;
/**
* Cell ID.
*
* @var integer
*/
protected $cellId;
/**
* Construct.
*
* @param integer $cellId Cell ID.
* @param integer $dashboardId Dashboard ID.
* @param integer $widgetId Widget ID.
* @param integer|null $width New width.
* @param integer|null $height New height.
*/
public function __construct(
int $cellId,
int $dashboardId=0,
int $widgetId=0,
?int $width=0,
?int $height=0
) {
global $config;
// Includes.
enterprise_include_once('/include/functions_services.php');
enterprise_include_once('/include/functions_servicemap.php');
// WARNING: Do not edit. This chunk must be in the constructor.
parent::__construct(
$cellId,
$dashboardId,
$widgetId
);
// Width.
$this->width = $width;
// Height.
$this->height = $height;
// Cell Id.
$this->cellId = $cellId;
// Widget ID.
$this->widgetId = $widgetId;
// Dashboard ID.
$this->dashboardId = $dashboardId;
// Options.
$this->values = $this->decoders($this->getOptionsWidget());
// Positions.
$this->position = $this->getPositionWidget();
// Page.
$this->page = basename(__FILE__);
// ClassName.
$class = new \ReflectionClass($this);
$this->className = $class->getShortName();
// Title.
$this->title = __('OS quick report');
// Name.
if (empty($this->name) === true) {
$this->name = 'os_quick_report';
}
$this->overflow_scrollbars = false;
}
/**
* Decoders hack for retrocompability.
*
* @param array $decoder Values.
*
* @return array Returns the values with the correct key.
*/
public function decoders(array $decoder): array
{
$values = [];
// Retrieve global - common inputs.
$values = parent::decoders($decoder);
return $values;
}
/**
* Generates inputs for form (specific).
*
* @return array Of inputs.
*
* @throws Exception On error.
*/
public function getFormInputs(): array
{
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
return $inputs;
}
/**
* Get Post for widget.
*
* @return array
*/
public function getPost():array
{
// Retrieve global - common inputs.
$values = parent::getPost();
return $values;
}
/**
* Draw widget.
*
* @return string;
*/
public function load()
{
global $config;
$values = $this->values;
$result = [];
$os_array = os_get_os();
foreach ($os_array as $os) {
$id_os = (int) $os['id_os'];
$total = os_agents_total($id_os);
if ((int) $total === 0) {
continue;
}
$result[$id_os]['name'] = $os['name'];
$result[$id_os]['total'] = (int) $total;
$result[$id_os]['normal'] = (int) os_agents_ok($id_os);
$result[$id_os]['critical'] = (int) os_agents_critical($id_os);
$result[$id_os]['unknown'] = (int) os_agents_unknown($id_os);
}
$output = '';
if (empty($result) === false) {
$table = new \stdClass();
$table->class = 'info_table';
$table->width = '100%';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->size = [];
$table->size[0] = '10%';
$table->size[1] = '10%';
$table->size[2] = '20%';
$table->size[3] = '20%';
$table->size[4] = '20%';
$table->size[5] = '20%';
$table->align = [];
$table->align[0] = 'center';
$table->align[1] = 'left';
$table->align[2] = 'center';
$table->align[3] = 'center';
$table->align[4] = 'center';
$table->align[5] = 'center';
$table->head = [];
$table->head[0] = __('OS');
$table->head[1] = __('OS name');
$table->head[2] = ucfirst(__('total agents'));
$table->head[3] = ucfirst(__('normal agents'));
$table->head[4] = ucfirst(__('critical agents'));
$table->head[5] = ucfirst(__('unknown agents'));
$table->headstyle = [];
$table->headstyle[0] = 'text-align:center;background-color: '.$values['background'];
$table->headstyle[1] = 'background-color: '.$values['background'];
$table->headstyle[2] = 'text-align:center;background-color: '.$values['background'];
$table->headstyle[3] = 'text-align:center;background-color: '.$values['background'];
$table->headstyle[4] = 'text-align:center;background-color: '.$values['background'];
$table->headstyle[5] = 'text-align:center;background-color: '.$values['background'];
$table->style = [];
$table->style[0] = 'background-color: '.$values['background'];
$table->style[1] = 'background-color: '.$values['background'];
$table->style[2] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[3] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[4] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[5] = 'font-size: 22px;background-color: '.$values['background'];
foreach ($result as $id => $os) {
$data = [];
$data[0] = ui_print_os_icon($id, false, true);
$data[1] = $os['name'];
$data[2] = $os['total'];
$data[3] = $os['normal'];
$data[4] = $os['critical'];
$data[5] = $os['unknown'];
$table->data[] = $data;
}
$output = html_print_table($table, true);
} else {
$output = 'No data available';
}
return $output;
}
/**
* Get description.
*
* @return string.
*/
public static function getDescription()
{
return __('OS quick report');
}
/**
* Get Name.
*
* @return string.
*/
public static function getName()
{
return 'os_quick_report';
}
}

View File

@ -235,6 +235,10 @@ class ServiceMapWidget extends Widget
$values['showLegend'] = $decoder['showLegend'];
}
if (isset($decoder['sunburst']) === true) {
$values['sunburst'] = $decoder['sunburst'];
}
return $values;
}
@ -268,7 +272,20 @@ class ServiceMapWidget extends Widget
$fields = array_reduce(
$services_res,
function ($carry, $item) {
$carry[$item['id']] = $item['name'];
$parents = '';
if (class_exists('\PandoraFMS\Enterprise\Service') === true) {
try {
$service = new \PandoraFMS\Enterprise\Service($item['id']);
$ancestors = $service->getAncestors();
if (empty($ancestors) === false) {
$parents = '('.join('/', $ancestors).')';
}
} catch (\Exception $e) {
$parents = '';
}
}
$carry[$item['id']] = $item['name'].' '.$parents;
return $carry;
},
[]
@ -296,19 +313,16 @@ class ServiceMapWidget extends Widget
],
];
// TODO refactoriced services: Hidden legend.
/*
// Show legend.
$inputs[] = [
'label' => __('Show legend'),
$inputs[] = [
'label' => __('Enable sunburst'),
'arguments' => [
'name' => 'showLegend',
'id' => 'showLegend',
'type' => 'switch',
'value' => $values['showLegend'],
'type' => 'switch',
'name' => 'sunburst',
'class' => 'event-widget-input',
'value' => $values['sunburst'],
'return' => true,
],
];
*/
];
return $inputs;
}
@ -325,7 +339,9 @@ class ServiceMapWidget extends Widget
$values = parent::getPost();
$values['serviceId'] = \get_parameter('serviceId', 0);
// $values['showLegend'] = \get_parameter_switch('showLegend');
$values['sunburst'] = \get_parameter_switch('sunburst', 0);
return $values;
}
@ -341,6 +357,7 @@ class ServiceMapWidget extends Widget
$size = parent::getSize();
$output = '';
if (check_acl($config['id_user'], 0, 'AR') === 0) {
$output .= '<div class="container-center">';
$output .= \ui_print_error_message(
@ -367,42 +384,6 @@ class ServiceMapWidget extends Widget
$style = 'position: relative; text-align: center;';
$output .= "<div id='".$containerId."' style='".$style."'>";
// TODO refactoriced services: Hidden legend.
/*
if ($this->values['showLegend'] === 1) {
$output .= "<div id='container_servicemap_legend".$this->values['serviceId'].'_'.$this->cellId."'>";
$output .= '<table>';
$output .= "<tr class='legend_servicemap_title'><td colspan='3' style='padding-bottom: 10px; min-width: 177px;'><b>".__('Legend').'</b></td>';
$output .= "<td><img class='legend_servicemap_toggle' style='padding-bottom: 10px;' src='images/darrowup.png'></td></tr>";
$output .= "<tr class='legend_servicemap_item'><td>";
$output .= "<img src='images/service.png'>";
$output .= '</td><td>'.__('Services').'</td>';
// Coulour legend.
$output .= "<td rowspan='3'>";
$output .= '<table>';
$output .= "<tr><td class='legend_square'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Critical').'</td></tr>';
$output .= "<tr><td class='legend_square'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Warning').'</td></tr>';
$output .= "<tr><td class='legend_square'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Ok').'</td></tr>';
$output .= "<tr><td class='legend_square'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Unknown').'</td></tr>';
$output .= '</table>';
$output .= '</td></tr>';
$output .= "<tr class='legend_servicemap_item'><td>";
$output .= "<img src='images/agent.png'>";
$output .= '</td><td>'.__('Agents').'</td>';
$output .= '</tr>';
$output .= "<tr class='legend_servicemap_item'><td>";
$output .= "<img src='images/module.png'>";
$output .= '</td><td>'.__('Modules').'</td>';
$output .= '</tr>';
$output .= '</table>';
$output .= '</div>';
}
*/
// TODO: removed refactoriced services. Only 1 widget Zoom.
$sql = sprintf(
'SELECT COUNT(*)
@ -425,14 +406,21 @@ class ServiceMapWidget extends Widget
);
// TODO:XXX fix draw service map.
ob_start();
servicemap_print_servicemap(
$this->values['serviceId'],
false,
$size['width'],
$size['height'],
$this->cellId,
$disableZoom
);
if ($this->values['sunburst'] === 0) {
servicemap_print_servicemap(
$this->values['serviceId'],
false,
$size['width'],
$size['height'],
$this->cellId,
$disableZoom
);
} else {
include_once $config['homedir'].'/include/graphs/functions_d3.php';
servicemap_print_sunburst($this->values['serviceId'], $size['width'], $size['height'], false);
}
$output .= ob_get_clean();
$output .= '</div>';
return $output;

View File

@ -258,8 +258,8 @@ class TopNWidget extends Widget
// Order.
$fields = [
1 => __('Descending'),
2 => __('Ascending'),
1 => __('Ascending'),
2 => __('Descending'),
3 => __('By agent name'),
];
@ -466,7 +466,7 @@ class TopNWidget extends Widget
];
foreach ($modules as $module) {
$module['aliasAgent'] = ui_print_truncate_text($module['aliasAgent'], 20);
$module['aliasAgent'] = ui_print_truncate_text($module['aliasAgent'], 20, false, true, false);
$item_name = $module['aliasAgent'].' - '.$module['nameModule'];
$data_hbar[$item_name]['g'] = $module[$display];
// Calculation of max-min values for show in graph.

View File

@ -5,18 +5,18 @@
table-layout: fixed;
}
.agents_modules_table .next_previous_step {
.next_previous_step {
width: 0.1%;
}
.agents_modules_table .header_table_principal_cell {
text-align: right !important;
.header_table_principal_cell {
text-align: left !important;
padding-right: 13px;
width: 20%;
width: 5%;
}
.agents_modules_table .header_table_caption_cell {
height: 200px;
.header_table_caption_cell {
text-align: center !important;
}
.agents_modules_table .position_text_module {

View File

@ -33,7 +33,6 @@ form.flex-row ul {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
align-content: center;
justify-content: space-between;
flex: 1;
@ -116,6 +115,7 @@ table.dataTable tbody td {
padding-top: 7px;
padding-bottom: 7px;
border-bottom: 2px solid #dedede;
word-break: break-all;
}
.filter_input {
@ -316,3 +316,31 @@ div.multi-response-buttons {
.event_detail_tab_menu li {
max-width: 160px;
}
.select_tags {
width: 200px;
}
@media screen and (max-width: 1400px) {
.select_tags {
width: 165px;
}
}
@media screen and (max-width: 1250px) {
.select_tags {
width: 125px;
}
}
@media screen and (max-width: 1100px) {
.select_tags {
width: 100px;
}
form.flex-row div.filter_input.large {
flex: 1;
min-width: 600px;
max-width: 100%;
}
}

View File

@ -399,7 +399,8 @@ ul li {
}
.logo_green {
height: 60px;
background-color: #fff;
min-height: 60px;
display: flex;
justify-content: center;
align-items: center;

View File

@ -814,6 +814,13 @@ select:-internal-list-box {
.margin-left-2 {
margin-left: 2em;
}
.margin-right-05 {
margin-right: 0.5em;
}
.margin-left-05 {
margin-left: 0.5em;
}
.no-border {
border: none;
}
@ -6048,9 +6055,9 @@ table.table_modal_alternate tr td:first-child {
font-family: "lato" !important;
}
.flot-text {
width: 100%;
font-family: inherit !important;
.flot-text .flot-x-axis div {
white-space: normal;
word-break: break-all;
}
/*Font header feedback*/
@ -6226,6 +6233,9 @@ div.graph td.legendLabel {
div.graph div.legend div,
div.graph div.legend table {
top: 25px !important;
display: block;
overflow: auto;
text-align: left;
}
.rotate_text_module {
@ -9018,3 +9028,29 @@ div#err_msg_centralised {
#reset-styles var {
font-style: italic;
}
.div-col {
width: 33%;
display: flex;
flex-direction: row;
align-items: center;
padding-top: 15px;
}
.div-span {
width: 25%;
}
.div-input {
width: 75%;
}
@media screen and (max-width: 1369px) {
.div-col {
width: 50%;
display: flex;
flex-direction: row;
align-items: center;
padding-top: 15px;
}
}

View File

@ -65,6 +65,9 @@ table.agent_info_table tr {
color: #fff !important;
}
.logo_green {
background-color: #000;
}
#um-next:hover,
#um-last:hover {
border: 1px solid #888 !important;
@ -340,8 +343,8 @@ a.pandora_pagination {
/* firts_task.css */
.new_task,
div.new_task_cluster,
div.new_task_cluster > div {
div.new_task,
div.new_task > div {
background-color: #222;
}
@ -1186,13 +1189,9 @@ a.pandora_pagination,
}
#box_online {
background-image: url("../../images/update_pandora_black.jpg") !important;
background-position: left, left !important;
background-repeat: no-repeat;
background-color: #000 !important;
padding: 40px 50px;
border: 1px solid #111 !important;
border-radius: 5px;
min-height: 600px;
background-size: contain;
box-shadow: 1px 1px 4px rgba(160, 160, 160, 0.514);
}

View File

@ -29,7 +29,7 @@ input[type="button"].submit-next {
background: #fff;
padding: 5px;
font-size: 1.3em;
margin: 0.5em 1em 0.5em 0;
margin: 0.5em 0em;
cursor: pointer;
text-align: center;
height: 30px;
@ -71,7 +71,7 @@ div.submit_buttons_container {
position: relative;
margin: 10px auto 0px;
bottom: 0px;
width: 90%;
width: 95%;
clear: both;
height: 4em;
}

View File

@ -1,4 +1,5 @@
<?php
/**
* Index.
*
@ -53,8 +54,8 @@ $develop_bypass = 0;
if ($develop_bypass != 1) {
// If no config file, automatically try to install.
if (! file_exists('include/config.php')) {
if (! file_exists('install.php')) {
if (!file_exists('include/config.php')) {
if (!file_exists('install.php')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url = 0;
foreach ($url as $key => $value) {
@ -128,8 +129,8 @@ if ($develop_bypass != 1) {
}
}
if ((! file_exists('include/config.php'))
|| (! is_readable('include/config.php'))
if ((!file_exists('include/config.php'))
|| (!is_readable('include/config.php'))
) {
$login_screen = 'error_noconfig';
include 'general/error_screen.php';
@ -224,9 +225,9 @@ ob_start('ui_process_page_head');
enterprise_include_once('index.php');
echo '<script type="text/javascript">';
echo 'var dispositivo = navigator.userAgent.toLowerCase();';
echo 'if( dispositivo.search(/iphone|ipod|ipad|android/) > -1 ){';
echo 'document.location = "'.ui_get_full_url('/mobile').'"; }';
echo 'var dispositivo = navigator.userAgent.toLowerCase();';
echo 'if( dispositivo.search(/iphone|ipod|ipad|android/) > -1 ){';
echo 'document.location = "'.ui_get_full_url('/mobile').'"; }';
echo '</script>';
// This tag is included in the buffer passed to ui_process_page_head so
@ -275,7 +276,7 @@ if (strlen($search) > 0) {
// Login process.
enterprise_include_once('include/auth/saml.php');
if (! isset($config['id_user'])) {
if (!isset($config['id_user'])) {
// Clear error messages.
unset($_COOKIE['errormsg']);
setcookie('errormsg', null, -1);
@ -731,9 +732,9 @@ if (! isset($config['id_user'])) {
}
// Boolean parameters.
$correct_pass_change = (boolean) get_parameter('correct_pass_change', false);
$reset = (boolean) get_parameter('reset', false);
$first = (boolean) get_parameter('first', false);
$correct_pass_change = (bool) get_parameter('correct_pass_change', false);
$reset = (bool) get_parameter('reset', false);
$first = (bool) get_parameter('first', false);
// Strings.
$reset_hash = get_parameter('reset_hash');
$pass1 = get_parameter_post('pass1');
@ -955,7 +956,7 @@ if (! isset($config['id_user'])) {
exit('</html>');
} else {
if (((bool) $user_in_db['is_admin'] === false)
&& ( (bool) $user_in_db['not_login'] === true
&& ((bool) $user_in_db['not_login'] === true
|| (is_metaconsole() === false
&& has_metaconsole() === true
&& is_management_allowed() === false
@ -1170,7 +1171,7 @@ if (has_metaconsole() === true
$err .= '</div>';
?>
<script type="text/javascript">
$(document).ready(function () {
$(document).ready(function() {
infoMessage({
title: '<?php echo __('Warning'); ?>',
text: '<?php echo $err; ?>',
@ -1208,7 +1209,7 @@ if ($searchPage) {
$main_sec = $sec;
}
} else if ($sec == 'gextensions') {
$main_sec = get_parameter('extension_in_menu');
$main_sec = get_parameter('extension_in_menu');
if (empty($main_sec) === true) {
$main_sec = $sec;
}
@ -1379,12 +1380,12 @@ if ($config['pure'] == 0) {
// Main pure.
}
html_print_div(
echo html_print_div(
['id' => 'wiz_container'],
true
);
html_print_div(
echo html_print_div(
['id' => 'um_msg_receiver'],
true
);
@ -1426,26 +1427,27 @@ require 'include/php_to_js_values.php';
?>
<script type="text/javascript" language="javascript">
// When there are less than 5 rows, all rows must be white
var theme = "<?php echo $config['style']; ?>";
if(theme === 'pandora'){
if($('table.info_table tr').length < 5){
if (theme === 'pandora') {
if ($('table.info_table tr').length < 5) {
$('table.info_table tbody > tr').css('background-color', '#fff');
}
}
// When the user scrolls down 400px from the top of the document, show the
// button.
window.onscroll = function() {scrollFunction()};
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 400 || document.documentElement.scrollTop > 400) {
if(document.getElementById("top_btn")){
if (document.getElementById("top_btn")) {
document.getElementById("top_btn").style.display = "block";
}
} else {
if(document.getElementById("top_btn")){
if (document.getElementById("top_btn")) {
document.getElementById("top_btn").style.display = "none";
}
}
@ -1455,48 +1457,49 @@ require 'include/php_to_js_values.php';
function topFunction() {
/*
* Safari.
* document.body.scrollTop = 0;
* For Chrome, Firefox, IE and Opera.
* document.documentElement.scrollTop = 0;
*/
* Safari.
* document.body.scrollTop = 0;
* For Chrome, Firefox, IE and Opera.
* document.documentElement.scrollTop = 0;
*/
$("HTML, BODY").animate({ scrollTop: 0 }, 500);
$("HTML, BODY").animate({
scrollTop: 0
}, 500);
}
// Initial load of page.
$(document).ready(adjustFooter);
// Every resize of window.
$(window).resize(adjustFooter);
// Every show/hide call may need footer re-layout.
(function() {
var oShow = jQuery.fn.show;
var oHide = jQuery.fn.hide;
jQuery.fn.show = function () {
jQuery.fn.show = function() {
var rv = oShow.apply(this, arguments);
adjustFooter();
return rv;
};
jQuery.fn.hide = function () {
jQuery.fn.hide = function() {
var rv = oHide.apply(this, arguments);
adjustFooter();
return rv;
};
})();
function first_time_identification () {
jQuery.post ("ajax.php",
{
function first_time_identification() {
jQuery.post("ajax.php", {
"page": "general/register",
"load_wizards": 'initial'
},
function (data) {
$('#wiz_container').empty ()
.html (data);
run_configuration_wizard ();
function(data) {
$('#wiz_container').empty()
.html(data);
run_configuration_wizard();
},
"html"
);
@ -1512,42 +1515,42 @@ require 'include/php_to_js_values.php';
);
return;
}
jQuery.post ("ajax.php",
{
jQuery.post("ajax.php", {
"page": "godmode/setup/setup_notifications",
"get_notification": 1,
"id": match[2]
},
function (data) {
function(data) {
notifications_hide();
try {
var json = JSON.parse(data);
$('#um_msg_receiver')
.empty ()
.html (json.mensaje);
.empty()
.html(json.mensaje);
$('#um_msg_receiver').prop('title', json.subject);
// Launch modal.
$("#um_msg_receiver").dialog({
resizable: true,
draggable: true,
modal: true,
width: 800,
buttons: [
{
text: "OK",
click: function() {
$( this ).dialog( "close" );
}
height: 600,
buttons: [{
text: "OK",
click: function() {
$(this).dialog("close");
}
],
}],
overlay: {
opacity: 0.5,
background: "black"
},
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
}
});
$(".ui-widget-overlay").css("background", "#000");
@ -1563,30 +1566,30 @@ require 'include/php_to_js_values.php';
);
}
//Dynamically assign footer position and width.
function adjustFooter() {
/*
if (document.readyState !== 'complete' || $('#container').position() == undefined) {
return;
//Dynamically assign footer position and width.
function adjustFooter() {
/*
if (document.readyState !== 'complete' || $('#container').position() == undefined) {
return;
}
// minimum top value (upper limit) for div#foot
var ulim = $('#container').position().top + $('#container').outerHeight(true);
// window height. $(window).height() returns wrong value on Opera and Google Chrome.
var wh = document.documentElement.clientHeight;
// save div#foot's height for latter use
var h = $('#foot').height();
// new top value for div#foot
var t = (ulim + $('#foot').outerHeight() > wh) ? ulim : wh - $('#foot').outerHeight();
/*
if ($('#foot').position().top != t) {
$('#foot').css({ position: "absolute", top: t, left: $('#foot').offset().left});
$('#foot').height(h);
}
if ($('#foot').width() != $(window).width()) {
$('#foot').width($(window).width());
}
*/
}
// minimum top value (upper limit) for div#foot
var ulim = $('#container').position().top + $('#container').outerHeight(true);
// window height. $(window).height() returns wrong value on Opera and Google Chrome.
var wh = document.documentElement.clientHeight;
// save div#foot's height for latter use
var h = $('#foot').height();
// new top value for div#foot
var t = (ulim + $('#foot').outerHeight() > wh) ? ulim : wh - $('#foot').outerHeight();
/*
if ($('#foot').position().top != t) {
$('#foot').css({ position: "absolute", top: t, left: $('#foot').offset().left});
$('#foot').height(h);
}
if ($('#foot').width() != $(window).width()) {
$('#foot').width($(window).width());
}
*/
}
</script>
<?php
if (__PAN_XHPROF__ === 1) {

View File

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

View File

@ -249,26 +249,21 @@ echo '<form method="post" action="?sec=view&sec2=operation/agentes/estado_agente
echo '<table cellpadding="4" cellspacing="4" class="databox filters bolder mrgn_btn_10px" width="100%">';
echo '<tr><td class="nowrap mw180px padding-right-2-imp">';
echo '<tr><td class="nowrap w100px padding-right-2-imp">';
echo __('Group').'&nbsp;';
echo __('Group').'&nbsp;'.'&nbsp;'.'&nbsp;';
$groups = users_get_groups(false, $access);
html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', false, false, true, '', false);
echo '</td><td class="nowrap">';
echo '</td><td class="nowrap">'.'&nbsp;'.'&nbsp;'.'&nbsp;'.'&nbsp;'.'&nbsp;';
echo __('Recursion').'&nbsp;';
echo __('Recursion').'&nbsp;'.'&nbsp;'.'&nbsp;';
html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()');
echo '</td><td class="nowrap">';
echo __('Search').'&nbsp;';
html_print_input_text('search', $search, '', 15);
echo '</td><td class="nowrap">';
$fields = [];
$fields[AGENT_STATUS_NORMAL] = __('Normal');
$fields[AGENT_STATUS_WARNING] = __('Warning');
@ -277,12 +272,17 @@ $fields[AGENT_STATUS_UNKNOWN] = __('Unknown');
$fields[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$fields[AGENT_STATUS_NOT_INIT] = __('Not init');
echo __('Status').'&nbsp;';
echo __('Status').'&nbsp;'.'&nbsp;'.'&nbsp;';
html_print_select($fields, 'status', $status, 'this.form.submit()', __('All'), AGENT_STATUS_ALL, false, false, true, '', false, 'width: 90px;');
echo '</td><td class="nowrap">';
echo '</td><td class="nowrap w100px">';
echo __('Search in custom fields').'&nbsp;';
echo __('Search').'&nbsp;'.'&nbsp;'.'&nbsp;';
html_print_input_text('search', $search, '', 15);
echo '</td><td class="nowrap w100px">';
echo __('Search in custom fields').'&nbsp;'.'&nbsp;'.'&nbsp;';
html_print_input_text('search_custom', $search_custom, '', 15);
echo '</td><td class="nowrap">';

View File

@ -265,6 +265,27 @@ if ($has_remote_conf) {
['class' => 'invert_filter']
);
$remote_cfg .= __('Remote configuration enabled').'</p>';
$satellite_server = (int) db_get_value_filter(
'satellite_server',
'tagente',
['id_agente' => $id_agente]
);
if (empty($satellite_server) === false) {
$satellite_name = db_get_value_filter(
'name',
'tserver',
['id_server' => $satellite_server]
);
$remote_cfg .= '<p>'.html_print_image(
'images/satellite.png',
true,
['class' => 'invert_filter']
);
$remote_cfg .= $satellite_name.'</p>';
}
} else {
$remote_cfg = '';
}

File diff suppressed because it is too large Load Diff

View File

@ -697,6 +697,15 @@ if (is_ajax()) {
asort($result);
} else {
if ($idAgents[0] < 0) {
// Get all user's groups.
$id_group = array_keys(users_get_groups($config['id_user']));
if (is_array($id_group)) {
$id_group = implode(',', $id_group);
}
$where_tags .= ' AND tagente.id_grupo IN ('.$id_group.')';
if ($selection_mode == 'common') {
$sql_agent_total = 'SELECT count(*) FROM tagente WHERE disabled=0';
$agent_total = db_get_value_sql($sql_agent_total);
@ -705,13 +714,13 @@ if (is_ajax()) {
JOIN (SELECT COUNT(*) AS num_names, nombre FROM tagente_modulo
WHERE disabled=0 AND delete_pending=0 GROUP BY nombre) AS tj
ON tj.num_names = $agent_total AND tj.nombre = t1.nombre %s %s",
$sql_tags_join,
($sql_tags_join === '') ? 'INNER JOIN tagente ON tagente.id_agente = t1.id_agente' : '',
(empty($where_tags)) ? '' : " WHERE 1=1 $where_tags"
);
} else {
$sql = sprintf(
'SELECT t1.nombre, t1.id_agente_modulo FROM tagente_modulo t1 %s %s',
$sql_tags_join,
($sql_tags_join === '') ? 'INNER JOIN tagente ON tagente.id_agente = t1.id_agente' : '',
(empty($where_tags)) ? '' : " WHERE 1=1 $where_tags"
);
}
@ -1403,7 +1412,7 @@ if ($agent_interfaces_count > 0) {
]
).'</a>';
if ($tab == 'interface') {
if ($tab === 'interface') {
$interfacetab['active'] = true;
} else {
$interfacetab['active'] = false;
@ -1420,19 +1429,19 @@ $alerttab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_ag
]
).'</a>';
if ($tab == 'alert') {
if ($tab === 'alert') {
$alerttab['active'] = true;
} else {
$alerttab['active'] = false;
}
// Inventory.
$inventoryCount = db_get_num_rows('SELECT id_agent_module_inventory FROM tagent_module_inventory WHERE id_agente = '.$agent['id_agente']);
$inventorytab = enterprise_hook('inventory_tab');
if ($inventorytab == -1) {
if ($inventorytab == -1 || $inventoryCount === 0) {
$inventorytab = '';
}
// Collection.
$collectiontab = enterprise_hook('collection_tab');
if ($collectiontab == -1) {

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -46,19 +46,19 @@ check_login();
enterprise_include_once('/include/class/CommandCenter.class.php');
$event_a = check_acl($config['id_user'], 0, 'ER');
$event_w = check_acl($config['id_user'], 0, 'EW');
$event_m = check_acl($config['id_user'], 0, 'EM');
$event_a = (bool) check_acl($config['id_user'], 0, 'ER');
$event_w = (bool) check_acl($config['id_user'], 0, 'EW');
$event_m = (bool) check_acl($config['id_user'], 0, 'EM');
if (! $event_a
&& ! $event_w
&& ! $event_m
if ($event_a === false
&& $event_w === false
&& $event_m === false
) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access event viewer'
);
if (is_ajax()) {
if (is_ajax() === true) {
return ['error' => 'noaccess'];
}
@ -67,14 +67,14 @@ if (! $event_a
}
$access = ($event_a == true) ? 'ER' : (($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'ER'));
$access = ($event_a === true) ? 'ER' : (($event_w === true) ? 'EW' : (($event_m === true) ? 'EM' : 'ER'));
$readonly = false;
if (is_metaconsole() === false
&& isset($config['event_replication'])
&& $config['event_replication'] == 1
&& $config['show_events_in_local'] == 1
&& isset($config['event_replication']) === true
&& (int) $config['event_replication'] === 1
&& (int) $config['show_events_in_local'] === 1
) {
$readonly = true;
}
@ -100,7 +100,7 @@ $default_filter = [
];
$fb64 = get_parameter('fb64', null);
if (isset($fb64)) {
if (isset($fb64) === true) {
$filter = json_decode(base64_decode($fb64), true);
$filter['tag_with'] = [];
$filter['tag_without'] = [];
@ -238,20 +238,20 @@ $custom_data = get_parameter(
if (is_metaconsole() === true) {
// Connect to node database.
$id_node = $server_id;
if ($id_node != 0) {
if (metaconsole_connect(null, $id_node) != NOERR) {
$id_node = (int) $server_id;
if ($id_node !== 0) {
if (metaconsole_connect(null, $id_node) !== NOERR) {
return false;
}
}
}
if (empty($text_agent) && empty($id_agent) === false) {
if (empty($text_agent) === true && empty($id_agent) === false) {
$text_agent = agents_get_alias($id_agent);
}
if (empty($text_module) && empty($id_agent_module) === false) {
if (empty($text_module) === true && empty($id_agent_module) === false) {
$text_module = modules_get_agentmodule_name($id_agent_module);
$text_agent = agents_get_alias(modules_get_agentmodule_agent($id_agent_module));
}
@ -375,20 +375,17 @@ if (is_ajax() === true) {
}
$tmp->evento = str_replace('"', '', io_safe_output($tmp->evento));
if (strlen($tmp->evento) >= 255) {
$tmp->evento = ui_print_truncate_text($tmp->evento, 255, $tmp->evento, true, false);
}
if ($tmp->module_name) {
if (empty($tmp->module_name) === false) {
$tmp->module_name = io_safe_output($tmp->module_name);
}
if ($tmp->comments) {
if (empty($tmp->comments) === false) {
$tmp->comments = ui_print_comments($tmp->comments);
}
// Show last event.
if (isset($tmp->max_id_evento) && $tmp->max_id_evento !== $tmp->id_evento) {
if (isset($tmp->max_id_evento) === true && $tmp->max_id_evento !== $tmp->id_evento) {
$max_event = db_get_row_sql(
sprintf(
'SELECT criticity, timestamp FROM %s
@ -501,7 +498,7 @@ if ($load_filter_id === 0) {
// Do not load the user filter if we come from the 24h event graph.
$from_event_graph = get_parameter('filter[from_event_graph]', $filter['from_event_graph']);
if ($loaded_filter !== false && $from_event_graph != 1 && !isset($fb64)) {
if ($loaded_filter !== false && $from_event_graph != 1 && isset($fb64) === false) {
$filter = events_get_event_filter($loaded_filter['id_filter']);
if ($filter !== false) {
$id_group = $filter['id_group'];
@ -611,9 +608,8 @@ $data[0] = html_print_select(
true,
true,
true,
'',
false,
'width: 200px;'
'select_tags',
false
);
$data[1] = html_print_image(
@ -654,9 +650,8 @@ $data[2] = html_print_select(
true,
true,
true,
'',
false,
'width: 200px;'
'select_tags',
false
);
$tabletags_with->data[] = $data;
@ -688,9 +683,8 @@ $data[0] = html_print_select(
true,
true,
true,
'',
false,
'width: 200px;'
'select_tags',
false
);
$data[1] = html_print_image(
'images/darrowright.png',
@ -727,9 +721,8 @@ $data[2] = html_print_select(
true,
true,
true,
'',
false,
'width: 200px;'
'select_tags',
false
);
$tabletags_without->data[] = $data;
$tabletags_without->rowclass[] = '';
@ -1136,15 +1129,19 @@ $in = '<div class="filter_input"><label>'.__('Free search').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
if (empty($severity) === true && $severity !== '0') {
$severity = -1;
if (is_array($severity) === false) {
if (empty($severity) === true && $severity !== '0') {
$severity = -1;
} else {
$severity = explode(',', $severity);
}
}
// Criticity - severity.
$data = html_print_select(
get_priorities(),
'severity',
explode(',', $severity),
$severity,
'',
__('All'),
-1,
@ -1152,7 +1149,10 @@ $data = html_print_select(
true,
true,
'',
false
false,
false,
false,
3
);
$in = '<div class="filter_input"><label>'.__('Severity').'</label>';
$in .= $data.'</div>';

View File

@ -2,20 +2,28 @@
/**
* Netflow live view
*
* @package Pandora FMS open.
* @subpackage UI file.
* @category Netflow
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* Pandora FMS - http://pandorafms.com
* ==================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
global $config;
@ -40,7 +48,7 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'],
$pure = get_parameter('pure', 0);
// Ajax callbacks.
if (is_ajax()) {
if (is_ajax() === true) {
$get_filter_type = get_parameter('get_filter_type', 0);
$get_filter_values = get_parameter('get_filter_values', 0);
@ -117,7 +125,7 @@ $draw = get_parameter('draw_button', '');
$save = get_parameter('save_button', '');
$update = get_parameter('update_button', '');
if (!is_metaconsole()) {
if (is_metaconsole() === false) {
// Header.
ui_print_page_header(
__('Netflow live view'),
@ -505,7 +513,7 @@ if (is_metaconsole()) {
echo '</form>';
if ($draw != '') {
if (empty($draw) === false) {
// Draw.
echo '<br/>';
@ -513,6 +521,11 @@ if (is_metaconsole()) {
if ($netflow_disable_custom_lvfilters && $filter_selected == 0) {
ui_print_error_message(__('No filter selected'));
} else {
// Hidden input for handle properly the text colors.
html_print_input_hidden(
'selected_style_theme',
$config['style']
);
// Draw the netflow chart.
echo netflow_draw_item(
$start_date,

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.762
%define release 220526
%define release 220621
# User and Group under which Apache is running
%define httpd_name httpd
@ -31,6 +31,7 @@ Requires: php-gd, php-ldap, php-snmp, php-session, php-gettext
Requires: php-mysqlnd, php-mbstring, php-zip, php-zlib, php-curl
Requires: xorg-x11-fonts-75dpi, xorg-x11-fonts-misc, php-pecl-zip
Requires: graphviz
Requires: openldap-clients libzstd
Provides: %{name}-%{version}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.762
%define release 220526
%define release 220621
# 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.762
%define release 220526
%define release 220621
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -88,6 +88,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
`alias_as_name` TINYINT NOT NULL DEFAULT 0,
`safe_mode_module` INT UNSIGNED NOT NULL DEFAULT 0,
`cps` INT NOT NULL DEFAULT 0,
`satellite_server` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),
@ -616,7 +617,7 @@ CREATE TABLE IF NOT EXISTS `talert_execution_queue` (
CREATE TABLE IF NOT EXISTS `tattachment` (
`id_attachment` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_incidencia` INT UNSIGNED NOT NULL DEFAULT 0,
`id_usuario` VARCHAR(60) NOT NULL DEFAULT '',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '',
`filename` VARCHAR(255) NOT NULL DEFAULT '',
`description` VARCHAR(150) DEFAULT '',
`size` BIGINT UNSIGNED NOT NULL DEFAULT 0,
@ -689,7 +690,7 @@ CREATE TABLE IF NOT EXISTS `tcontainer_item` (
CREATE TABLE IF NOT EXISTS `tevento` (
`id_evento` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_agente` INT NOT NULL DEFAULT 0,
`id_usuario` VARCHAR(100) NOT NULL DEFAULT '0',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '0',
`id_grupo` MEDIUMINT NOT NULL DEFAULT 0,
`estado` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`timestamp` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
@ -779,7 +780,7 @@ CREATE TABLE IF NOT EXISTS `tincidencia` (
`cierre` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
`titulo` TEXT,
`descripcion` TEXT,
`id_usuario` VARCHAR(60) NOT NULL DEFAULT '',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '',
`origen` VARCHAR(100) NOT NULL DEFAULT '',
`estado` INT NOT NULL DEFAULT 0,
`prioridad` INT NOT NULL DEFAULT 0,
@ -1059,7 +1060,7 @@ CREATE TABLE IF NOT EXISTS `tnetwork_profile_pen` (
CREATE TABLE IF NOT EXISTS `tnota` (
`id_nota` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_incident` BIGINT UNSIGNED NOT NULL,
`id_usuario` VARCHAR(100) NOT NULL DEFAULT '0',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '0',
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`nota` MEDIUMTEXT,
PRIMARY KEY (`id_nota`),
@ -1172,7 +1173,7 @@ CREATE TABLE IF NOT EXISTS `tserver` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tsesion` (
`id_sesion` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_usuario` VARCHAR(60) NOT NULL DEFAULT '0',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '0',
`ip_origen` VARCHAR(100) NOT NULL DEFAULT '',
`accion` VARCHAR(100) NOT NULL DEFAULT '',
`descripcion` TEXT,
@ -1208,7 +1209,7 @@ CREATE TABLE IF NOT EXISTS `ttrap` (
`value_custom` TEXT,
`alerted` SMALLINT NOT NULL DEFAULT 0,
`status` SMALLINT NOT NULL DEFAULT 0,
`id_usuario` VARCHAR(150) DEFAULT '',
`id_usuario` VARCHAR(255) DEFAULT '',
`timestamp` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
`priority` TINYINT UNSIGNED NOT NULL DEFAULT 2,
`text` VARCHAR(255) DEFAULT '',
@ -1260,7 +1261,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` (
-- Table `tusuario`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tusuario` (
`id_user` VARCHAR(60) NOT NULL DEFAULT '0',
`id_user` VARCHAR(255) NOT NULL DEFAULT '0',
`fullname` VARCHAR(255) NOT NULL,
`firstname` VARCHAR(255) NOT NULL,
`lastname` VARCHAR(255) NOT NULL,
@ -1313,7 +1314,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tusuario_perfil` (
`id_up` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_usuario` VARCHAR(100) NOT NULL DEFAULT '',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '',
`id_perfil` INT UNSIGNED NOT NULL DEFAULT 0,
`id_grupo` INT NOT NULL DEFAULT 0,
`no_hierarchy` TINYINT NOT NULL DEFAULT 0,
@ -1328,7 +1329,7 @@ CREATE TABLE IF NOT EXISTS `tusuario_perfil` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tuser_double_auth` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(60) NOT NULL,
`id_user` VARCHAR(255) NOT NULL,
`secret` VARCHAR(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE (`id_user`),
@ -1340,7 +1341,7 @@ CREATE TABLE IF NOT EXISTS `tuser_double_auth` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `treset_pass_history` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(60) NOT NULL,
`id_user` VARCHAR(255) NOT NULL,
`reset_moment` DATETIME NOT NULL,
`success` TINYINT NOT NULL,
PRIMARY KEY (`id`)
@ -1366,7 +1367,7 @@ CREATE TABLE IF NOT EXISTS `tnotification_source` (
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `tmensajes` (
`id_mensaje` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_usuario_origen` VARCHAR(60) NOT NULL DEFAULT '',
`id_usuario_origen` VARCHAR(255) NOT NULL DEFAULT '',
`mensaje` TEXT,
`timestamp` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`subject` VARCHAR(255) NOT NULL DEFAULT '',
@ -1388,7 +1389,7 @@ CREATE TABLE IF NOT EXISTS `tmensajes` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tnotification_user` (
`id_mensaje` INT UNSIGNED NOT NULL,
`id_user` VARCHAR(60) NOT NULL,
`id_user` VARCHAR(255) NOT NULL,
`utimestamp_read` BIGINT,
`utimestamp_erased` BIGINT,
`postpone` INT,
@ -1415,7 +1416,7 @@ CREATE TABLE IF NOT EXISTS `tnotification_group` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tnotification_source_user` (
`id_source` BIGINT UNSIGNED NOT NULL,
`id_user` VARCHAR(60),
`id_user` VARCHAR(255),
`enabled` INT DEFAULT NULL,
`also_mail` INT DEFAULT NULL,
PRIMARY KEY (`id_source`,`id_user`),
@ -1443,7 +1444,7 @@ CREATE TABLE IF NOT EXISTS `tnotification_source_group` (
CREATE TABLE IF NOT EXISTS `tnotification_source_group_user` (
`id_source` BIGINT UNSIGNED NOT NULL,
`id_group` MEDIUMINT UNSIGNED NOT NULL,
`id_user` VARCHAR(60),
`id_user` VARCHAR(255),
`enabled` INT DEFAULT NULL,
`also_mail` INT DEFAULT NULL,
PRIMARY KEY (`id_source`,`id_user`),
@ -1476,7 +1477,7 @@ CREATE TABLE IF NOT EXISTS `tnews` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tgraph` (
`id_graph` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(100) NOT NULL DEFAULT '',
`id_user` VARCHAR(255) NOT NULL DEFAULT '',
`name` VARCHAR(150) NOT NULL DEFAULT '',
`description` TEXT,
`period` INT NOT NULL DEFAULT 0,
@ -1514,7 +1515,7 @@ CREATE TABLE IF NOT EXISTS `tgraph_source` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `treport` (
`id_report` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(100) NOT NULL DEFAULT '',
`id_user` VARCHAR(255) NOT NULL DEFAULT '',
`name` VARCHAR(150) NOT NULL DEFAULT '',
`description` TEXT,
`private` TINYINT UNSIGNED NOT NULL DEFAULT 0,
@ -1813,7 +1814,7 @@ CREATE TABLE IF NOT EXISTS `tplanned_downtime` (
`type_downtime` VARCHAR(100) NOT NULL DEFAULT 'disabled_agents_alerts',
`type_execution` VARCHAR(100) NOT NULL DEFAULT 'once',
`type_periodicity` VARCHAR(100) NOT NULL DEFAULT 'weekly',
`id_user` VARCHAR(100) NOT NULL DEFAULT '0',
`id_user` VARCHAR(255) NOT NULL DEFAULT '0',
PRIMARY KEY ( `id` )
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@ -2036,7 +2037,7 @@ CREATE TABLE IF NOT EXISTS `tgroup_stat` (
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tnetwork_map` (
`id_networkmap` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(60) NOT NULL,
`id_user` VARCHAR(255) NOT NULL,
`name` VARCHAR(100) NOT NULL,
`type` VARCHAR(20) NOT NULL,
`layout` VARCHAR(20) NOT NULL,
@ -2196,7 +2197,7 @@ CREATE TABLE IF NOT EXISTS `tnetflow_report_content` (
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tpassword_history` (
`id_pass` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(60) NOT NULL,
`id_user` VARCHAR(255) NOT NULL,
`password` VARCHAR(45) DEFAULT NULL,
`date_begin` DATETIME,
`date_end` DATETIME,
@ -2249,7 +2250,7 @@ CREATE TABLE `tupdate_journal` (
`version` VARCHAR(25) DEFAULT '',
`type` VARCHAR(25) DEFAULT '',
`origin` VARCHAR(25) DEFAULT '',
`id_user` VARCHAR(250) NOT NULL DEFAULT ''
`id_user` VARCHAR(255) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- ---------------------------------------------------------------------
@ -2298,7 +2299,7 @@ CREATE TABLE IF NOT EXISTS `tsessions_php` (
CREATE TABLE IF NOT EXISTS `tmap` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_group` INT UNSIGNED NOT NULL DEFAULT 0,
`id_user` VARCHAR(250) NOT NULL DEFAULT '',
`id_user` VARCHAR(255) NOT NULL DEFAULT '',
`type` INT UNSIGNED NOT NULL DEFAULT 0,
`subtype` INT UNSIGNED NOT NULL DEFAULT 0,
`name` VARCHAR(250) DEFAULT '',
@ -2578,8 +2579,8 @@ CREATE TABLE IF NOT EXISTS `tpolicy_group_agents` (
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tdashboard` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(60) NOT NULL DEFAULT '',
`id_user` VARCHAR(60) NOT NULL DEFAULT '',
`name` TEXT NOT NULL DEFAULT '',
`id_user` VARCHAR(255) NOT NULL DEFAULT '',
`id_group` INT NOT NULL DEFAULT 0,
`active` TINYINT NOT NULL DEFAULT 0,
`cells` INT UNSIGNED DEFAULT 0,
@ -2817,6 +2818,7 @@ CREATE TABLE IF NOT EXISTS `tservice` (
`cascade_protection` TINYINT NOT NULL DEFAULT 0,
`evaluate_sla` INT NOT NULL DEFAULT 0,
`is_favourite` TINYINT NOT NULL DEFAULT 0,
`enable_sunburst` TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB
COMMENT = 'Table to define services to monitor'
@ -3127,7 +3129,7 @@ CREATE TABLE IF NOT EXISTS `tnetworkmap_ent_rel_nodes` (
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `treport_template` (
`id_report` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(100) NOT NULL DEFAULT '',
`id_user` VARCHAR(255) NOT NULL DEFAULT '',
`name` VARCHAR(150) NOT NULL DEFAULT '',
`description` TEXT,
`private` TINYINT UNSIGNED NOT NULL DEFAULT 0,
@ -3296,7 +3298,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
`id_source_event` BIGINT UNSIGNED NOT NULL,
`id_agente` INT NOT NULL DEFAULT 0,
`agent_name` VARCHAR(600) NOT NULL DEFAULT '',
`id_usuario` VARCHAR(100) NOT NULL DEFAULT '0',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '0',
`id_grupo` MEDIUMINT NOT NULL DEFAULT 0,
`group_name` VARCHAR(100) NOT NULL DEFAULT '',
`estado` TINYINT UNSIGNED NOT NULL DEFAULT 0,
@ -3348,7 +3350,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` (
`id_source_event` BIGINT UNSIGNED NOT NULL,
`id_agente` INT NOT NULL DEFAULT 0,
`agent_name` VARCHAR(600) NOT NULL DEFAULT '',
`id_usuario` VARCHAR(100) NOT NULL DEFAULT '0',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '0',
`id_grupo` MEDIUMINT NOT NULL DEFAULT 0,
`group_name` VARCHAR(100) NOT NULL DEFAULT '',
`estado` TINYINT UNSIGNED NOT NULL DEFAULT 0,
@ -3467,6 +3469,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`alias_as_name` TINYINT NOT NULL DEFAULT 0,
`safe_mode_module` INT UNSIGNED NOT NULL DEFAULT 0,
`cps` INT NOT NULL DEFAULT 0,
`satellite_server` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),
@ -3512,7 +3515,7 @@ CREATE TABLE IF NOT EXISTS `tphase`(
CREATE TABLE IF NOT EXISTS `treset_pass` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(100) NOT NULL DEFAULT '',
`id_user` VARCHAR(255) NOT NULL DEFAULT '',
`cod_hash` VARCHAR(100) NOT NULL DEFAULT '',
`reset_time` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
@ -3663,7 +3666,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig` (
`name` VARCHAR(100) NOT NULL,
`order` INT NOT NULL DEFAULT 0,
`description` TEXT,
`disabled` TINYINT DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@ -3817,7 +3820,7 @@ CREATE TABLE IF NOT EXISTS `tuser_task` (
-- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_usuario` VARCHAR(60) NOT NULL DEFAULT '0',
`id_usuario` VARCHAR(255) NOT NULL DEFAULT '0',
`id_user_task` INT UNSIGNED NOT NULL DEFAULT 0,
`args` TEXT,
`scheduled` ENUM('no','hourly','daily','weekly','monthly','yearly','custom') DEFAULT 'no',
@ -3836,7 +3839,7 @@ CREATE TABLE IF NOT EXISTS `tvisual_console_elements_cache` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`vc_id` INT UNSIGNED NOT NULL,
`vc_item_id` INT UNSIGNED NOT NULL,
`user_id` VARCHAR(60) DEFAULT NULL,
`user_id` VARCHAR(255) DEFAULT NULL,
`data` TEXT,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expiration` INT UNSIGNED NOT NULL COMMENT 'Seconds to expire',
@ -4216,7 +4219,7 @@ CREATE TABLE IF NOT EXISTS `tbackup` (
`id` SERIAL,
`utimestamp` BIGINT DEFAULT 0,
`filename` VARCHAR(512) DEFAULT '',
`id_user` VARCHAR(60) DEFAULT '',
`id_user` VARCHAR(255) DEFAULT '',
`description` MEDIUMTEXT,
`pid` INT UNSIGNED DEFAULT 0,
`filepath` VARCHAR(512) DEFAULT '',

View File

@ -219,7 +219,7 @@ INSERT INTO `tlink` VALUES
(1,'Documentation','https://pandorafms.com/manual'),
(2,'Enterprise Edition','http://pandorafms.com'),
(3,'Report a bug','https://github.com/pandorafms/pandorafms/issues'),
(4,'Suggest new feature','http://forums.pandorafms.com/index.php?board=22.0'),
(4,'Suggest new feature','https://pandorafms.com/community/beta-program/'),
(5,'Module library','http://library.pandorafms.com/');
UNLOCK TABLES;

View File

@ -2077,7 +2077,8 @@ class Client
'status' => $status,
'message' => $msg,
'extra' => $extra,
]
],
JSON_UNESCAPED_UNICODE
);
if ($field_exists === false) {
@ -2228,7 +2229,7 @@ class Client
if (is_callable($this->postUpdateFN) === true) {
call_user_func(
$this->postUpdateFN,
$this->currentPackage,
(string) $version,
'server'
);
}

View File

@ -460,7 +460,9 @@ function umShowUpdateDetails(update) {
var um_update_details = document.getElementById("um-update-details");
var header = document.getElementById("um-update-details-header");
var content = document.getElementById("um-update-details-content");
var detailTitle = document
.getElementsByClassName("um-package-details")
.item(0).innerText;
header.innerText = texts.updateText + " " + updates[update].version;
content.innerText = updates[update].description;
@ -468,8 +470,8 @@ function umShowUpdateDetails(update) {
um_update_details.style.display = "block";
if (typeof $ == "function") {
$("#um-update-details").dialog({
title: update,
width: 650,
title: detailTitle,
width: 800,
height: 600
});
}

View File

@ -1,318 +0,0 @@
.update_text p {
font-size: 11pt;
}
.update_text a {
font-size: 11pt;
color: #82b92e;
}
.update_manager_warning p {
font-size: 10pt;
}
.ui-widget-content,
.ui-widget-content p {
font-size: 12pt;
}
.fileupload_form {
background-color: #373a3d;
background-image: -moz-linear-gradient(center, #373a3d, #313437);
border-radius: 3px;
margin: 0px;
padding: 30px;
}
#drop_file {
background-color: #e6e6e6;
border: 20px solid rgba(0, 0, 0, 0);
border-radius: 3px;
color: #707070;
font-size: 16px;
font-weight: bold;
margin-bottom: 30px;
padding: 40px 50px;
text-align: center;
text-transform: uppercase;
}
#drop_file table {
vertical-align: middle;
}
#drop_file table td,
#drop_file table label {
color: #707070;
font-size: 16px;
font-weight: bold;
margin-top: 0;
vertical-align: middle;
}
#drop_file table select {
float: none;
}
#drop_file a {
background-color: #82b92e;
border-radius: 2px;
color: #ffffff;
cursor: pointer;
display: inline-block;
font-size: 14px;
line-height: 1;
padding: 12px 26px;
}
#drop_file a:hover {
background-color: #a6ce67;
text-decoration: none;
}
#drop_file input {
display: none;
}
.fileupload_form ul {
border-bottom: 1px solid #3d4043;
border-top: 1px solid #2b2e31;
list-style: none outside none;
margin: 0 -30px;
padding: 0;
}
.fileupload_form ul li {
background-color: #333639;
background-image: -moz-linear-gradient(center, #333639, #303335);
border-bottom: 1px solid #2b2e31;
border-top: 1px solid #3d4043;
padding: 15px;
position: relative;
}
.fileupload_form ul li #input-progress {
left: 68px;
position: absolute;
}
.fileupload_form ul li p {
color: #eeeeee;
font-size: 12px;
font-weight: bold;
left: 95px;
overflow: hidden;
position: absolute;
top: 12px;
white-space: nowrap;
}
.fileupload_form ul li i {
color: #7f7f7f;
display: block;
font-style: normal;
font-weight: normal;
}
.fileupload_form ul li canvas {
left: 13px;
position: absolute;
top: 15px;
}
.fileupload_form ul li span {
background: url("../images/check-cross.png") no-repeat scroll 0 0
rgba(0, 0, 0, 0);
cursor: pointer;
height: 12px;
position: absolute;
right: 13px;
top: 34px;
width: 15px;
}
.fileupload_form ul li div {
display: block !important;
}
.fileupload_form ul li.working span {
background-position: 0 -12px;
height: 16px;
}
.fileupload_form ul li.loading span {
background: url("../images/spinner.gif") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
height: 16px;
}
.fileupload_form ul li.suc span {
background: url("../images/check-cross.png") no-repeat scroll 0 0
rgba(0, 0, 0, 0);
height: 12px;
}
.fileupload_form ul li.suc p {
color: #5a8629;
}
.fileupload_form ul li.error span {
background: url("../images/check-cross.png") no-repeat scroll 0 -12px rgba(0, 0, 0, 0);
height: 16px;
}
.fileupload_form ul li.error p {
color: #ff3333;
}
#log_zone {
background-color: #e6e6e6;
border: 20px solid rgba(0, 0, 0, 0);
border-radius: 3px;
color: #707070;
font-size: 12px;
margin-bottom: 30px;
padding: 10px;
text-align: left;
}
#box_online {
background-image: url("../images/update_manager_background.jpg");
background-position: center center;
background-repeat: no-repeat;
background-color: #fff;
padding: 40px 50px;
border: 1px solid #f3f3f3;
border-radius: 5px;
min-height: 600px;
background-size: contain;
}
div#box_online * {
font-size: 16pt;
margin-bottom: 50px;
}
#box_online .content {
max-width: 50%;
}
.update_popup {
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 10px;
padding-right: 10px;
}
.update_icon {
padding-left: 20px;
}
.update_text h3 {
font-weight: bold;
font-size: 12pt;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: left;
padding-left: 19px;
padding-bottom: 5px;
}
a.update_manager_button {
padding: 10px 12px;
margin-top: 10px;
display: inline-flex;
align-items: center;
font-size: 16px;
border-radius: 4px;
text-decoration: none;
}
a.update_manager_button:after {
content: url(../images/update_manager_button.png);
padding-left: 10px;
}
.progressbar {
margin-top: 15px;
}
.ui-draggable,
.ui-draggable .ui-dialog-titlebar {
cursor: default;
}
#box_online #pkg_version {
color: #82b92e;
font-size: 75pt;
font-weight: bold;
margin-bottom: 50px;
}
/* METACONSOLE */
.box_online_meta {
background: none;
min-height: 400px;
text-align: center;
border: none;
}
div#box_online.box_online_meta * {
font-size: 14pt;
}
#box_online.box_online_meta .content {
max-width: 100%;
}
#box_online.box_online_meta #pkg_version {
font-size: 60pt;
}
/* COMMUNITY */
.update_manager_open {
max-width: 50%;
font-size: 10pt;
margin-top: 40px;
padding: 20px;
border: 1px solid #eaeaea;
border-radius: 5px;
}
.update_manager_warning {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.update_manager_warning img {
padding-right: 20px;
width: 90px;
}
a.update_manager_button_open {
padding: 5px 10px;
font-size: 16px;
text-decoration: none;
border: 1px solid #82b92e;
color: #82b92e;
border-radius: 2px;
}
a.update_manager_button_open:hover {
color: #fff;
background-color: #82b92e;
}
#um-update-details-header {
background-image: url(../images/pandora_logo.png);
}
.um-progress-bar {
background-color: #8bb92e !important;
}
.um-error {
color: #e63c52;
}
.um-success {
color: #8bb92e;
}
.dz-success-mark svg {
background: #8bb92e;
border-radius: 50%;
}
.newsletter_div {
font-size: 12pt;
margin: 5px 20px;
float: left;
padding-top: 23px;
}
.register_update_manager {
margin: 5px 0 10px;
float: left;
padding-left: 15px;
}

Some files were not shown because too many files have changed in this diff Show More