Merge branch 'develop' into 'ent-10665-version-open-edicion-del-propio-usuario-y-gestion-de-usuarios-devuelve-error-500'

# Conflicts:
#   pandora_console/install.php
This commit is contained in:
Daniel Cebrian 2023-03-27 11:01:24 +00:00
commit fd9dfcf08f
109 changed files with 2570 additions and 1027 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, AIX version # Version 7.0NG.770, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, FreeBSD Version # Version 7.0NG.770, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, HP-UX Version # Version 7.0NG.770, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux # Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux # Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, Solaris Version # Version 7.0NG.770, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.769 # Version 7.0NG.770
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version # Foundation; either version 2 of the Licence or any later version

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.769, AIX version # Version 7.0NG.770, AIX version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.769 # Version 7.0NG.770
# FreeBSD/IPSO version # FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena # Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.769, HPUX Version # Version 7.0NG.770, HPUX Version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769 # Version 7.0NG.770
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769 # Version 7.0NG.770
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769 # Version 7.0NG.770
# Licensed under GPL license v2, # Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.769, Solaris version # Version 7.0NG.770, Solaris version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, AIX version # Version 7.0NG.770, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.769-230323 Version: 7.0NG.770
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# 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. # GNU General Public License for more details.
pandora_version="7.0NG.769-230323" pandora_version="7.0NG.770"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -31,7 +31,7 @@ fi
if [ "$#" -ge 2 ]; then if [ "$#" -ge 2 ]; then
VERSION="$2" VERSION="$2"
else else
VERSION="7.0NG.769" VERSION="7.0NG.770"
fi fi
# Path for the generated DMG file # Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false"> <choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/> <pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice> </choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.769" onConclusion="none">pandorafms_src.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.770" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications"> <choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/> <pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice> </choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.769" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.770" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" /> <!-- <installation-check script="check()" />
<script> <script>
<![CDATA[ <![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string> <key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string> <key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.769</string> <key>CFBundleVersion</key> <string>7.0NG.770</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.769 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string> <key>CFBundleGetInfoString</key> <string>7.0NG.770 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.769</string> <key>CFBundleShortVersionString</key> <string>7.0NG.770</string>
<key>NSPrincipalClass</key><string>NSApplication</string> <key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string> <key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux # Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, FreeBSD Version # Version 7.0NG.770, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, HP-UX Version # Version 7.0NG.770, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux # Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, GNU/Linux # Version 7.0NG.770, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, NetBSD Version # Version 7.0NG.770, NetBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.769, Solaris Version # Version 7.0NG.770, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1022,8 +1022,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.769'; use constant AGENT_VERSION => '7.0NG.770';
use constant AGENT_BUILD => '230323'; use constant AGENT_BUILD => '230327';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,8 +3,8 @@
# #
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.769 %define version 7.0NG.770
%define release 230323 %define release 1
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,8 +3,8 @@
# #
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.769 %define version 7.0NG.770
%define release 230323 %define release 1
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.769" PI_VERSION="7.0NG.770"
PI_BUILD="230323" PI_BUILD="230327"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.769 # Version 7.0NG.770
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version # Foundation; either version 2 of the Licence or any later version

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.769} {Pandora FMS Windows Agent v7.0NG.770}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{230323} {230327}
ViewReadme ViewReadme
{Yes} {Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No} {No}
Windows,Executable Windows,Executable
{<%AppName%>-<%Version%>-Setup<%Ext%>} {<%AppName%>-Setup<%Ext%>}
Windows,FileDescription Windows,FileDescription
{<%AppName%> <%Version%> Setup} {<%AppName%> <%Version%> Setup}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.769 Build 230323") #define PANDORA_VERSION ("7.0NG.770 Build 230327")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.769-230323 Version: 7.0NG.770
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# 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. # GNU General Public License for more details.
pandora_version="7.0NG.769-230323" pandora_version="7.0NG.770"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -30,7 +30,7 @@ require_once __DIR__.'/../include/functions_html.php';
echo '<style> echo '<style>
:root {'; :root {';
if ($config['style'] === 'pandora') { if ($config['style'] === 'pandora') {
echo '--login-background-color: rgba(255, 255, 255, 0.2);'; echo '--login-background-color: rgba(255, 255, 255, 0.4);';
echo '--login-label-color: #545454;'; echo '--login-label-color: #545454;';
echo '--login-text-color: #000;'; echo '--login-text-color: #000;';
$style_theme = 'white-theme'; $style_theme = 'white-theme';
@ -213,7 +213,7 @@ echo '<div class="login_page">';
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
if (!isset($config['custom_logo_login'])) { if (!isset($config['custom_logo_login'])) {
html_print_image( html_print_image(
'enterprise/images/custom_logo_login/login_logo.png', 'enterprise/images/custom_logo_login/Pandora-FMS-1.png',
false, false,
[ [
'class' => 'login_logo', 'class' => 'login_logo',
@ -238,13 +238,13 @@ if (is_metaconsole() === true) {
} }
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { } else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (!isset($config['custom_logo_login'])) { if (!isset($config['custom_logo_login'])) {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/login_logo_v7.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else { } else {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} }
} else { } else {
if (empty($config['custom_logo_login']) === true) { if (empty($config['custom_logo_login']) === true) {
html_print_image(ui_get_full_url('images/custom_logo_login/pandora_logo.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url('images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else { } else {
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} }
@ -472,17 +472,19 @@ html_print_csrf_hidden();
echo '<div class ="img_banner_login">'; echo '<div class ="img_banner_login">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (empty($config['custom_splash_login']) === false && $config['custom_splash_login'] !== 'default') { if (empty($config['custom_splash_login']) === false && $config['custom_splash_login'] !== 'default') {
html_print_image( if ($config['custom_splash_login'] !== 'none.png') {
'enterprise/images/custom_splash_login/'.$config['custom_splash_login'], html_print_image(
false, 'enterprise/images/custom_splash_login/'.$config['custom_splash_login'],
[ false,
'class' => 'splash-logo', [
'alt' => 'splash', 'class' => 'splash-logo',
'border' => 0, 'alt' => 'splash',
], 'border' => 0,
false, ],
false false,
); false
);
}
} else { } else {
echo ' echo '
<div class="loginimg-container"> <div class="loginimg-container">

View File

@ -57,14 +57,33 @@ if ($id_field) {
$combo_values = $field['combo_values'] ? $field['combo_values'] : ''; $combo_values = $field['combo_values'] ? $field['combo_values'] : '';
$is_combo_enable = $config['is_combo_enable']; $is_combo_enable = $config['is_combo_enable'];
$is_link_enabled = $field['is_link_enabled']; $is_link_enabled = $field['is_link_enabled'];
ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, ''); $header_title = __('Update agent custom field');
} else { } else {
ui_print_page_header(__('Create agent custom field'), 'images/custom_field.png', false, '', true, ''); $header_title = __('Create agent custom field');
} }
$table = new stdClass(); ui_print_standard_header(
$table->class = 'databox'; $header_title,
$table->id = 'configure_field'; 'images/custom_field.png',
false,
'',
true,
[],
[
[
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
'label' => __('Resources'),
],
[
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
'label' => __('Custom field'),
],
[
'link' => '',
'label' => __('Edit'),
],
]
);
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>"; echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>'; echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
@ -82,80 +101,96 @@ echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Informati
echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>'; echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>'; echo '</div>';
$table = new stdClass();
$table->class = 'databox filter-table-adv';
$table->id = 'configure_field';
$table->width = '100%';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = []; $table->data = [];
$table->data[0][0] = __('Name'); $table->data[0][0] = html_print_label_input_block(
$table->data[1][0] = html_print_input_text( __('Name'),
'name', html_print_input_text(
$name, 'name',
'', $name,
35, '',
100, 35,
true 100,
true
)
); );
$table->data[2][0] = __('Pass type').ui_print_help_tip( $table->data[0][1] = html_print_label_input_block(
__('The fields with pass type enabled will be displayed like html input type pass in html'), __('Display on front').ui_print_help_tip(
true __('The fields with display on front enabled will be displayed into the agent details'),
); true
$table->data[2][1] = __('Display on front').ui_print_help_tip( ),
__('The fields with display on front enabled will be displayed into the agent details'), html_print_checkbox_switch(
true 'display_on_front',
); 1,
$table->data[2][2] = __('Link type'); $display_on_front,
true
$table->data[3][0] = html_print_checkbox_switch( )
'is_password_type',
1,
$is_password_type,
true
);
$table->data[3][1] = html_print_checkbox_switch(
'display_on_front',
1,
$display_on_front,
true
);
$table->data[3][2] = html_print_checkbox_switch_extended(
'is_link_enabled',
1,
$is_link_enabled,
false,
'',
'',
true
);
$table->data[4][0] = __('Enabled combo');
$table->data[5][0] = html_print_checkbox_switch_extended(
'is_combo_enable',
0,
$config['is_combo_enable'],
false,
'',
'',
true
); );
$table->data[1][0] = html_print_label_input_block(
$table->cellstyle[4][1] = 'display: none;'; __('Link type'),
$table->cellstyle[5][1] = 'display: none;'; html_print_checkbox_switch_extended(
'is_link_enabled',
$table->data[4][1] = __('Combo values').ui_print_help_tip( 1,
__('Set values separated by comma'), $is_link_enabled,
true false,
); '',
$table->data[5][1] = html_print_textarea( '',
'combo_values', true
3, )
65,
io_safe_output($combo_values),
'',
true
); );
$table->data[2][0] = html_print_label_input_block(
__('Pass type').ui_print_help_tip(
__('The fields with pass type enabled will be displayed like html input type pass in html'),
true
),
html_print_checkbox_switch(
'is_password_type',
1,
$is_password_type,
true
)
);
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">'; $table->data[2][1] = html_print_label_input_block(
__('Enabled combo'),
html_print_checkbox_switch_extended(
'is_combo_enable',
0,
$config['is_combo_enable'],
false,
'',
'',
true
)
);
$table->data[3][0] = html_print_label_input_block(
__('Combo values').ui_print_help_tip(
__('Set values separated by comma'),
true
),
html_print_textarea(
'combo_values',
3,
65,
io_safe_output($combo_values),
'',
true
)
);
echo '<form class="max_floating_element_size" name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
html_print_table($table); html_print_table($table);
if ($id_field > 0) { if ($id_field > 0) {
@ -194,65 +229,65 @@ echo '</form>';
<script> <script>
$(document).ready (function () { $(document).ready (function () {
if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){ if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){
console.log('entra2');
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show(); $('#configure_field-3').show();
$('input[type=checkbox][name=is_password_type]').change(function (e) { $('input[type=checkbox][name=is_password_type]').change(function (e) {
dialog_message("#message_set_password"); dialog_message("#message_set_password");
$('input[type=checkbox][name=is_password_type]').prop('checked', false); $('input[type=checkbox][name=is_password_type]').prop('checked', false);
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show(); $('#configure_field-3').show();
e.preventDefault(); e.preventDefault();
}); });
$('input[type=checkbox][name=is_combo_enable]').change(function (e) {
if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){ $('input[type=checkbox][name=is_combo_enable]').change(function (e) {
dialog_message("#message_set_combo"); if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true); dialog_message("#message_set_combo");
$('#configure_field-4').show(); $('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
e.preventDefault(); $('#configure_field-3').show();
} e.preventDefault();
}); }
});
} else {
console.log('entra');
$('#configure_field-3').hide();
} }
if ($('input[type=checkbox][name=is_link_enabled]').is(":checked") === true) { if ($('input[type=checkbox][name=is_link_enabled]').is(":checked") === true) {
$('#configure_field-1').hide(); $('#configure_field-2').hide();
$('#configure_field-3').hide();
} else { } else {
$('#configure_field-1').show(); $('#configure_field-2').show();
$('#configure_field-3').show();
} }
$('input[type=checkbox][name=is_link_enabled]').change(function () { $('input[type=checkbox][name=is_link_enabled]').change(function () {
if( $(this).is(":checked") ){ if( $(this).is(":checked") ){
$('#configure_field-1').hide(); $('#configure_field-2').hide();
$('#configure_field-3').hide(); $('#configure_field-3').hide();
} else{ } else{
$('#configure_field-1').show(); $('#configure_field-2').show();
$('#configure_field-3').show(); $('#configure_field-3').show();
} }
}); });
$('input[type=checkbox][name=is_combo_enable]').change(function () { $('input[type=checkbox][name=is_combo_enable]').change(function () {
if( $(this).is(":checked") ){ if( $(this).is(":checked") ){
$('#configure_field-4').show(); $('#configure_field-3').show();
dialog_message("#message_no_set_password"); dialog_message("#message_no_set_password");
$('#configure_field-1').hide(); $('#configure_field-1').hide();
$('#configure_field-5').hide();
} }
else{ else{
$('#configure_field-4').hide(); $('#configure_field-3').hide();
$('#configure_field-1').show(); $('#configure_field-1').show();
$('#configure_field-5').show();
} }
}); });
$('input[type=checkbox][name=is_password_type]').change(function () { $('input[type=checkbox][name=is_password_type]').change(function () {
if( $(this).is(":checked")){ if( $(this).is(":checked")){
dialog_message("#message_no_set_combo"); dialog_message("#message_no_set_combo");
$('#configure_field-3').hide(); $('#configure_field-3').hide();
$('#configure_field-5').hide();
} }
else{ else{
$('#configure_field-3').show(); $('#configure_field-3').show();
$('#configure_field-5').show();
} }
}); });
}); });

View File

@ -704,6 +704,19 @@ if ($step == 2) {
) )
); );
$usr_groups = implode(
',',
array_keys(users_get_groups($config['id_user'], 'LM', true))
);
$sql_query = sprintf(
'SELECT id, name
FROM talert_actions
WHERE id_group IN (%s)
ORDER BY name',
$usr_groups
);
$table->data[2][1] = html_print_label_input_block( $table->data[2][1] = html_print_label_input_block(
__('Default action').ui_print_help_tip( __('Default action').ui_print_help_tip(
__('Unless they\'re left blank, the fields from the action will override those set on the template.'), __('Unless they\'re left blank, the fields from the action will override those set on the template.'),
@ -801,19 +814,6 @@ if ($step == 2) {
) )
); );
$usr_groups = implode(
',',
array_keys(users_get_groups($config['id_user'], 'LM', true))
);
$sql_query = sprintf(
'SELECT id, name
FROM talert_actions
WHERE id_group IN (%s)
ORDER BY name',
$usr_groups
);
$table->data[5][0] = html_print_label_input_block( $table->data[5][0] = html_print_label_input_block(
__('Condition type'), __('Condition type'),
html_print_select( html_print_select(

View File

@ -445,7 +445,7 @@ if ($is_management_allowed === true
if ($aviable_name === true) { if ($aviable_name === true) {
$values = [ $values = [
'nombre' => $name, 'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4), 'icon' => $icon,
'parent' => $id_parent, 'parent' => $id_parent,
'disabled' => $alerts_disabled, 'disabled' => $alerts_disabled,
'custom_id' => $custom_id, 'custom_id' => $custom_id,
@ -513,7 +513,7 @@ if ($is_management_allowed === true && $update_group === true) {
if ($aviable_name === true) { if ($aviable_name === true) {
$values = [ $values = [
'nombre' => $name, 'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4), 'icon' => $icon,
'parent' => ($id_parent == -1) ? 0 : $id_parent, 'parent' => ($id_parent == -1) ? 0 : $id_parent,
'disabled' => !$alerts_enabled, 'disabled' => !$alerts_enabled,
'custom_id' => $custom_id, 'custom_id' => $custom_id,
@ -741,12 +741,11 @@ if ($is_management_allowed === true
// Credential store is loaded previously in this document to avoid // Credential store is loaded previously in this document to avoid
// process group tree - list forms. // process group tree - list forms.
ui_print_spinner(__('Loading'));
if ($tab == 'tree') { if ($tab == 'tree') {
/* /*
* Group tree view. * Group tree view.
*/ */
ui_print_spinner(__('Loading'));
echo "<div id='tree-controller-recipient'></div>"; echo "<div id='tree-controller-recipient'></div>";
} else { } else {
/* /*
@ -986,7 +985,7 @@ if ($tab == 'tree') {
true, true,
'offset', 'offset',
false, false,
'pagination-bottom' ''
); );
} else { } else {
ui_print_info_message( ui_print_info_message(
@ -1038,6 +1037,7 @@ $tab = 'group_edition';
<script type="text/javascript"> <script type="text/javascript">
var treeController = TreeController.getController(); var treeController = TreeController.getController();
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0) if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty(); treeController.recipient.empty();

View File

@ -364,6 +364,11 @@ if ($access_console_node === true) {
$sub2['godmode/setup/setup&section=net']['text'] = __('Netflow'); $sub2['godmode/setup/setup&section=net']['text'] = __('Netflow');
$sub2['godmode/setup/setup&section=net']['refr'] = 0; $sub2['godmode/setup/setup&section=net']['refr'] = 0;
} }
if ((bool) $config['activate_sflow'] === true) {
$sub2['godmode/setup/setup&section=sflow']['text'] = __('Sflow');
$sub2['godmode/setup/setup&section=sflow']['refr'] = 0;
}
} }
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus'); $sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus');

View File

@ -297,7 +297,7 @@ if (!empty($table->data)) {
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
ui_pagination($count_network_templates, false, $offset); ui_pagination($count_network_templates, false, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, '');
echo "<div class='pdd_l_5px right'>"; echo "<div class='pdd_l_5px right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>'; echo '</div>';

View File

@ -445,7 +445,7 @@ if (!empty($graphs)) {
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>"; echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom'); ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, '');
echo "<div class='right'>"; echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</form>'; echo '</form>';

View File

@ -137,8 +137,6 @@ echo $formHidden;
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filter-table-adv'; $table->class = 'databox filter-table-adv';
$table->size = []; $table->size = [];
$table->size[0] = '50%'; $table->size[0] = '50%';
@ -369,69 +367,65 @@ $(document).ready (function () {
$("#button-getsize").click(function(event){ $("#button-getsize").click(function(event){
event.preventDefault(); event.preventDefault();
if ($('#imagen').attr('src') != '') { if ($('#imagen').attr('src') != '') {
if (parseInt($('#imagen').width()) < 1024){ if (parseInt($('#imagen').width()) < 1024){
alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px'); alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024'); $('input[name=width]').val('1024');
$('#preimagew').html(1024); $('#preimagew').html(1024);
} else{
$('input[name=width]').val($('#imagen').width());
$('#preimagew').html($('#imagen').width());
}
if (parseInt($('#imagen').height()) < 768){
alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
} else{
$('input[name=height]').val($('#imagen').height());
$('#preimageh').html($('#imagen').height());
}
} else {
original_image=new Image();
url_hack_metaconsole = metaconsole_url();
original_image.src= url_hack_metaconsole + 'images/console/background/'+$('#background').val();
if (parseInt(original_image.width) < 1024){
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
} else {
$('input[name=width]').val(original_image.height);
$('#preimagew').html(original_image.height);
}
if (parseInt(original_image.height) < 768){
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
} else {
$('input[name=height]').val(original_image.height);
$('#preimageh').html(original_image.height);
}
} }
else{
$('input[name=width]').val($('#imagen').width());
$('#preimagew').html($('#imagen').width());
}
if (parseInt($('#imagen').height()) < 768){
alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
else{
$('input[name=height]').val($('#imagen').height());
$('#preimageh').html($('#imagen').height());
}
}
else{
original_image=new Image();
url_hack_metaconsole = metaconsole_url();
original_image.src= url_hack_metaconsole + 'images/console/background/'+$('#background').val();
if (parseInt(original_image.width) < 1024){
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
}
else{
$('input[name=width]').val(original_image.height);
$('#preimagew').html(original_image.height);
}
if (parseInt(original_image.height) < 768){
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
else{
$('input[name=height]').val(original_image.height);
$('#preimageh').html(original_image.height);
}
}
}); });
$( "input[type=submit]" ).click(function( event ) { $( "button[type=submit]" ).click(function( event ) {
if (parseInt($('input[name=width]').val()) < 1024){ console.log('aaaaaaaaaaa');
alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px'); if (parseInt($('input[name=width]').val()) < 1024){
$('input[name=width]').val('1024'); alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px');
$('#preimagew').html('1024'); $('input[name=width]').val('1024');
var x = 1; $('#preimagew').html('1024');
} var x = 1;
}
if (parseInt($('input[name=height]').val()) < 768){ if (parseInt($('input[name=height]').val()) < 768){
alert('Default height is '+$('input[name=height]').val()+'px, smaller than minimum -> 768px'); alert('Default height is '+$('input[name=height]').val()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768'); $('input[name=height]').val('768');
$('#preimageh').html('768'); $('#preimageh').html('768');
var y = 1; var y = 1;
} }
if (x || y){
return false;
}
if (x || y){
return false;
}
}); });
//Preload image size and activate auto image size changer when user click over a image in the selector //Preload image size and activate auto image size changer when user click over a image in the selector

View File

@ -63,7 +63,7 @@ if (empty($idVisualConsole) === true) {
$idVisualConsole = get_parameter('id', 0); $idVisualConsole = get_parameter('id', 0);
} }
if (!defined('METACONSOLE')) { if (is_metaconsole() === false) {
$action_name_parameter = 'action'; $action_name_parameter = 'action';
} else { } else {
$action_name_parameter = 'action2'; $action_name_parameter = 'action2';
@ -93,7 +93,6 @@ $activeTab = get_parameterBetweenListValues(
'data' 'data'
); );
// Visual console creation tab and actions. // Visual console creation tab and actions.
if (empty($idVisualConsole)) { if (empty($idVisualConsole)) {
$visualConsole = null; $visualConsole = null;
@ -137,7 +136,6 @@ $refr = (int) get_parameter('refr', $config['vc_refr']);
$id_layout = 0; $id_layout = 0;
// Save/Update data in DB // Save/Update data in DB
global $statusProcessInDB; global $statusProcessInDB;
if (empty($statusProcessInDB)) { if (empty($statusProcessInDB)) {
@ -786,7 +784,7 @@ if (isset($config['vc_refr']) and $config['vc_refr'] != 0) {
$view_refresh = '300'; $view_refresh = '300';
} }
if (!defined('METACONSOLE')) { if (is_metaconsole() === false) {
$url_base = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action='; $url_base = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action=';
$url_view = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$idVisualConsole.'&refr='.$view_refresh; $url_view = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$idVisualConsole.'&refr='.$view_refresh;
} else { } else {
@ -798,14 +796,18 @@ if (!defined('METACONSOLE')) {
$hash = User::generatePublicHash(); $hash = User::generatePublicHash();
$buttons = []; $buttons = [];
$buttons['consoles_list'] = [ $buttons['consoles_list'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=network&sec2=godmode/reporting/map_builder&refr='.$refr.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Visual consoles list'), 'class' => 'main_menu_icon invert_filter']).'</a>', 'text' => '<a href="index.php?sec=network&sec2=godmode/reporting/map_builder&refr='.$refr.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Visual consoles list'), 'class' => 'main_menu_icon invert_filter']).'</a>',
]; ];
$buttons['public_link'] = [ $buttons['public_link'] = [
'active' => false, 'active' => false,
'text' => '<a href="'.ui_get_full_url('operation/visual_console/public_console.php?hash='.$hash.'&refr='.$refr.'&id_layout='.$idVisualConsole.'&id_user='.$config['id_user']).'">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public Visual Console'), 'class' => 'main_menu_icon invert_filter']).'</a>', 'text' => '<a href="'.ui_get_full_url(
'operation/visual_console/public_console.php?hash='.$hash.'&refr='.$refr.'&id_layout='.$idVisualConsole.'&id_user='.$config['id_user'],
false,
false,
false
).'">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public Visual Console'), 'class' => 'main_menu_icon invert_filter']).'</a>',
]; ];
$buttons['data'] = [ $buttons['data'] = [
'active' => false, 'active' => false,
@ -839,7 +841,7 @@ $buttons['view'] = [
'text' => '<a href="'.$url_view.'">'.html_print_image('images/enable.svg', true, ['title' => __('View'), 'class' => 'main_menu_icon invert_filter']).'</a>', 'text' => '<a href="'.$url_view.'">'.html_print_image('images/enable.svg', true, ['title' => __('View'), 'class' => 'main_menu_icon invert_filter']).'</a>',
]; ];
if ($idVisualConsole === false) { if (empty($idVisualConsole) === true) {
$buttons = ['data' => $buttons['data']]; $buttons = ['data' => $buttons['data']];
// Show only the data tab // Show only the data tab
// If it is a fail try, reset the values // If it is a fail try, reset the values
@ -850,9 +852,8 @@ if ($idVisualConsole === false) {
$buttons[$activeTab]['active'] = true; $buttons[$activeTab]['active'] = true;
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : ''; $tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
ui_print_standard_header( ui_print_standard_header(
$visualConsoleName, ($visualConsoleName ?? ''),
'images/visual_console.png', 'images/visual_console.png',
false, false,
$tab_builder, $tab_builder,

View File

@ -65,7 +65,7 @@ switch ($action) {
$table = new stdClass(); $table = new stdClass();
$table->class = 'info_table'; $table->class = 'info_table';
$table->width = '98%'; $table->width = '100%';
$table->head[0] = __('Map connection name'); $table->head[0] = __('Map connection name');
$table->head[1] = __('Group'); $table->head[1] = __('Group');
$table->head[3] = __('Delete'); $table->head[3] = __('Delete');
@ -84,7 +84,7 @@ if ($mapsConnections !== false) {
'<a href="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2&amp;action=edit_connection_map&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'">'.$mapsConnection['conection_name'].'</a>', '<a href="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2&amp;action=edit_connection_map&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'">'.$mapsConnection['conection_name'].'</a>',
ui_print_group_icon($mapsConnection['group_id'], true), ui_print_group_icon($mapsConnection['group_id'], true),
'<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=gis&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'&amp;action=delete_connection" '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=gis&amp;id_connection_map='.$mapsConnection['id_tmap_connection'].'&amp;action=delete_connection"
onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>', onClick="javascript: if (!confirm(\''.__('Do you wan delete this connection?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>',
]; ];
$table->cellclass[][2] = 'table_action_buttons'; $table->cellclass[][2] = 'table_action_buttons';
} }
@ -95,6 +95,14 @@ html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form action="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2" method="post">'; echo '<form action="index.php?sec=gsetup&sec2=godmode/setup/gis_step_2" method="post">';
html_print_input_hidden('action', 'create_connection_map'); html_print_input_hidden('action', 'create_connection_map');
html_print_submit_button(__('Create'), '', false, 'class="sub next"'); html_print_action_buttons(
html_print_submit_button(
__('Create'),
'',
false,
['icon' => 'wand'],
true
)
);
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';

View File

@ -146,17 +146,41 @@ foreach ($osList as $os) {
$table->data[] = $data; $table->data[] = $data;
} }
$tablePagination = '';
if (isset($data) === true) { if (isset($data) === true) {
html_print_table($table); html_print_table($table);
ui_pagination($count_osList, ui_get_url_refresh(['message' => false]), $offset, 0, false, 'offset', true, 'pagination-bottom'); $tablePagination = ui_pagination(
$count_osList,
ui_get_url_refresh(['message' => false]),
$offset,
0,
true,
'offset',
false,
''
);
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]);
} }
$buttons = '';
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
echo '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">'; $buttons .= '<form method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=builder">';
echo "<div style='text-align:right;width:".$table->width."'>"; $buttons .= html_print_submit_button(
html_print_submit_button(__('Create OS'), '', false, 'class="sub next"'); __('Create OS'),
echo '</div>'; '',
echo '</form>'; false,
['icon' => 'next'],
true
);
$buttons .= '</form>';
} }
html_print_action_buttons(
$buttons,
[
'type' => 'data_table',
'class' => 'fixed_action_buttons',
'right_content' => $tablePagination,
]
);

View File

@ -154,6 +154,20 @@ if (check_acl($config['id_user'], 0, 'AW')) {
).'</a>', ).'</a>',
]; ];
} }
if ($config['activate_sflow']) {
$buttons['sflow'] = [
'active' => false,
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=sflow').'">'.html_print_image(
'images/op_recon.png',
true,
[
'title' => __('Sflow'),
'class' => 'invert_filter',
]
).'</a>',
];
}
} }
$buttons['integria'] = [ $buttons['integria'] = [
@ -277,6 +291,12 @@ switch ($section) {
$help_header = 'setup_netflow_tab'; $help_header = 'setup_netflow_tab';
break; break;
case 'sflow':
$buttons['sflow']['active'] = true;
$subpage = __('Sflow');
$help_header = 'setup_flow_tab';
break;
case 'ehorus': case 'ehorus':
$buttons['ehorus']['active'] = true; $buttons['ehorus']['active'] = true;
$subpage = __('eHorus'); $subpage = __('eHorus');
@ -410,6 +430,10 @@ switch ($section) {
include_once $config['homedir'].'/godmode/setup/setup_netflow.php'; include_once $config['homedir'].'/godmode/setup/setup_netflow.php';
break; break;
case 'sflow':
include_once $config['homedir'].'/godmode/setup/setup_sflow.php';
break;
case 'vis': case 'vis':
include_once $config['homedir'].'/godmode/setup/setup_visuals.php'; include_once $config['homedir'].'/godmode/setup/setup_visuals.php';
break; break;

View File

@ -403,6 +403,32 @@ $table->data[$i++][] = html_print_label_input_block(
) )
); );
$table->data[$i][] = html_print_label_input_block(
__('Enable Sflow'),
html_print_checkbox_switch_extended(
'activate_sflow',
1,
$config['activate_sflow'],
$rbt_disabled,
'',
'',
true
),
);
$table->data[$i++][] = html_print_label_input_block(
__('General network path'),
html_print_input_text(
'general_network_path',
$config['general_network_path'],
'',
40,
255,
true
)
);
$table->colspan[$i][] = 2; $table->colspan[$i][] = 2;
$table->data[$i++][] = html_print_label_input_block( $table->data[$i++][] = html_print_label_input_block(
__('Timezone setup'), __('Timezone setup'),

View File

@ -386,120 +386,132 @@ $table_alert_settings->data = [];
$table_alert_settings->width = '100%'; $table_alert_settings->width = '100%';
$table_alert_settings->styleTable = 'margin-bottom: 10px;'; $table_alert_settings->styleTable = 'margin-bottom: 10px;';
$table_alert_settings->id = 'integria-cr-settings-setup'; $table_alert_settings->id = 'integria-cr-settings-setup';
$table_alert_settings->class = 'databox filters'; $table_alert_settings->class = 'databox filters filter-table-adv';
$table_alert_settings->size['name'] = '30%'; $table_alert_settings->size[0] = '50%';
$table_alert_settings->style['name'] = 'font-weight: bold'; $table_alert_settings->size[1] = '50%';
// Alert incident title. // Alert incident title.
$row = []; $row = [];
$row['name'] = __('Title'); $row[0] = html_print_label_input_block(
$row['control'] = html_print_input_text( __('Title'),
'incident_title', html_print_input_text(
$config['incident_title'], 'incident_title',
__('Name'), $config['incident_title'],
50, __('Name'),
100, 50,
true, 100,
false, true,
false false,
false
)
); );
$table_alert_settings->data['custom_response_incident_title'] = $row;
// Alert incident description. // Alert incident description.
$row = []; $row[1] = html_print_label_input_block(
$row['name'] = __('Ticket body'); __('Ticket body'),
$row['control'] = html_print_textarea( html_print_textarea(
'incident_content', 'incident_content',
7, 3,
25, 25,
$config['incident_content'], $config['incident_content'],
'', '',
true true
)
); );
$table_alert_settings->data['custom_response_incident_content'] = $row; $table_alert_settings->data[0] = $row;
// Alert default group. // Alert default group.
$row = []; $row = [];
$row['name'] = __('Group'); $row[0] = html_print_label_input_block(
$row['control'] = html_print_select( __('Group'),
$integria_group_values, html_print_select(
'default_group', $integria_group_values,
$config['default_group'], 'default_group',
'', $config['default_group'],
__('Select'), '',
0, __('Select'),
true, 0,
false, true,
true, false,
'', true,
false '',
false
)
); );
$table_alert_settings->data['custom_response_def_group'] = $row;
// Alert default criticity. // Alert default criticity.
$row = []; $row[1] = html_print_label_input_block(
$row['name'] = __('Priority'); __('Priority'),
$row['control'] = html_print_select( html_print_select(
$integria_criticity_values, $integria_criticity_values,
'default_criticity', 'default_criticity',
$config['default_criticity'], $config['default_criticity'],
'', '',
__('Select'), __('Select'),
0, 0,
true, true,
false, false,
true, true,
'', '',
false false
)
); );
$table_alert_settings->data['custom_response_def_criticity'] = $row; $table_alert_settings->data[1] = $row;
// Alert default owner. // Alert default owner.
$row = []; $row = [];
$row['name'] = __('Owner'); $row[0] = html_print_label_input_block(
$row['control'] = html_print_autocomplete_users_from_integria( __('Owner'),
'default_owner', html_print_autocomplete_users_from_integria(
$config['default_owner'], 'default_owner',
true $config['default_owner'],
true,
'30',
false,
false,
'w100p'
),
['div_class' => 'inline']
); );
$table_alert_settings->data['custom_response_def_owner'] = $row;
// Alert default incident type. // Alert default incident type.
$row = []; $row[1] = html_print_label_input_block(
$row['name'] = __('Type'); __('Type'),
$row['control'] = html_print_select( html_print_select(
$integria_types_values, $integria_types_values,
'incident_type', 'incident_type',
$config['incident_type'], $config['incident_type'],
'', '',
__('Select'), __('Select'),
0, 0,
true, true,
false, false,
true, true,
'', '',
false false
)
); );
$table_alert_settings->data['custom_response_incident_type'] = $row; $table_alert_settings->data[2] = $row;
// Alert default incident status. // Alert default incident status.
$row = []; $row = [];
$row['name'] = __('Status'); $row[0] = html_print_label_input_block(
$row['control'] = html_print_select( __('Status'),
$integria_status_values, html_print_select(
'incident_status', $integria_status_values,
$config['incident_status'], 'incident_status',
'', $config['incident_status'],
__('Select'), '',
0, __('Select'),
true, 0,
false, true,
true, false,
'', true,
false '',
false
)
); );
$table_alert_settings->data['custom_response_incident_status'] = $row; $table_alert_settings->data[3] = $row;
// Custom response settings. // Custom response settings.
$table_cr_settings = new StdClass(); $table_cr_settings = new StdClass();
@ -507,121 +519,133 @@ $table_cr_settings->data = [];
$table_cr_settings->width = '100%'; $table_cr_settings->width = '100%';
$table_cr_settings->styleTable = 'margin-bottom: 10px;'; $table_cr_settings->styleTable = 'margin-bottom: 10px;';
$table_cr_settings->id = 'integria-cr-settings-setup'; $table_cr_settings->id = 'integria-cr-settings-setup';
$table_cr_settings->class = 'databox filters'; $table_cr_settings->class = 'databox filters filter-table-adv';
$table_cr_settings->size['name'] = '30%'; $table_cr_settings->size[0] = '50%';
$table_cr_settings->style['name'] = 'font-weight: bold'; $table_cr_settings->size[1] = '50%';
// Custom response incident title. // Custom response incident title.
$row = []; $row = [];
$row['name'] = __('Title'); $row[0] = html_print_label_input_block(
$row['control'] = html_print_input_text( __('Title'),
'cr_incident_title', html_print_input_text(
$config['cr_incident_title'], 'cr_incident_title',
__('Name'), $config['cr_incident_title'],
50, __('Name'),
100, 50,
true, 100,
false, true,
false false,
false
)
); );
$table_cr_settings->data['custom_response_incident_title'] = $row;
// Custom response incident description. // Custom response incident description.
$row = []; $row[1] = html_print_label_input_block(
$row['name'] = __('Ticket body'); __('Ticket body'),
$row['control'] = html_print_textarea( html_print_textarea(
'cr_incident_content', 'cr_incident_content',
7, 3,
25, 25,
$config['cr_incident_content'], $config['cr_incident_content'],
'', '',
true true
)
); );
$table_cr_settings->data['custom_response_incident_content'] = $row; $table_cr_settings->data[0] = $row;
// Custom response default group. // Custom response default group.
$row = []; $row = [];
$row['name'] = __('Group'); $row[0] = html_print_label_input_block(
$row['control'] = html_print_select( __('Group'),
$integria_group_values, html_print_select(
'cr_default_group', $integria_group_values,
$config['cr_default_group'], 'cr_default_group',
'', $config['cr_default_group'],
__('Select'), '',
0, __('Select'),
true, 0,
false, true,
true, false,
'', true,
false '',
false
)
); );
$table_cr_settings->data['custom_response_def_group'] = $row;
// Custom response default criticity. // Custom response default criticity.
$row = []; $row[1] = html_print_label_input_block(
$row['name'] = __('Priority'); __('Priority'),
$row['control'] = html_print_select( html_print_select(
$integria_criticity_values, $integria_criticity_values,
'cr_default_criticity', 'cr_default_criticity',
$config['cr_default_criticity'], $config['cr_default_criticity'],
'', '',
__('Select'), __('Select'),
0, 0,
true, true,
false, false,
true, true,
'', '',
false false
)
); );
$table_cr_settings->data['custom_response_def_criticity'] = $row; $table_cr_settings->data[1] = $row;
// Custom response default owner. // Custom response default owner.
$row = []; $row = [];
$row['name'] = __('Owner'); $row[0] = html_print_label_input_block(
$row['control'] = html_print_autocomplete_users_from_integria( __('Owner'),
'cr_default_owner', html_print_autocomplete_users_from_integria(
$config['cr_default_owner'], 'cr_default_owner',
true $config['cr_default_owner'],
true,
'30',
false,
false,
'w100p'
),
['div_class' => 'inline']
); );
$table_cr_settings->data['custom_response_def_owner'] = $row;
// Custom response default incident type. // Custom response default incident type.
$row = []; $row[1] = html_print_label_input_block(
$row['name'] = __('Type'); __('Type'),
$row['control'] = html_print_select( html_print_select(
$integria_types_values, $integria_types_values,
'cr_incident_type', 'cr_incident_type',
$config['cr_incident_type'], $config['cr_incident_type'],
'', '',
__('Select'), __('Select'),
0, 0,
true, true,
false, false,
true, true,
'', '',
false false
)
); );
$table_cr_settings->data['custom_response_incident_type'] = $row; $table_cr_settings->data[2] = $row;
// Custom response default incident status. // Custom response default incident status.
$row = []; $row = [];
$row['name'] = __('Status'); $row[0] = html_print_label_input_block(
$row['control'] = html_print_select( __('Status'),
$integria_status_values, html_print_select(
'cr_incident_status', $integria_status_values,
$config['cr_incident_status'], 'cr_incident_status',
'', $config['cr_incident_status'],
__('Select'), '',
0, __('Select'),
true, 0,
false, true,
true, false,
'', true,
false '',
false
)
); );
$table_cr_settings->data['custom_response_incident_status'] = $row; $table_cr_settings->data[3] = $row;
// Test. // Test.
$row = []; $row = [];
@ -682,7 +706,7 @@ echo '</div>';
if ($has_connection != false) { if ($has_connection != false) {
// Form alert default settings. // Form alert default settings.
echo '<div id="form_alert_settings">'; echo '<div id="form_alert_settings">';
echo '<fieldset>'; echo '<fieldset class="mrgn_top_15px">';
echo '<legend>'.__('Alert default values').'&nbsp'.ui_print_help_icon('alert_macros', true).'</legend>'; echo '<legend>'.__('Alert default values').'&nbsp'.ui_print_help_icon('alert_macros', true).'</legend>';
html_print_table($table_alert_settings); html_print_table($table_alert_settings);
@ -692,7 +716,7 @@ if ($has_connection != false) {
// Form custom response default settings. // Form custom response default settings.
echo '<div id="form_custom_response_settings">'; echo '<div id="form_custom_response_settings">';
echo '<fieldset>'; echo '<fieldset class="mrgn_top_15px">';
echo '<legend>'.__('Event custom response default values').'&nbsp'.ui_print_help_icon('alert_macros', true).'</legend>'; echo '<legend>'.__('Event custom response default values').'&nbsp'.ui_print_help_icon('alert_macros', true).'</legend>';
html_print_table($table_cr_settings); html_print_table($table_cr_settings);

View File

@ -43,7 +43,7 @@ $table->data = [];
$table->data[0][] = html_print_label_input_block( $table->data[0][] = html_print_label_input_block(
__('Data storage path'), __('Data storage path'),
html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true) html_print_input_text('netflow_name_dir', $config['netflow_name_dir'], false, 50, 200, true)
); );
$table->data[0][] = html_print_label_input_block( $table->data[0][] = html_print_label_input_block(
@ -100,3 +100,9 @@ html_print_action_buttons(
) )
); );
echo '</form>'; echo '</form>';
?>
<script>
$("input[name=netflow_name_dir]").on("input", function() {
$(this).val($(this).val().replace(/[^a-z0-9]/gi, ""));
});
</script>

View File

@ -0,0 +1,108 @@
<?php
/**
* Setup view for sflow
*
* @category Setup
* @package Pandora FMS
* @subpackage Configuration
* @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.
* ============================================================================
*/
// Begin.
global $config;
require_once 'include/functions_ui.php';
check_login();
$update = (bool) get_parameter('update');
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->data = [];
$table->data[0][] = html_print_label_input_block(
__('Data storage path'),
html_print_input_text('sflow_name_dir', $config['sflow_name_dir'], false, 50, 200, true)
);
$table->data[0][] = html_print_label_input_block(
__('Daemon interval'),
html_print_input_text('sflow_interval', $config['sflow_interval'], false, 50, 200, true)
);
$table->data[1][] = html_print_label_input_block(
__('Daemon binary path'),
html_print_input_text('sflow_daemon', $config['sflow_daemon'], false, 50, 200, true)
);
$table->data[1][] = html_print_label_input_block(
__('Nfdump binary path'),
html_print_input_text('sflow_nfdump', $config['sflow_nfdump'], false, 50, 200, true)
);
$table->data[2][] = html_print_label_input_block(
__('Nfexpire binary path'),
html_print_input_text('sflow_nfexpire', $config['sflow_nfexpire'], false, 50, 200, true)
);
$table->data[2][] = html_print_label_input_block(
__('Maximum chart resolution'),
html_print_input_text('sflow_max_resolution', $config['sflow_max_resolution'], false, 50, 200, true)
);
$table->data[3][] = html_print_label_input_block(
__('Disable custom live view filters'),
html_print_checkbox_switch('sflow_disable_custom_lvfilters', 1, $config['sflow_disable_custom_lvfilters'], true)
);
$table->data[3][] = html_print_label_input_block(
__('Sflow max lifetime'),
html_print_input_text('sflow_max_lifetime', $config['sflow_max_lifetime'], false, 50, 200, true)
);
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$table->data[4][] = html_print_label_input_block(
__('Name resolution for IP address'),
html_print_checkbox_switch_extended('sflow_get_ip_hostname', 1, $config['sflow_get_ip_hostname'], false, $onclick, '', true)
);
echo '<form class="max_floating_element_size" id="sflow_setup" method="post">';
html_print_table($table);
html_print_input_hidden('update_config', 1);
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'upd_button',
false,
['icon' => 'update'],
true
)
);
echo '</form>';
?>
<script>
$("input[name=sflow_name_dir]").on("input", function() {
$(this).val($(this).val().replace(/[^a-z0-9]/gi, ""));
});
</script>

View File

@ -50,7 +50,7 @@ try {
[ [
'id' => $tableId, 'id' => $tableId,
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $column_names, 'column_names' => $column_names,
'ajax_url' => 'include/ajax/update_manager', 'ajax_url' => 'include/ajax/update_manager',
@ -66,12 +66,13 @@ try {
[ [
'label' => __('Free search'), 'label' => __('Free search'),
'type' => 'text', 'type' => 'text',
'class' => 'mw250px', 'class' => 'w400px',
'id' => 'free_search', 'id' => 'free_search',
'name' => 'free_search', 'name' => 'free_search',
], ],
], ],
], ],
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar ',
] ]
); );
} catch (Exception $e) { } catch (Exception $e) {

View File

@ -256,133 +256,158 @@ if ((bool) is_metaconsole() === true) {
); );
} }
echo '<form method="post" action="'.$action.'">'; echo '<form method="post" action="'.$action.'" class="max_floating_element_size">';
html_print_input_hidden('update_config', 1); html_print_input_hidden('update_config', 1);
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters filter-table-adv';
$table->size[0] = '50%';
$i = 0; $table->size[1] = '50%';
$table->style[$i] = 'font-weight: bolder;width:250px';
$url_update_manager = update_manager_get_url(); $url_update_manager = update_manager_get_url();
$table->data[$i][0] = __('Warp Update URL'); $table->data[0][0] = html_print_label_input_block(
$table->data[$i++][1] = html_print_input_text( __('Warp Update URL'),
'url_update_manager', html_print_input_text(
$url_update_manager, 'url_update_manager',
__('URL update manager'), $url_update_manager,
80, __('URL update manager'),
255, 80,
true, 255,
true true,
true
)
); );
$table->data[$i][0] = __('Use secured Warp Update'); $table->data[0][1] = html_print_label_input_block(
$table->data[$i++][1] = html_print_input( __('Use secured Warp Update'),
[ html_print_input(
'type' => 'switch', [
'name' => 'secure_update_manager', 'type' => 'switch',
'value' => ($secure_update_manager ?? 1), 'name' => 'secure_update_manager',
] 'value' => ($secure_update_manager ?? 1),
]
)
); );
$table->data[$i][0] = __('Proxy server'); $table->data[1][0] = html_print_label_input_block(
$table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_server',
$update_manager_proxy_server,
__('Proxy server'), __('Proxy server'),
80, html_print_input_text(
60, 'update_manager_proxy_server',
true $update_manager_proxy_server,
__('Proxy server'),
80,
60,
true
)
); );
$table->data[$i][0] = __('Proxy port'); $table->data[1][1] = html_print_label_input_block(
$table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_port',
$update_manager_proxy_port,
__('Proxy port'), __('Proxy port'),
80, html_print_input_text(
60, 'update_manager_proxy_port',
true $update_manager_proxy_port,
__('Proxy port'),
80,
60,
true
)
); );
$table->data[$i][0] = __('Proxy user'); $table->data[2][0] = html_print_label_input_block(
$table->data[$i++][1] = html_print_input_text(
'update_manager_proxy_user',
$update_manager_proxy_user,
__('Proxy user'), __('Proxy user'),
80, html_print_input_text(
60, 'update_manager_proxy_user',
true $update_manager_proxy_user,
__('Proxy user'),
80,
60,
true
)
); );
$table->data[$i][0] = __('Proxy password'); $table->data[2][1] = html_print_label_input_block(
$table->data[$i++][1] = html_print_input_password(
'update_manager_proxy_password',
$update_manager_proxy_password,
__('Proxy password'), __('Proxy password'),
80, html_print_input_password(
60, 'update_manager_proxy_password',
true $update_manager_proxy_password,
__('Proxy password'),
80,
60,
true
)
); );
$table->data[$i][0] = __('Allow no-consecutive patches'); $table->data[3][0] = html_print_label_input_block(
$table->data[$i++][1] = html_print_switch( __('Allow no-consecutive patches'),
[ html_print_switch(
'name' => 'allow_offline_patches', [
'value' => $allow_offline_patches, 'name' => 'allow_offline_patches',
'return' => true, 'value' => $allow_offline_patches,
] 'return' => true,
]
)
); );
$table->data[$i][0] = __('Limit to LTS updates'); $table->data[3][1] = html_print_label_input_block(
$table->data[$i++][1] = html_print_switch( __('Limit to LTS updates'),
[ html_print_switch(
'name' => 'lts_updates', [
'value' => $lts_updates, 'name' => 'lts_updates',
'return' => true, 'value' => $lts_updates,
] 'return' => true,
]
)
); );
$table->data[4][0] = html_print_label_input_block(
$table->data[$i][0] = __('Registration ID'); __('Registration ID'),
$table->data[$i++][1] = '<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>'; '<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>'
);
if (update_manager_verify_registration() === true && users_is_admin()) { if (update_manager_verify_registration() === true && users_is_admin()) {
$table->data[$i][0] = __('Cancel registration'); $url = '<a href="';
$table->data[$i][1] = '<a href="';
if ((bool) is_metaconsole() === true) { if ((bool) is_metaconsole() === true) {
$table->data[$i][1] .= ui_get_full_url( $url .= ui_get_full_url(
'index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=update_manager_setup&um_disconnect_console=1' 'index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=update_manager_setup&um_disconnect_console=1'
); );
} else { } else {
$table->data[$i][1] .= ui_get_full_url( $url .= ui_get_full_url(
'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=setup&um_disconnect_console=1' 'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=setup&um_disconnect_console=1'
); );
} }
$table->data[$i++][1] .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">'.__('Unregister').'</a>'; $url .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">'.__('Unregister').'</a>';
$table->data[4][1] = html_print_label_input_block(
__('Cancel registration'),
$url
);
} }
if (license_free()) { if (license_free()) {
$config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1; $config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1;
$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[4][1] = html_print_label_input_block(
$table->data[$i++][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_button('identification_reminder', 0, '', $config['identification_reminder'], true); __('%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),
'<div class="inline-radio-button">
'.__('Yes').html_print_radio_button('realtimestats', 1, '', $config['realtimestats'], true).'&nbsp;&nbsp;
'.__('No').html_print_radio_button('realtimestats', 0, '', $config['realtimestats'], true).'</div>'
);
} }
html_print_input_hidden('action_update_url_update_manager', 1); html_print_input_hidden('action_update_url_update_manager', 1);
html_print_input_hidden('update_config', 1); html_print_input_hidden('update_config', 1);
html_print_table($table); html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">'; html_print_action_buttons(
html_print_submit_button( html_print_submit_button(
__('Update'), __('Update'),
'update_button', 'update_button',
false, false,
'class="sub upd"' ['icon' => 'wand'],
true
)
); );
echo '</div>';
echo '</form>'; echo '</form>';

View File

@ -393,6 +393,7 @@ if ($create_user === true) {
$values['default_event_filter'] = (int) get_parameter('default_event_filter'); $values['default_event_filter'] = (int) get_parameter('default_event_filter');
$values['default_custom_view'] = (int) get_parameter('default_custom_view'); $values['default_custom_view'] = (int) get_parameter('default_custom_view');
$values['time_autorefresh'] = (int) get_parameter('time_autorefresh', 0); $values['time_autorefresh'] = (int) get_parameter('time_autorefresh', 0);
$values['show_tips_startup'] = (int) get_parameter_switch('show_tips_startup');
$dashboard = get_parameter('dashboard', ''); $dashboard = get_parameter('dashboard', '');
$visual_console = get_parameter('visual_console', ''); $visual_console = get_parameter('visual_console', '');

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -26,6 +26,8 @@
* ============================================================================ * ============================================================================
*/ */
use PandoraFMS\Enterprise\Metaconsole\Node;
if (is_ajax() === true) { if (is_ajax() === true) {
global $config; global $config;
@ -216,6 +218,12 @@ if (is_ajax() === true) {
if ($getInfo === true) { if ($getInfo === true) {
enterprise_include_once('include/functions_agents.php'); enterprise_include_once('include/functions_agents.php');
$id = get_parameter('id', 0); $id = get_parameter('id', 0);
$id_server = get_parameter('id_server', 0);
if (empty($id_server) === false) {
$nd = new Node($id_server);
$nd->connect();
}
switch ($type) { switch ($type) {
case 3: case 3:
case 2: case 2:
@ -375,6 +383,10 @@ if (is_ajax() === true) {
} }
break; break;
} }
if (empty($id_server) === false) {
$nd->disconnect();
}
} }
return; return;

View File

@ -1390,7 +1390,7 @@ if (check_login()) {
false, false,
'offset', 'offset',
true, true,
'pagination-bottom', '',
'pagination_list_modules(offset_param)', 'pagination_list_modules(offset_param)',
[ [
'count' => '', 'count' => '',
@ -1692,6 +1692,18 @@ if (check_login()) {
$where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND '; $where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND ';
} }
if (str_contains($status, '6') === true) {
$expl = explode(',', $status);
$exist = array_search('6', $expl);
if (isset($exist) === true) {
unset($expl[$exist]);
}
array_push($expl, '1', '2');
$status = implode(',', $expl);
}
$where .= sprintf( $where .= sprintf(
'tagente_estado.estado IN (%s) 'tagente_estado.estado IN (%s)
AND tagente_modulo.delete_pending = 0', AND tagente_modulo.delete_pending = 0',

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,8 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC230323'; $build_version = 'PC230327';
$pandora_version = 'v7.0NG.769'; $pandora_version = 'v7.0NG.770';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get(); $script_tz = @date_default_timezone_get();

View File

@ -260,6 +260,24 @@ function config_update_config()
$error_update[] = __('Enable Netflow'); $error_update[] = __('Enable Netflow');
} }
if (config_update_value('activate_sflow', (bool) get_parameter('activate_sflow'), true) === false) {
$error_update[] = __('Enable Sflow');
}
if (config_update_value('general_network_path', get_parameter('general_network_path'), true) === false) {
$error_update[] = __('General network path');
} else {
if (empty($config['netflow_name_dir']) === false && $config['netflow_name_dir'] !== '') {
$path = get_parameter('general_network_path');
config_update_value('netflow_path', $path.$config['netflow_name_dir']);
}
if (empty($config['sflow_name_dir']) === false && $config['sflow_name_dir'] !== '') {
$path = get_parameter('general_network_path');
config_update_value('sflow_path', $path.$config['sflow_name_dir']);
}
}
$timezone = (string) get_parameter('timezone'); $timezone = (string) get_parameter('timezone');
if (empty($timezone) === true || config_update_value('timezone', $timezone, true) === false) { if (empty($timezone) === true || config_update_value('timezone', $timezone, true) === false) {
$error_update[] = __('Timezone setup'); $error_update[] = __('Timezone setup');
@ -1505,8 +1523,13 @@ function config_update_config()
break; break;
case 'net': case 'net':
if (config_update_value('netflow_path', get_parameter('netflow_path'), true) === false) { if (config_update_value('netflow_name_dir', get_parameter('netflow_name_dir'), true) === false) {
$error_update[] = __('Data storage path'); $error_update[] = __('Name storage path');
} else {
if (empty($config['general_network_path']) === false && $config['general_network_path'] !== '') {
$name = get_parameter('netflow_name_dir');
config_update_value('netflow_path', $config['general_network_path'].$name);
}
} }
if (config_update_value('netflow_interval', (int) get_parameter('netflow_interval'), true) === false) { if (config_update_value('netflow_interval', (int) get_parameter('netflow_interval'), true) === false) {
@ -1542,6 +1565,49 @@ function config_update_config()
} }
break; break;
case 'sflow':
if (config_update_value('sflow_name_dir', get_parameter('sflow_name_dir'), true) === false) {
$error_update[] = __('Sflow name dir');
} else {
if (empty($config['general_network_path']) === false && $config['general_network_path'] !== '') {
$name = get_parameter('sflow_name_dir');
config_update_value('sflow_path', $config['general_network_path'].$name);
}
}
if (config_update_value('sflow_interval', (int) get_parameter('sflow_interval'), true) === false) {
$error_update[] = __('Daemon interval');
}
if (config_update_value('sflow_daemon', get_parameter('sflow_daemon'), true) === false) {
$error_update[] = __('Daemon binary path');
}
if (config_update_value('sflow_nfdump', get_parameter('sflow_nfdump'), true) === false) {
$error_update[] = __('Nfdump binary path');
}
if (config_update_value('sflow_nfexpire', get_parameter('sflow_nfexpire'), true) === false) {
$error_update[] = __('Nfexpire binary path');
}
if (config_update_value('sflow_max_resolution', (int) get_parameter('sflow_max_resolution'), true) === false) {
$error_update[] = __('Maximum chart resolution');
}
if (config_update_value('sflow_disable_custom_lvfilters', get_parameter('sflow_disable_custom_lvfilters'), true) === false) {
$error_update[] = __('Disable custom live view filters');
}
if (config_update_value('sflow_max_lifetime', (int) get_parameter('sflow_max_lifetime'), true) === false) {
$error_update[] = __('Sflow max lifetime');
}
if (config_update_value('sflow_get_ip_hostname', (int) get_parameter('sflow_get_ip_hostname'), true) === false) {
$error_update[] = __('Name resolution for IP address');
}
break;
case 'log': case 'log':
if (config_update_value('elasticsearch_ip', get_parameter('elasticsearch_ip'), true) === false) { if (config_update_value('elasticsearch_ip', get_parameter('elasticsearch_ip'), true) === false) {
$error_update[] = __('IP ElasticSearch server'); $error_update[] = __('IP ElasticSearch server');
@ -2565,7 +2631,7 @@ function config_process_config()
} }
if (!isset($config['custom_logo_login'])) { if (!isset($config['custom_logo_login'])) {
config_update_value('custom_logo_login', 'login_logo_v7.png'); config_update_value('custom_logo_login', 'Pandora-FMS-1.png');
} }
if (!isset($config['custom_splash_login'])) { if (!isset($config['custom_splash_login'])) {
@ -2629,7 +2695,7 @@ function config_process_config()
} }
if (!isset($config['background_opacity'])) { if (!isset($config['background_opacity'])) {
config_update_value('background_opacity', 30); config_update_value('background_opacity', 20);
} }
if (!isset($config['meta_background_opacity'])) { if (!isset($config['meta_background_opacity'])) {
@ -2649,7 +2715,7 @@ function config_process_config()
} }
if (!isset($config['meta_custom_logo_login'])) { if (!isset($config['meta_custom_logo_login'])) {
config_update_value('meta_custom_logo_login', 'pandora_logo.png'); config_update_value('meta_custom_logo_login', 'Pandora-FMS-1.png');
} }
if (!isset($config['meta_custom_splash_login'])) { if (!isset($config['meta_custom_splash_login'])) {
@ -2776,6 +2842,28 @@ function config_process_config()
config_update_value('activate_netflow', 0); config_update_value('activate_netflow', 0);
} }
if (!isset($config['activate_sflow'])) {
config_update_value('activate_sflow', 0);
}
if (!isset($config['general_network_path'])) {
if ($is_windows) {
$default = 'C:\PandoraFMS\Pandora_Server\data_in\\';
} else {
$default = '/var/spool/pandora/data_in/';
}
config_update_value('general_network_path', $default);
}
if (!isset($config['netflow_name_dir'])) {
config_update_value('netflow_name_dir', 'netflow');
}
if (!isset($config['sflow_name_dir'])) {
config_update_value('sflow_name_dir', 'sflow');
}
if (!isset($config['netflow_path'])) { if (!isset($config['netflow_path'])) {
if ($is_windows) { if ($is_windows) {
$default = 'C:\PandoraFMS\Pandora_Server\data_in\netflow'; $default = 'C:\PandoraFMS\Pandora_Server\data_in\netflow';
@ -2814,6 +2902,48 @@ function config_process_config()
config_update_value('netflow_max_lifetime', '5'); config_update_value('netflow_max_lifetime', '5');
} }
if (!isset($config['sflow_interval'])) {
config_update_value('sflow_interval', SECONDS_10MINUTES);
}
if (!isset($config['sflow_daemon'])) {
config_update_value('sflow_daemon', '/usr/bin/sfcapd');
}
if (!isset($config['sflow_nfdump'])) {
config_update_value('sflow_nfdump', '/usr/bin/nfdump');
}
if (!isset($config['sflow_nfexpire'])) {
config_update_value('sflow_nfexpire', '/usr/bin/nfexpire');
}
if (!isset($config['sflow_max_resolution'])) {
config_update_value('sflow_max_resolution', '50');
}
if (!isset($config['sflow_disable_custom_lvfilters'])) {
config_update_value('sflow_disable_custom_lvfilters', 0);
}
if (!isset($config['sflow_max_lifetime'])) {
config_update_value('sflow_max_lifetime', '5');
}
if (!isset($config['sflow_name_dir'])) {
config_update_value('sflow_name_dir', 'sflow');
}
if (!isset($config['sflow_path'])) {
if ($is_windows) {
$default = 'C:\PandoraFMS\Pandora_Server\data_in\sflow';
} else {
$default = '/var/spool/pandora/data_in/sflow';
}
config_update_value('sflow_path', $default);
}
if (!isset($config['auth'])) { if (!isset($config['auth'])) {
config_update_value('auth', 'mysql'); config_update_value('auth', 'mysql');
} }

View File

@ -1494,7 +1494,8 @@ function events_get_all(
break; break;
case EVENT_GROUP_REP_EXTRAIDS: case EVENT_GROUP_REP_EXTRAIDS:
// Group by events. // Group by events and ignore null.
$sql_filters[] = 'AND te.id_extra IS NOT NULL AND te.id_extra <> ""';
$group_by .= 'te.id_extra'; $group_by .= 'te.id_extra';
break; break;
} }

View File

@ -626,7 +626,7 @@ function filemanager_file_explorer(
$table->width = '100%'; $table->width = '100%';
$table->id = 'table_filemanager'; $table->id = 'table_filemanager';
$table->class = (is_metaconsole() === true) ? 'databox_tactical' : 'info_table'; $table->class = 'info_table';
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>'; $table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
$table->colspan = []; $table->colspan = [];
$table->data = []; $table->data = [];
@ -751,7 +751,7 @@ function filemanager_file_explorer(
&& ($readOnly === false) && ($readOnly === false)
) { ) {
$data[4] .= '<form method="post" action="'.$url.'" style="">'; $data[4] .= '<form method="post" action="'.$url.'" style="">';
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter" src="images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; $data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter main_menu_icon" src="../../images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true); $data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true);
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true); $data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true);
$data[4] .= html_print_input_hidden('delete_file', 1, true); $data[4] .= html_print_input_hidden('delete_file', 1, true);
@ -896,7 +896,7 @@ function filemanager_file_explorer(
$uploadFileElements .= html_print_input_hidden('upload_file', 1, true); $uploadFileElements .= html_print_input_hidden('upload_file', 1, true);
} }
$uploadFileElements .= html_print_submit_button(__('Go'), 'go', false, [ 'class' => 'submitButton', 'style' => 'float:right', 'icon' => 'next'], true); $uploadFileElements .= html_print_submit_button(__('Go'), 'go', false, [ 'class' => 'submitButton', 'style' => 'float:right; margin-top: 10px;', 'icon' => 'next'], true);
$uploadFileElements .= html_print_input_hidden('real_directory', $real_directory, true); $uploadFileElements .= html_print_input_hidden('real_directory', $real_directory, true);
$uploadFileElements .= html_print_input_hidden('directory', $relative_directory, true); $uploadFileElements .= html_print_input_hidden('directory', $relative_directory, true);
$uploadFileElements .= html_print_input_hidden('hash', md5($real_directory.$relative_directory.$config['server_unique_identifier']), true); $uploadFileElements .= html_print_input_hidden('hash', md5($real_directory.$relative_directory.$config['server_unique_identifier']), true);

View File

@ -4788,13 +4788,16 @@ function html_print_input_file($name, $return=false, $options=false)
if (isset($options['accept']) === true) { if (isset($options['accept']) === true) {
$output .= ' accept="'.$options['accept'].'"'; $output .= ' accept="'.$options['accept'].'"';
} }
$label = '';
if (isset($options['label']) === true) {
$label = $options['label'];
}
} }
// Close input. // Close input.
$output .= '/>'; $output .= '/>';
if (is_metaconsole() === false) { $output .= ($options['caption'] ?? __('Select a file'));
$output .= ($options['caption'] ?? __('Select a file'));
}
$output .= '</label>'; $output .= '</label>';
$output .= '<span class="inputFileSpan" id="span-'.$name.'">&nbsp;</span>'; $output .= '<span class="inputFileSpan" id="span-'.$name.'">&nbsp;</span>';

View File

@ -68,6 +68,11 @@ function menu_print_menu(&$menu)
$sec2 = 'godmode/alerts/alert_commands'; $sec2 = 'godmode/alerts/alert_commands';
} else if ($sec2 === 'enterprise/godmode/setup/edit_skin') { } else if ($sec2 === 'enterprise/godmode/setup/edit_skin') {
$sec2 = 'enterprise/godmode/setup/setup_skins'; $sec2 = 'enterprise/godmode/setup/setup_skins';
} else if ($sec2 === 'operation/gis_maps/render_view') {
$map_id = (int) get_parameter('map_id');
if (empty($map_id) === false) {
$sec2 .= '&map_id='.$map_id;
}
} else if ($sec2 === 'godmode/servers/discovery') { } else if ($sec2 === 'godmode/servers/discovery') {
$wiz = (string) get_parameter('wiz'); $wiz = (string) get_parameter('wiz');
$sec2 = 'godmode/servers/discovery&wiz='.$wiz; $sec2 = 'godmode/servers/discovery&wiz='.$wiz;
@ -263,6 +268,7 @@ function menu_print_menu(&$menu)
if (($sec2 == $subsec2 || $allsec2 == $subsec2 if (($sec2 == $subsec2 || $allsec2 == $subsec2
|| $selected_submenu2) && isset($sub[$subsec2]['options']) || $selected_submenu2) && isset($sub[$subsec2]['options'])
&& (get_parameter_get($sub[$subsec2]['options']['name']) == $sub[$subsec2]['options']['value']) && (get_parameter_get($sub[$subsec2]['options']['name']) == $sub[$subsec2]['options']['value'])
&& $main['id'] !== 'fav-menu'
) { ) {
// If the subclass is selected and there are options and that options value is true. // If the subclass is selected and there are options and that options value is true.
$class .= 'submenu_selected selected'; $class .= 'submenu_selected selected';
@ -270,7 +276,7 @@ function menu_print_menu(&$menu)
$menu2_selected = $sub['id']; $menu2_selected = $sub['id'];
$selected = true; $selected = true;
$visible = true; $visible = true;
} else if (($sec2 === $subsec2 || $allsec2 === $subsec2 || $selected_submenu2 === true) && isset($sub[$subsec2]['options']) === false) { } else if (($sec2 === $subsec2 || $allsec2 === $subsec2 || $selected_submenu2 === true) && isset($sub[$subsec2]['options']) === false && $main['id'] !== 'fav-menu') {
$class .= 'submenu_selected selected'; $class .= 'submenu_selected selected';
$selected = true; $selected = true;
$menu_selected = true; $menu_selected = true;
@ -392,7 +398,7 @@ function menu_print_menu(&$menu)
$class = 'sub_subMenu'; $class = 'sub_subMenu';
if ($key == $sec2) { if ($key == $sec2 && $main['id'] !== 'fav-menu') {
$class .= ' selected'; $class .= ' selected';
} }

View File

@ -1025,9 +1025,29 @@ function netflow_get_command($options, $filter)
// Build command. // Build command.
$command = io_safe_output($config['netflow_nfdump']).' -N'; $command = io_safe_output($config['netflow_nfdump']).' -N';
// Netflow data path. if ($config['activate_sflow'] && $config['activate_netflow']) {
if (isset($config['netflow_path']) && $config['netflow_path'] != '') { if (isset($config['sflow_name_dir']) && $config['sflow_name_dir'] !== ''
$command .= ' -R. -M '.$config['netflow_path']; && isset($config['netflow_name_dir']) && $config['netflow_name_dir'] !== ''
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
) {
$command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir'].':'.$config['sflow_name_dir'];
}
} else {
if ($config['activate_sflow']) {
if (isset($config['sflow_name_dir']) && $config['sflow_name_dir'] !== ''
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
) {
$command .= ' -R. -M '.$config['general_network_path'].$config['sflow_name_dir'];
}
}
if ($config['activate_netflow']) {
if (isset($config['netflow_name_dir']) && $config['netflow_name_dir'] !== ''
&& isset($config['general_network_path']) && $config['general_network_path'] !== ''
) {
$command .= ' -R. -M '.$config['general_network_path'].$config['netflow_name_dir'];
}
}
} }
// Add options. // Add options.
@ -1035,7 +1055,6 @@ function netflow_get_command($options, $filter)
// Filter options. // Filter options.
$command .= ' '.netflow_get_filter_arguments($filter); $command .= ' '.netflow_get_filter_arguments($filter);
return $command; return $command;
} }

View File

@ -946,6 +946,20 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
function widthGraph () { function widthGraph () {
var parentWidth = $('.max-graph-tree-view').parent().width(); var parentWidth = $('.max-graph-tree-view').parent().width();
$('.max-graph-tree-view').children().width(parentWidth + 5); $('.max-graph-tree-view').children().width(parentWidth + 5);
$('<input>').attr({
type: 'hidden',
id: 'graph-counter',
value: 1
}).appendTo('#container');
if ($('#graph-counter').val() == 1) {
$('.max-graph-tree-view div.flot-x-axis').css('inset', '-25px').css('margin-top', '10px').css('margin-left', '10px');
$('.max-graph-tree-view canvas.flot-base').css('height', '85px');
$('#graph-counter').val(2);
}
} }
</script>"; </script>";

View File

@ -269,6 +269,7 @@
$(this).change(function() { $(this).change(function() {
var id_os = this.value; var id_os = this.value;
$("select#id_os").select2("close");
var home_url; var home_url;
if (typeof settings == "undefined") home_url = "./"; if (typeof settings == "undefined") home_url = "./";

View File

@ -1562,3 +1562,36 @@ function showManualThresholds(element) {
$(".dashboard-input-threshold-critical").addClass("invisible_important"); $(".dashboard-input-threshold-critical").addClass("invisible_important");
} }
} }
/**
* @return {void}
*/
// eslint-disable-next-line no-unused-vars
function type_change() {
var type = document.getElementById("type").value;
switch (type) {
case "3":
$("#li_tags").hide();
$("#li_groups").hide();
$("#li_module_groups").hide();
break;
case "2":
$("#li_tags").hide();
$("#li_groups").hide();
$("#li_module_groups").show();
break;
case "1":
$("#li_tags").show();
$("#li_groups").hide();
$("#li_module_groups").hide();
break;
default:
case "0":
$("#li_tags").hide();
$("#li_groups").show();
$("#li_module_groups").hide();
break;
}
}

View File

@ -652,10 +652,15 @@ var TreeController = {
typeof element.icon != "undefined" && typeof element.icon != "undefined" &&
element.icon.length > 0 element.icon.length > 0
) { ) {
console.log("a");
console.log(controller);
$content.append( $content.append(
'<div class="node-icon"><div class="node-icon-container"><img src="' + '<div class="node-icon"><div class="node-icon-container"><img src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") + (controller.baseURL.length > 0 ? controller.baseURL : "") +
"images/" + (treeController.meta != undefined &&
treeController.meta == 1
? "../../images/"
: "images/") +
element.icon + element.icon +
'" class="invert_filter"/></div></div>' '" class="invert_filter"/></div></div>'
); );
@ -679,7 +684,10 @@ var TreeController = {
var $deleteBtn = $( var $deleteBtn = $(
'<a style="float: right; margin-top: 5px;"><img src="' + '<a style="float: right; margin-top: 5px;"><img src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") + (controller.baseURL.length > 0 ? controller.baseURL : "") +
'images/delete.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/></a>' (controller.meta != undefined && controller.meta == 1
? "../../images/"
: "images/") +
'delete.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/></a>'
); );
$deleteBtn.click(function(event) { $deleteBtn.click(function(event) {
var ok_function = function() { var ok_function = function() {
@ -703,7 +711,10 @@ var TreeController = {
var $updateicon = $( var $updateicon = $(
'<img src="' + '<img src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") + (controller.baseURL.length > 0 ? controller.baseURL : "") +
'images/edit.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/>' (controller.meta != undefined && controller.meta == 1
? "../../images/"
: "images/") +
'edit.svg" class="main_menu_icon invert_filter" style="width:18px; padding: 0 5px;"/>'
); );
var $updatebtn = $( var $updatebtn = $(
'<a style="float: right; margin-top: 5px;" href = "' + '<a style="float: right; margin-top: 5px;" href = "' +

View File

@ -474,7 +474,7 @@ class Manager implements PublicLogin
"SELECT * "SELECT *
FROM tdashboard FROM tdashboard
WHERE id = %d WHERE id = %d
AND (id_group IN (%s) AND id_user = '') OR id_user = '%s'", AND ((id_group IN (%s) AND id_user = '') OR id_user = '%s')",
$this->dashboardId, $this->dashboardId,
$this->stringGroups, $this->stringGroups,
$config['id_user'] $config['id_user']
@ -1047,6 +1047,7 @@ class Manager implements PublicLogin
'hash' => self::generatePublicHash(), 'hash' => self::generatePublicHash(),
'publicLink' => $this->publicLink, 'publicLink' => $this->publicLink,
'dashboardGroup' => $this->dashboardFields['id_group'], 'dashboardGroup' => $this->dashboardFields['id_group'],
'dashboardUser' => $this->dashboardFields['id_user'],
] ]
); );
} else { } else {

View File

@ -426,6 +426,10 @@ class Widget
$className .= '\\'.$name; $className .= '\\'.$name;
break; break;
case 'heatmap':
$className .= '\HeatmapWidget';
break;
default: default:
$className = false; $className = false;
break; break;

View File

@ -269,7 +269,6 @@ class ModulesByStatus extends Widget
'selected' => $status_selected, 'selected' => $status_selected,
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
'class' => 'overflow-hidden',
'size' => count($status_fields), 'size' => count($status_fields),
'select_all' => false, 'select_all' => false,
'required' => true, 'required' => true,
@ -488,6 +487,18 @@ class ModulesByStatus extends Widget
$where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND '; $where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND ';
} }
if (str_contains($status, '6') === true) {
$expl = explode(',', $status);
$exist = array_search('6', $expl);
if (isset($exist) === true) {
unset($expl[$exist]);
}
array_push($expl, '1', '2');
$status = implode(',', $expl);
}
$where .= sprintf( $where .= sprintf(
'tagente_estado.estado IN (%s) 'tagente_estado.estado IN (%s)
AND tagente_modulo.delete_pending = 0', AND tagente_modulo.delete_pending = 0',

View File

@ -0,0 +1,478 @@
<?php
/**
* Widget Heatmap Pandora FMS Console
*
* @category Console Class
* @package Pandora FMS
* @subpackage Widget Heatmap
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 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;
global $config;
require_once $config['homedir'].'/include/class/Heatmap.class.php';
use PandoraFMS\Heatmap;
/**
* Heatmap Widgets.
*/
class HeatmapWidget 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.
// 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());
// Page.
$this->page = basename(__FILE__);
// ClassName.
$class = new \ReflectionClass($this);
$this->className = $class->getShortName();
// Title.
$this->title = __('Heatmap');
// Name.
if (empty($this->name) === true) {
$this->name = 'heatmap';
}
}
/**
* 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);
if (isset($decoder['search']) === true) {
$values['search'] = $decoder['search'];
}
if (isset($decoder['type']) === true) {
$values['type'] = $decoder['type'];
}
if (isset($decoder['groups']) === true) {
$values['groups'] = $decoder['groups'];
}
if (isset($decoder['tags']) === true) {
$values['tags'] = $decoder['tags'];
}
if (isset($decoder['module_groups']) === true) {
$values['module_groups'] = $decoder['module_groups'];
}
return $values;
}
/**
* Generates inputs for form (specific).
*
* @return array Of inputs.
*
* @throws Exception On error.
*/
public function getFormInputs(): array
{
global $config;
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
$values = $this->values;
// Search.
$inputs[] = [
'label' => \__('Search'),
'arguments' => [
'name' => 'search',
'type' => 'text',
'class' => 'event-widget-input',
'value' => $values['search'],
'return' => true,
'size' => 30,
],
];
$inputs[] = [
'label' => __('Type'),
'arguments' => [
'type' => 'select',
'fields' => [
0 => __('Group agents'),
1 => __('Group modules by tag'),
2 => __('Group modules by module group'),
3 => __('Group modules by agents'),
],
'name' => 'type',
'selected' => $values['type'],
'script' => 'type_change()',
'return' => true,
],
];
// Filters.
$inputs[] = [
'label' => __('Groups'),
'style' => ($values['type'] === '0') ? '' : 'display:none',
'id' => 'li_groups',
'arguments' => [
'type' => 'select_groups',
'name' => 'groups[]',
'returnAllGroup' => true,
'privilege' => 'AR',
'selected' => explode(',', $values['groups'][0]),
'return' => true,
'multiple' => true,
],
];
if (tags_has_user_acl_tags($config['id_user']) === false) {
$tags = db_get_all_rows_sql(
'SELECT id_tag, name FROM ttag WHERE id_tag ORDER BY name'
);
} else {
$user_tags = tags_get_user_tags($config['id_user'], 'AR');
if (empty($user_tags) === false) {
$id_user_tags = array_keys($user_tags);
$tags = db_get_all_rows_sql(
'SELECT id_tag, name FROM ttag
WHERE id_tag IN ('.implode(',', $id_user_tags).')
ORDER BY name'
);
} else {
$tags = db_get_all_rows_sql(
'SELECT id_tag, name FROM ttag WHERE id_tag ORDER BY name'
);
}
}
$inputs[] = [
'label' => __('Tag'),
'style' => ($values['type'] === '1') ? '' : 'display:none',
'id' => 'li_tags',
'arguments' => [
'type' => 'select',
'fields' => $tags,
'name' => 'tags[]',
'selected' => explode(',', $values['tags'][0]),
'return' => true,
'multiple' => true,
],
];
$module_groups_aux = db_get_all_rows_sql(
'SELECT id_mg, name FROM tmodule_group ORDER BY name'
);
$module_groups = [];
foreach ($module_groups_aux as $key => $module_group) {
$module_groups[$module_group['id_mg']] = $module_group['name'];
}
$inputs[] = [
'label' => __('Module group'),
'style' => ($values['type'] === '2') ? '' : 'display:none',
'id' => 'li_module_groups',
'arguments' => [
'type' => 'select',
'fields' => $module_groups,
'name' => 'module_groups[]',
'selected' => explode(',', $values['module_groups'][0]),
'return' => true,
'multiple' => true,
'nothing' => __('Not assigned'),
'nothing_value' => 0,
],
];
return $inputs;
}
/**
* Get Post for widget.
*
* @return array
*/
public function getPost(): array
{
// Retrieve global - common inputs.
$values = parent::getPost();
$values['search'] = \get_parameter('search', '');
$values['type'] = \get_parameter('type', 0);
switch ((int) $values['type']) {
case 2:
$values['module_groups'] = \get_parameter('module_groups', 0);
break;
case 1:
$values['tags'] = \get_parameter('tags', 0);
break;
case 0:
$values['groups'] = \get_parameter('groups', 0);
break;
default:
// Do nothing.
break;
}
return $values;
}
/**
* Get description.
*
* @return string.
*/
public static function getDescription()
{
return __('Heatmap');
}
/**
* Get Name.
*
* @return string.
*/
public static function getName()
{
return 'heatmap';
}
/**
* Get size Modal Configuration.
*
* @return array
*/
public function getSizeModalConfiguration(): array
{
$size = [
'width' => 500,
'height' => 300,
];
return $size;
}
/**
* Draw widget.
*
* @return string;
*/
public function load()
{
global $config;
\ui_require_css_file('heatmap', 'include/styles/', true);
$values = $this->values;
$search = (empty($values['search']) === false) ? $values['search'] : '';
$type = (empty($values['type']) === false) ? $values['type'] : 0;
$filter = [];
if (isset($values['groups'])) {
$filter = explode(',', $values['groups'][0]);
}
if (isset($values['tags'])) {
$filter = explode(',', $values['tags'][0]);
}
if (isset($values['module_groups'])) {
$filter = explode(',', $values['module_groups'][0]);
}
// Control call flow.
$heatmap = new Heatmap($type, $filter, null, 300, 400, 200, $search, 0, true);
// AJAX controller.
if (is_ajax() === true) {
$method = get_parameter('method');
if ($method === 'drawWidget') {
// Run.
$heatmap->run();
} else {
if (method_exists($heatmap, $method) === true) {
if ($heatmap->ajaxMethod($method) === true) {
$heatmap->{$method}();
} else {
echo 'Unavailable method';
}
} else {
echo 'Method not found';
}
// Stop any execution.
exit;
}
} else {
// Run.
$heatmap->run();
// Dialog.
echo '<div id="config_dialog" style="padding:15px" class="invisible"></div>';
}
return '';
}
}

View File

@ -226,7 +226,7 @@ final class DonutGraph extends Item
'module_input' => true, 'module_input' => true,
'module_name' => 'moduleId', 'module_name' => 'moduleId',
'module_none' => false, 'module_none' => false,
'get_only_string_modules' => true, 'get_only_string_modules' => false,
], ],
]; ];
@ -235,14 +235,13 @@ final class DonutGraph extends Item
'label' => __('Module'), 'label' => __('Module'),
'arguments' => [ 'arguments' => [
'type' => 'autocomplete_module', 'type' => 'autocomplete_module',
'fields' => $fields,
'name' => 'moduleId', 'name' => 'moduleId',
'selected' => $values['moduleId'], 'selected' => $values['moduleId'],
'return' => true, 'return' => true,
'sort' => false, 'sort' => false,
'agent_id' => $values['agentId'], 'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'], 'metaconsole_id' => $values['metaconsoleId'],
'get_only_string_modules' => true, 'get_only_string_modules' => false,
], ],
]; ];

View File

@ -68,7 +68,7 @@ div#login_f {
#ver_num { #ver_num {
width: 100%; width: 100%;
color: #dddddd; color: #fff;
text-align: center; text-align: center;
font-weight: 350; font-weight: 350;
font-size: 10px; font-size: 10px;

View File

@ -530,15 +530,6 @@ ul li {
width: 35px; width: 35px;
} }
/* Menu height: 601px, 720px, 735px */
@media screen and (max-height: 750px) {
.menu li,
.menu li a,
.menu li div {
min-height: 28px;
}
}
@media screen and (max-height: 750px) { @media screen and (max-height: 750px) {
.operation { .operation {
padding-top: 10px; padding-top: 10px;

View File

@ -130,8 +130,8 @@
</div> </div>
<div style='padding-bottom: 50px'> <div style='padding-bottom: 50px'>
<?php <?php
$version = '7.0NG.769'; $version = '7.0NG.770';
$build = '230313'; $build = '230327';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -230,10 +230,15 @@ if ((bool) check_acl($config['id_user'], $id_group, 'LW') === true || (bool) che
'title' => __('Standby'), 'title' => __('Standby'),
'text' => __('Standby'), 'text' => __('Standby'),
], ],
[
'title' => __('Operations'),
'text' => __('Operations'),
],
); );
$columns = array_merge( $columns = array_merge(
['standby'], ['standby'],
['force'],
$columns $columns
); );
@ -270,7 +275,11 @@ if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) che
$column_names, $column_names,
['text' => 'Module'], ['text' => 'Module'],
['text' => 'Template'], ['text' => 'Template'],
['text' => 'Operation'], [
'title' => __('Actions'),
'text' => __('Actions'),
'style' => 'min-width: 15%;',
],
['text' => 'Last fired'], ['text' => 'Last fired'],
['text' => 'Status'] ['text' => 'Status']
); );
@ -279,25 +288,12 @@ if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) che
$columns, $columns,
['agent_module_name'], ['agent_module_name'],
['template_name'], ['template_name'],
['operation'], ['actions'],
['last_fired'], ['last_fired'],
['status'] ['status']
); );
} }
if ($print_agent === true) {
array_push(
$column_names,
['text' => 'Agent']
);
$columns = array_merge(
$columns,
['agent_name']
);
}
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
if ((bool) check_acl($config['id_user'], $id_group, 'LW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true) { if ((bool) check_acl($config['id_user'], $id_group, 'LW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true) {
array_unshift( array_unshift(
@ -315,22 +311,6 @@ if (is_metaconsole() === false) {
$columns $columns
); );
} }
if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true) {
array_push(
$column_names,
[
'title' => __('Actions'),
'text' => __('Actions'),
'style' => 'min-width: 15%;',
]
);
$columns = array_merge(
$columns,
['actions']
);
}
} }
if (is_metaconsole() === true) { if (is_metaconsole() === true) {

View File

@ -375,10 +375,12 @@ $table->data[1][0] = html_print_label_input_block(
html_print_select($fields, 'os', $os, '', 'All', 0, true) html_print_select($fields, 'os', $os, '', 'All', 0, true)
); );
$pre_fields = policies_get_policies(false, ['id', 'name']); if (function_exists('policies_get_policies') === true) {
$fields = []; $pre_fields = policies_get_policies(false, ['id', 'name']);
foreach ($pre_fields as $value) { $fields = [];
$fields[$value['id']] = $value['name']; foreach ($pre_fields as $value) {
$fields[$value['id']] = $value['name'];
}
} }
$table->data[1][1] = html_print_label_input_block( $table->data[1][1] = html_print_label_input_block(

View File

@ -791,7 +791,7 @@ function print_table(
html_print_table($table); html_print_table($table);
if (count($selected_interfaces) > $config['block_size']) { if (count($selected_interfaces) > $config['block_size']) {
ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, 'pagination-bottom'); ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, '');
} }
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('No search parameters')]); ui_print_info_message(['no_close' => true, 'message' => __('No search parameters')]);

View File

@ -1481,12 +1481,13 @@ if ($policyTab === ENTERPRISE_NOT_HOOK) {
// Omnishell. // Omnishell.
$tasks = count_tasks_agent($id_agente); if (function_exists('count_tasks_agent')) {
$tasks = count_tasks_agent($id_agente);
if ($tasks === true) { if ($tasks === true) {
$omnishellTab = enterprise_hook('omnishell_tab'); $omnishellTab = enterprise_hook('omnishell_tab');
if ($omnishellTab == -1) { if ($omnishellTab == -1) {
$omnishellTab = ''; $omnishellTab = '';
}
} }
} }

View File

@ -21,23 +21,35 @@ global $config;
require_once 'include/functions_gis.php'; require_once 'include/functions_gis.php';
// ui_require_javascript_file('openlayers.pandora');
$buttons['gis_maps_list'] = [ $buttons['gis_maps_list'] = [
'active' => true, 'active' => true,
'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image( 'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image(
'images/list.png', 'images/logs@svg.svg',
true, true,
['title' => __('GIS Maps list')] [
'title' => __('GIS Maps list'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>', ).'</a>',
]; ];
ui_print_page_header( ui_print_standard_header(
__('GIS Maps'), __('GIS Maps'),
'images/op_gis.png', 'images/op_gis.png',
false, false,
'', '',
false, false,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('GIS Maps'),
],
]
); );
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);

View File

@ -116,33 +116,34 @@ $controls = [
$layers = gis_get_layers($idMap); $layers = gis_get_layers($idMap);
// Render map // Render map.
$has_management_acl = check_acl_restricted_all($config['id_user'], $map['group_id'], 'MW') $has_management_acl = check_acl_restricted_all($config['id_user'], $map['group_id'], 'MW')
|| check_acl_restricted_all($config['id_user'], $map['group_id'], 'MM'); || check_acl_restricted_all($config['id_user'], $map['group_id'], 'MM');
$buttons = []; $buttons = [];
$buttons['gis_maps_list'] = [ $buttons['gis_maps_list'] = [
'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image( 'active' => false,
'images/list.png', 'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image(
'images/logs@svg.svg',
true, true,
[ [
'title' => __('GIS Maps list'), 'title' => __('GIS Maps list'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
if ($config['pure'] == 0) { if ($config['pure'] == 0) {
$buttons[]['text'] = '<a href="index.php?sec=gismaps&amp;sec2=operation/gis_maps/render_view&amp;map_id='.$idMap.'&amp;refr='.((int) get_parameter('refr', 0)).'&amp;pure=1">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>'; $buttons[]['text'] = '<a href="index.php?sec=gismaps&amp;sec2=operation/gis_maps/render_view&amp;map_id='.$idMap.'&amp;refr='.((int) get_parameter('refr', 0)).'&amp;pure=1">'.html_print_image('images/fullscreen@svg.svg', true, ['title' => __('Full screen mode'), 'class' => 'main_menu_icon invert_filter']).'</a>';
} else { } else {
$buttons[]['text'] = '<a href="index.php?sec=gismaps&amp;sec2=operation/gis_maps/render_view&amp;map_id='.$idMap.'&amp;refr='.((int) get_parameter('refr', 0)).'">'.html_print_image('images/normalscreen.png', true, ['title' => __('Back to normal mode'), 'class' => 'invert_filter']).'</a>'; $buttons[]['text'] = '<a href="index.php?sec=gismaps&amp;sec2=operation/gis_maps/render_view&amp;map_id='.$idMap.'&amp;refr='.((int) get_parameter('refr', 0)).'">'.html_print_image('images/exit_fullscreen@svg.svg', true, ['title' => __('Back to normal mode'), 'class' => 'main_menu_icon invert_filter']).'</a>';
} }
if ($has_management_acl) { if ($has_management_acl === true) {
$hash = md5($config['dbpass'].$idMap.$config['id_user']); $hash = md5($config['dbpass'].$idMap.$config['id_user']);
$buttons['public_link']['text'] = '<a href="'.ui_get_full_url( $buttons['public_link']['text'] = '<a href="'.ui_get_full_url(
'operation/gis_maps/public_console.php?hash='.$hash.'&map_id='.$idMap.'&id_user='.$config['id_user'] 'operation/gis_maps/public_console.php?hash='.$hash.'&map_id='.$idMap.'&id_user='.$config['id_user']
).'" target="_blank">'.html_print_image('images/camera_mc.png', true, ['title' => __('Show link to public GIS map'), 'class' => 'invert_filter']).'</a>'; ).'" target="_blank">'.html_print_image('images/item-icon.svg', true, ['title' => __('Show link to public GIS map'), 'class' => 'main_menu_icon invert_filter']).'</a>';
} }
$times = [ $times = [
@ -170,17 +171,27 @@ $status = [
$buttons[]['text'] = "<div class='mrgn_top_6px'>".__('Filter by status').': '.html_print_select($status, 'show_status', 'all', 'changeShowStatus(this.value);', '', 0, true, false, false).'</div>'; $buttons[]['text'] = "<div class='mrgn_top_6px'>".__('Filter by status').': '.html_print_select($status, 'show_status', 'all', 'changeShowStatus(this.value);', '', 0, true, false, false).'</div>';
if ($has_management_acl) { if ($has_management_acl) {
$buttons['setup']['text'] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='.$idMap.'">'.html_print_image('images/setup.png', true, ['title' => __('Setup'), 'class' => 'invert_filter']).'</a>'; $buttons['setup']['text'] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='.$idMap.'">'.html_print_image('images/configuration@svg.svg', true, ['title' => __('Setup'), 'class' => 'main_menu_icon invert_filter']).'</a>';
$buttons['setup']['godmode'] = 1; $buttons['setup']['godmode'] = 1;
} }
ui_print_page_header( ui_print_standard_header(
__('Map').' &raquo; '.__('Map').'&nbsp;'.$map['map_name'], __('Map').' &raquo; '.__('Map').'&nbsp;'.$map['map_name'],
'images/op_gis.png', 'images/op_gis.png',
false, false,
'render_view_tab', '',
false, false,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('GIS Maps'),
],
]
); );
$map_inline_style = 'width: 100%; min-height:500px; height: calc(100vh - 80px);'; $map_inline_style = 'width: 100%; min-height:500px; height: calc(100vh - 80px);';

View File

@ -41,6 +41,7 @@ if ($agent_a === false && $agent_w === false) {
} }
require_once $config['homedir'].'/include/class/Heatmap.class.php'; require_once $config['homedir'].'/include/class/Heatmap.class.php';
use PandoraFMS\Heatmap;
$pure = (bool) get_parameter('pure', false); $pure = (bool) get_parameter('pure', false);
$type = get_parameter('type', 0); $type = get_parameter('type', 0);
@ -61,6 +62,8 @@ if ($group_sent === true) {
$group = (int) get_parameter('group', true); $group = (int) get_parameter('group', true);
} }
$dashboard = (bool) get_parameter('dashboard', false);
$is_ajax = is_ajax(); $is_ajax = is_ajax();
if ($is_ajax === false && $pure === false) { if ($is_ajax === false && $pure === false) {
$viewtab['config'] = '<a id="config" href="">'.html_print_image( $viewtab['config'] = '<a id="config" href="">'.html_print_image(
@ -191,6 +194,7 @@ if ($is_ajax === false && $pure === true) {
html_print_input_hidden('type', $type); html_print_input_hidden('type', $type);
html_print_input_hidden('search', $search); html_print_input_hidden('search', $search);
html_print_input_hidden('filter', implode(',', $filter)); html_print_input_hidden('filter', implode(',', $filter));
html_print_input_hidden('dashboard', $dashboard);
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
@ -229,7 +233,7 @@ if ($is_ajax === false && $pure === true) {
// Control call flow. // Control call flow.
try { try {
// Heatmap construct. // Heatmap construct.
$heatmap = new Heatmap($type, $filter, $randomId, $refresh, $width, $height, $search, $group); $heatmap = new Heatmap($type, $filter, $randomId, $refresh, $width, $height, $search, $group, $dashboard);
} catch (Exception $e) { } catch (Exception $e) {
if (is_ajax() === true) { if (is_ajax() === true) {
echo json_encode(['error' => '[Heatmap]'.$e->getMessage() ]); echo json_encode(['error' => '[Heatmap]'.$e->getMessage() ]);

View File

@ -643,7 +643,7 @@ if (empty($table->data) === true) {
true, true,
'offset', 'offset',
false, false,
'pagination-bottom' ''
); );
} }

View File

@ -205,7 +205,7 @@ if ($access_console_node === true) {
$sub['operation/inventory/inventory']['refr'] = 0; $sub['operation/inventory/inventory']['refr'] = 0;
} }
if ($config['activate_netflow']) { if ($config['activate_netflow'] || $config['activate_sflow']) {
$sub['network_traffic'] = [ $sub['network_traffic'] = [
'text' => __('Network'), 'text' => __('Network'),
'id' => 'Network', 'id' => 'Network',
@ -213,34 +213,20 @@ if ($access_console_node === true) {
'subtype' => 'nolink', 'subtype' => 'nolink',
'refr' => 0, 'refr' => 0,
]; ];
$netflow_sub = [
// Initialize the submenu. 'operation/netflow/netflow_explorer' => [
$netflow_sub = []; 'text' => __('Netflow explorer'),
'id' => 'Netflow explorer',
$netflow_sub = array_merge( ],
$netflow_sub, 'operation/netflow/nf_live_view' => [
[ 'text' => __('Netflow Live View'),
'operation/netflow/netflow_explorer' => [ 'id' => 'Netflow Live View',
'text' => __('Netflow explorer'), ],
'id' => 'Netflow explorer', 'operation/network/network_usage_map' => [
], 'text' => __('Network usage map'),
'operation/netflow/nf_live_view' => [ 'id' => 'Network usage map',
'text' => __('Netflow Live View'), ],
'id' => 'Netflow Live View', ];
],
]
);
$netflow_sub = array_merge(
$netflow_sub,
[
'operation/network/network_usage_map' => [
'text' => __('Network usage map'),
'id' => 'Network usage map',
],
]
);
$sub['network_traffic']['sub2'] = $netflow_sub; $sub['network_traffic']['sub2'] = $netflow_sub;
} }
@ -411,7 +397,7 @@ if ($access_console_node === true) {
// INI GIS Maps. // INI GIS Maps.
if ($config['activate_gis']) { if ($config['activate_gis']) {
$sub['gismaps']['text'] = __('GIS Maps'); $sub['gismaps']['text'] = __('GIS Maps');
$sub['gismaps']['id'] = 'GIS Maps'; $sub['gismaps']['id'] = 'GIS_Maps';
$sub['gismaps']['type'] = 'direct'; $sub['gismaps']['type'] = 'direct';
$sub['gismaps']['subtype'] = 'nolink'; $sub['gismaps']['subtype'] = 'nolink';
$sub2 = []; $sub2 = [];
@ -632,7 +618,7 @@ if ($favorite_menu !== false) {
$sub[$section]['text'] = __(str_replace('_', ' ', $section)); $sub[$section]['text'] = __(str_replace('_', ' ', $section));
$sub[$section]['type'] = 'direct'; $sub[$section]['type'] = 'direct';
$sub[$section]['subtype'] = 'nolink'; $sub[$section]['subtype'] = 'nolink';
$sub[$section]['id'] = $row['section']; $sub[$section]['id'] = $row['section'].'-fav-menu';
$sub2[$row['url']]['text'] = io_safe_output($row['label']); $sub2[$row['url']]['text'] = io_safe_output($row['label']);
$sub[$section]['sub2'] = $sub2; $sub[$section]['sub2'] = $sub2;

View File

@ -62,7 +62,13 @@ require_once 'include/functions_visual_map.php';
$hash = (string) get_parameter('hash'); $hash = (string) get_parameter('hash');
$visualConsoleId = (int) get_parameter('id_layout'); $visualConsoleId = (int) get_parameter('id_layout');
$config['id_user'] = (string) get_parameter('id_user'); $userAccessMaintenance = null;
if (empty($config['id_user']) === true) {
$config['id_user'] = (string) get_parameter('id_user');
} else {
$userAccessMaintenance = $config['id_user'];
}
$refr = (int) get_parameter('refr', ($config['refr'] ?? null)); $refr = (int) get_parameter('refr', ($config['refr'] ?? null));
if (!isset($config['pure'])) { if (!isset($config['pure'])) {
@ -179,6 +185,7 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
<script type="text/javascript"> <script type="text/javascript">
var container = document.getElementById("visual-console-container"); var container = document.getElementById("visual-console-container");
var user = "<?php echo $userAccessMaintenance; ?>";
var props = <?php echo (string) $visualConsole; ?>; var props = <?php echo (string) $visualConsole; ?>;
var items = <?php echo '['.implode(',', $visualConsoleItems).']'; ?>; var items = <?php echo '['.implode(',', $visualConsoleItems).']'; ?>;
var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>"; var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>";
@ -282,7 +289,9 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
); );
if(props.maintenanceMode != null) { if(props.maintenanceMode != null) {
visualConsoleManager.visualConsole.enableMaintenanceMode(); if(props.maintenanceMode.user !== user) {
visualConsoleManager.visualConsole.enableMaintenanceMode();
}
} }
var controls = document.getElementById('vc-controls'); var controls = document.getElementById('vc-controls');

View File

@ -118,8 +118,12 @@ if ($aclRead === false && $aclWrite === false && $aclManage === false) {
// Render map. // Render map.
$options = []; $options = [];
$baseUrlList = 'index.php?sec=network&sec2=godmode/reporting/map_builder';
if (is_metaconsole() === true) {
$baseUrlList = 'index.php?sec=screen&sec2=screens/screens&action=visualmap';
}
$options['consoles_list']['text'] = '<a href="index.php?sec=network&sec2=godmode/reporting/map_builder">'.html_print_image( $options['consoles_list']['text'] = '<a href="'.$baseUrlList.'">'.html_print_image(
'images/logs@svg.svg', 'images/logs@svg.svg',
true, true,
[ [
@ -142,11 +146,17 @@ if ($aclWrite === true || $aclManage === true) {
); );
$baseUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action='.$action; $baseUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action='.$action;
if (is_metaconsole() === true) {
$baseUrl = 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&action2='.$action;
}
$hash = md5($config['dbpass'].$visualConsoleId.$config['id_user']); $hash = md5($config['dbpass'].$visualConsoleId.$config['id_user']);
$options['public_link']['text'] = '<a href="'.ui_get_full_url( $options['public_link']['text'] = '<a href="'.ui_get_full_url(
'operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$visualConsoleId.'&refr='.$refr.'&id_user='.$config['id_user'] 'operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$visualConsoleId.'&refr='.$refr.'&id_user='.$config['id_user'],
false,
false,
false
).'" target="_blank">'.html_print_image( ).'" target="_blank">'.html_print_image(
'images/item-icon.svg', 'images/item-icon.svg',
true, true,

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.769 %define version 7.0NG.770
%define release 230323 %define release 1
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.769 %define version 7.0NG.770
%define release 230323 %define release 1
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.769 %define version 7.0NG.770
%define release 230323 %define release 1
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.769" PI_VERSION="7.0NG.770"
FORCE=0 FORCE=0
DESTDIR="" DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"` LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -72,6 +72,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('stats_interval', '60'), ('stats_interval', '60'),
('activate_gis', '0'), ('activate_gis', '0'),
('activate_netflow', '0'), ('activate_netflow', '0'),
('activate_sflow', '0'),
('timezone', 'Europe/Berlin'), ('timezone', 'Europe/Berlin'),
('string_purge', 7), ('string_purge', 7),
('audit_purge', 15), ('audit_purge', 15),
@ -87,6 +88,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('netflow_daemon', '/usr/bin/nfcapd'), ('netflow_daemon', '/usr/bin/nfcapd'),
('netflow_nfdump', '/usr/bin/nfdump'), ('netflow_nfdump', '/usr/bin/nfdump'),
('netflow_max_resolution', '50'), ('netflow_max_resolution', '50'),
('sflow_interval', '3600'),
('sflow_daemon', '/usr/bin/sfcapd'),
('sflow_nfdump', '/usr/bin/nfdump'),
('sflow_max_resolution', '50'),
('event_fields', 'mini_severity,evento,estado,agent_name,timestamp'), ('event_fields', 'mini_severity,evento,estado,agent_name,timestamp'),
('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,last_status_change,graph,warn,data,timestamp'), ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,last_status_change,graph,warn,data,timestamp'),
('list_ACL_IPs_for_API', '127.0.0.1'), ('list_ACL_IPs_for_API', '127.0.0.1'),

View File

@ -260,7 +260,7 @@ if (isset($config['public_dashboard']) === true
} }
} }
} else { } else {
if (check_acl_restricted_all($config['id_user'], $dashboardGroup, 'RW') === 0) { if ($dashboardUser !== $config['id_user'] && check_acl_restricted_all($config['id_user'], $dashboardGroup, 'RW') === 0) {
$buttons = [ $buttons = [
'back_to_dashboard_list' => $back_to_dashboard_list, 'back_to_dashboard_list' => $back_to_dashboard_list,
'fullscreen' => $fullscreen, 'fullscreen' => $fullscreen,

View File

@ -212,7 +212,7 @@ if (empty($dashboards) === true) {
true, true,
'offset', 'offset',
false, false,
'pagination-bottom' ''
); );
} }

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.769-230323 Version: 7.0NG.770
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# 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. # GNU General Public License for more details.
pandora_version="7.0NG.769-230323" pandora_version="7.0NG.770"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

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