Fix merge

This commit is contained in:
Jose Gonzalez 2021-11-23 12:25:58 +01:00
commit 98f519958c
221 changed files with 326935 additions and 713348 deletions

183199
index.pot

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.757, AIX version # Version 7.0NG.758, 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.757, FreeBSD Version # Version 7.0NG.758, 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.757, HP-UX Version # Version 7.0NG.758, 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.757, GNU/Linux # Version 7.0NG.758, 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.757, GNU/Linux # Version 7.0NG.758, 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.757, Solaris Version # Version 7.0NG.758, 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.757 # Version 7.0NG.758
# 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.757, AIX version # Version 7.0NG.758, 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.757 # Version 7.0NG.758
# 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.757, HPUX Version # Version 7.0NG.758, 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.757 # Version 7.0NG.758
# 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.757 # Version 7.0NG.758
# 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.757 # Version 7.0NG.758
# 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.757, Solaris version # Version 7.0NG.758, 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.757, AIX version # Version 7.0NG.758, 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.757-211008 Version: 7.0NG.758-211122
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.757-211008" pandora_version="7.0NG.758-211122"
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.757" VERSION="7.0NG.758"
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.757" onConclusion="none">pandorafms_src.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.758" 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.757" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.758" 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.757</string> <key>CFBundleVersion</key> <string>7.0NG.758</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.757 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string> <key>CFBundleGetInfoString</key> <string>7.0NG.758 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.757</string> <key>CFBundleShortVersionString</key> <string>7.0NG.758</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.757, GNU/Linux # Version 7.0NG.758, 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.757, FreeBSD Version # Version 7.0NG.758, 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.757, HP-UX Version # Version 7.0NG.758, 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.757, GNU/Linux # Version 7.0NG.758, 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.757, GNU/Linux # Version 7.0NG.758, 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.757, NetBSD Version # Version 7.0NG.758, 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.757, Solaris Version # Version 7.0NG.758, 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

@ -1014,8 +1014,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.757'; use constant AGENT_VERSION => '7.0NG.758';
use constant AGENT_BUILD => '211008'; use constant AGENT_BUILD => '211122';
# 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

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.757 %define version 7.0NG.758
%define release 211008 %define release 211122
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.757 %define version 7.0NG.758
%define release 211008 %define release 211122
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.757" PI_VERSION="7.0NG.758"
PI_BUILD="211008" PI_BUILD="211122"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -21,7 +21,6 @@
use strict; use strict;
use constant TSTAMP_FILE => '/tmp/pandora_inventory.tstamp'; use constant TSTAMP_FILE => '/tmp/pandora_inventory.tstamp';
use Scalar::Util qw(looks_like_number); use Scalar::Util qw(looks_like_number);
use Data::Dumper;
# Set environment language to English # Set environment language to English
$ENV{"LANG"} = "en_US"; $ENV{"LANG"} = "en_US";

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.757 # Version 7.0NG.758
# 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.757} {Pandora FMS Windows Agent v7.0NG.758}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{211008} {211122}
ViewReadme ViewReadme
{Yes} {Yes}

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.757 Build 211008") #define PANDORA_VERSION ("7.0NG.758 Build 211122")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -2047,8 +2047,6 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
this->pandora_init (); this->pandora_init ();
} }
this->checkCollections (); this->checkCollections ();
}
/* Execute omnishell commands */ /* Execute omnishell commands */
omnishell_path = '"'+Pandora::getPandoraInstallDir (); omnishell_path = '"'+Pandora::getPandoraInstallDir ();
@ -2057,6 +2055,7 @@ Pandora_Windows_Service::pandora_run (int forced_run) {
pandoraLog ("Omnishell: Running"); pandoraLog ("Omnishell: Running");
} }
omnishell_output = getValueFromCmdExec(omnishell_path.c_str(), 6000000); omnishell_output = getValueFromCmdExec(omnishell_path.c_str(), 6000000);
}
server_addr = conf->getValue ("server_ip"); server_addr = conf->getValue ("server_ip");

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.757(Build 211008))" VALUE "ProductVersion", "(7.0NG.758(Build 211122))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,6 +1,9 @@
# pandora disable listing # pandora disable listing
Options -Indexes Options -Indexes
# Avoid clickjacking
Header always append X-Frame-Options SAMEORIGIN
<Files ~ "\.log$"> <Files ~ "\.log$">
Order Allow,Deny Order Allow,Deny
Deny from All Deny from All

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.757-211008 Version: 7.0NG.758-211122
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.757-211008" pandora_version="7.0NG.758-211122"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -351,7 +351,7 @@ function mainModuleGroups()
} }
$data[$i][$j] = "<div style='".$cell_style.'background:'.$color.";'>"; $data[$i][$j] = "<div style='".$cell_style.'background:'.$color.";'>";
$data[$i][$j] .= '<a class="info_cell white font_18px" rel="'.$rel.'" href="'.$url.'">'; $data[$i][$j] .= "<a class='info_cell white font_18px' rel='".$rel."' href='".$url."'>";
$data[$i][$j] .= $array_data[$key][$k]['total_count']; $data[$i][$j] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '</a></div>'; $data[$i][$j] .= '</a></div>';
} else { } else {

View File

@ -206,7 +206,7 @@ function users_extension_main_god($god=true)
} }
extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', '', 'UM'); extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', null, 'UM');
extensions_add_godmode_function('users_extension_main_god'); extensions_add_godmode_function('users_extension_main_god');
extensions_add_main_function('users_extension_main'); extensions_add_main_function('users_extension_main');

View File

@ -112,3 +112,6 @@ enterprise/include/ajax/map_enterprise.ajax.php
enterprise/include/javascript/SimpleMapController.js enterprise/include/javascript/SimpleMapController.js
enterprise/include/javascript/tooltipster.bundle.min.js enterprise/include/javascript/tooltipster.bundle.min.js
enterprise/include/styles/tooltipster.bundle.min.css enterprise/include/styles/tooltipster.bundle.min.css
mobile/include/javascript/jquery.mobile-1.3.1.js
mobile/include/style/jquery.mobile-1.3.1.css
godmode/alerts/configure_alert_special_days.php

View File

@ -27,14 +27,15 @@ CREATE TABLE IF NOT EXISTS `tsync_queue` (
UPDATE `tlink` SET `link` = 'https://pandorafms.com/manual/' WHERE `id_link` = 0000000001; UPDATE `tlink` SET `link` = 'https://pandorafms.com/manual/' WHERE `id_link` = 0000000001;
UPDATE `tuser_task`
SET parameters='a:7:{i:0;a:7:{s:11:"description";s:30:"Template pending to be created";s:5:"table";s:16:"treport_template";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:8:"required";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:7:{s:11:"description";s:6:"Agents";s:5:"table";s:7:"tagente";s:8:"field_id";s:9:"id_agente";s:10:"field_name";s:6:"nombre";s:8:"multiple";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_grupo";}i:2;a:2:{s:11:"description";s:16:"Report per agent";s:10:"select_two";b:1;}i:3;a:2:{s:11:"description";s:11:"Report name";s:4:"type";s:6:"string";}i:4;a:2:{s:11:"description";s:47:"Send to e-mail addresses (separated by a comma)";s:4:"type";s:4:"text";}i:5;a:2:{s:11:"description";s:7:"Subject";s:8:"optional";i:1;}i:6;a:3:{s:11:"description";s:7:"Message";s:4:"type";s:4:"text";s:8:"optional";i:1;}}i:7;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}'
WHERE id=2;
UPDATE `tuser_task_scheduled` SET UPDATE `tuser_task_scheduled` SET
`args` = REPLACE (`args`, 'a:8', 'a:9'), `args`= REPLACE(`args`, 's:15:"first_execution"', 'i:8;s:3:"PDF";s:15:"first_execution"'),
`args`= REPLACE(`args`, 's:15:"first_execution"', 'i:2;s:0:"";i:7;s:3:"PDF";s:15:"first_execution"') `args` = REPLACE (`args`, 'a:8', 'a:10'),
WHERE `id_user_task` = 2; `args` = REPLACE (`args`, 'i:6', 'i:7'),
`args` = REPLACE (`args`, 'i:5', 'i:6'),
`args` = REPLACE (`args`, 'i:4', 'i:5'),
`args` = REPLACE (`args`, 'i:3', 'i:4'),
`args` = REPLACE (`args`, 'i:2', 'i:2;s:0:"";i:3')
WHERE `id_user_task` IN (SELECT id from tuser_task WHERE function_name = 'cron_task_generate_report_by_template');
UPDATE `tconfig` SET `value` = 0 WHERE `token` = 'centralized_management'; UPDATE `tconfig` SET `value` = 0 WHERE `token` = 'centralized_management';

View File

@ -14,9 +14,117 @@ ALTER TABLE `treport_content_template` ADD COLUMN `time_in_warning_status` TINYI
ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0'; ALTER TABLE `treport_content_template` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0'; ALTER TABLE `treport_content` ADD COLUMN `time_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0'; ALTER TABLE `treport_content` ADD COLUMN `checks_in_warning_status` TINYINT(1) DEFAULT '0';
ALTER TABLE `tlayout_template` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0;
INSERT INTO `treport_content` (id_report, id_gs, id_agent_module, type, period, `order`, name, description, id_agent, `text`, external_source, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, style, server_name, time_in_warning_status, checks_in_warning_status, failover_mode) SELECT id_report, 0, id_agent_module, 'availability', period, `order`, name, description, id_agent, NULL, NULL, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, '{&quot;show_in_same_row&quot;:0,&quot;hide_notinit_agents&quot;:0,&quot;priority_mode&quot;:1,&quot;dyn_height&quot;:&quot;230&quot;}', server_name, 1, 1, 0 FROM treport_content WHERE type = 'histogram_data'; INSERT INTO `treport_content` (id_report, id_gs, id_agent_module, type, period, `order`, name, description, id_agent, `text`, external_source, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, style, server_name, time_in_warning_status, checks_in_warning_status, failover_mode) SELECT id_report, 0, id_agent_module, 'availability', period, `order`, name, description, id_agent, NULL, NULL, treport_custom_sql_id, header_definition, column_separator, line_separator, time_from, time_to, '{&quot;show_in_same_row&quot;:0,&quot;hide_notinit_agents&quot;:0,&quot;priority_mode&quot;:1,&quot;dyn_height&quot;:&quot;230&quot;}', server_name, 1, 1, 0 FROM treport_content WHERE type = 'histogram_data';
INSERT INTO `treport_content_item` (id_report_content, id_agent_module, id_agent_module_failover, operation, server_name) SELECT id_rc, id_agent_module, 0, '', server_name FROM treport_content WHERE type = 'availability' AND id_agent <> 0 AND id_agent_module <> 0; INSERT INTO `treport_content_item` (id_report_content, id_agent_module, id_agent_module_failover, operation, server_name) SELECT id_rc, id_agent_module, 0, '', server_name FROM treport_content WHERE type = 'availability' AND id_agent <> 0 AND id_agent_module <> 0;
DELETE FROM `treport_content` WHERE type = 'histogram_data'; DELETE FROM `treport_content` WHERE type = 'histogram_data';
ALTER TABLE `tperfil` ADD COLUMN `network_config_view`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_edit`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_management`tinyint(1) NOT NULL DEFAULT 0;
CREATE TABLE IF NOT EXISTS `tncm_vendor` (
`id` serial,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_model` (
`id` serial,
`id_vendor` bigint(20) unsigned NOT NULL,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_template` (
`id` serial,
`name` text,
`vendors` text,
`models` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_script` (
`id` serial,
`type` int unsigned not null default 0,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_template_scripts` (
`id` serial,
`id_template` bigint(20) unsigned NOT NULL,
`id_script` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_agent` int(10) unsigned NOT NULL,
`id_vendor` bigint(20) unsigned,
`id_model` bigint(20) unsigned,
`protocol` int unsigned not null default 0,
`cred_key` varchar(100),
`adv_key` varchar(100),
`port` int(4) unsigned default 22,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
`id_template` bigint(20) unsigned,
`execute_type` int(2) UNSIGNED NOT NULL default 0,
`execute` int(2) UNSIGNED NOT NULL default 0,
`last_error` text,
PRIMARY KEY (`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_model`) REFERENCES `tncm_model`(`id`) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
`id` serial,
`id_agent` int(10) unsigned NOT NULL,
`script_type` int unsigned not null,
`data` LONGBLOB,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO `tncm_vendor` VALUES
(1,'Cisco'),
(2, 'D-Link Systems, Inc.'),
(3, 'MikroTik'),
(4, 'Alcatel-Lucent Enterprise'),
(5, 'Ubiquiti Networks, Inc.'),
(6, 'Allied Telesis, Inc.'),
(7, 'Frogfoot Networks'),
(8, 'IBM'),
(9, 'Dell Inc.'),
(10, 'Hitachi Communication Technologies, Ltd.'),
(11, 'Netlink'),
(12, 'Ascom'),
(13, 'Synology Inc.'),
(14, 'Fujitsu Network Communications, Inc.');
INSERT IGNORE INTO `tncm_model` VALUES (1,1,'7200');
INSERT IGNORE INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]');
INSERT IGNORE INTO `tncm_script` VALUES
(1,0,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;exit'),
(2,1,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;running-config&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(3,2,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;terminal&#x0d;&#x0a;_applyconfigbackup_&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(4,3,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;version&#x20;|&#x20;i&#x20;IOS&#x20;Software&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(5,5,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;term&#x0d;&#x0a;end&#x0d;&#x0a;end&#x0d;&#x0a;exit&#x0d;&#x0a;');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);
ALTER TABLE `tevent_alert` ADD COLUMN `last_evaluation` bigint(20) NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `pool_occurrences` int unsigned not null default 0;
COMMIT; COMMIT;

View File

@ -0,0 +1,30 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `talert_calendar` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL default '',
`id_group` INT(10) NOT NULL DEFAULT 0,
`description` text,
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar');
ALTER TABLE `talert_special_days` ADD COLUMN `id_calendar` int(10) unsigned NOT NULL DEFAULT 1;
ALTER TABLE `talert_special_days` ADD COLUMN `day_code` tinyint(2) unsigned NOT NULL DEFAULT 0;
UPDATE `talert_special_days` set `day_code` = 1 WHERE `same_day` = 'monday';
UPDATE `talert_special_days` set `day_code` = 2 WHERE `same_day` = 'tuesday';
UPDATE `talert_special_days` set `day_code` = 3 WHERE `same_day` = 'wednesday';
UPDATE `talert_special_days` set `day_code` = 4 WHERE `same_day` = 'thursday';
UPDATE `talert_special_days` set `day_code` = 5 WHERE `same_day` = 'friday';
UPDATE `talert_special_days` set `day_code` = 6 WHERE `same_day` = 'saturday';
UPDATE `talert_special_days` set `day_code` = 7 WHERE `same_day` = 'sunday';
ALTER TABLE `talert_special_days` DROP COLUMN `same_day`;
ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tagent_repository` ADD COLUMN `deployment_timeout` INT UNSIGNED DEFAULT 600 AFTER `path`;
COMMIT;

View File

@ -712,6 +712,8 @@ ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL defau
ALTER TABLE `tevent_alert` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; ALTER TABLE `tevent_alert` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0;
ALTER TABLE `tevent_alert` ADD COLUMN `id_template_conditions` int(10) unsigned NOT NULL default 0; ALTER TABLE `tevent_alert` ADD COLUMN `id_template_conditions` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `id_template_fields` int(10) unsigned NOT NULL default 0; ALTER TABLE `tevent_alert` ADD COLUMN `id_template_fields` int(10) unsigned NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `last_evaluation` bigint(20) NOT NULL default 0;
ALTER TABLE `tevent_alert` ADD COLUMN `pool_occurrences` int unsigned not null default 0;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `tevent_alert_action` -- Table `tevent_alert_action`
@ -1448,13 +1450,13 @@ ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default '';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 49); INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 50);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 757); INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 758);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
@ -1522,6 +1524,8 @@ ALTER TABLE tevent_filter ADD COLUMN `id_source_event` int(10);
ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL; ALTER TABLE `tevent_filter` MODIFY COLUMN `user_comment` text NOT NULL;
ALTER TABLE `tevent_filter` MODIFY COLUMN `severity` text NOT NULL; ALTER TABLE `tevent_filter` MODIFY COLUMN `severity` text NOT NULL;
ALTER TABLE tevent_filter ADD COLUMN `server_id` int(10) NOT NULL default 0; ALTER TABLE tevent_filter ADD COLUMN `server_id` int(10) NOT NULL default 0;
ALTER TABLE `tevent_filter` ADD COLUMN `time_from` TIME NULL;
ALTER TABLE `tevent_filter` ADD COLUMN `time_to` TIME NULL;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tusuario` -- Table `tusuario`
@ -2229,6 +2233,7 @@ CREATE TABLE IF NOT EXISTS `tlayout_template` (
) ENGINE = InnoDB DEFAULT CHARSET=utf8; ) ENGINE = InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL; ALTER TABLE tlayout_template MODIFY `name` varchar(600) NOT NULL;
ALTER TABLE `tlayout` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tlayout_template_data` -- Table `tlayout_template_data`
@ -2678,6 +2683,7 @@ CREATE TABLE `tagent_repository` (
`arch` ENUM('x64', 'x86') DEFAULT 'x64', `arch` ENUM('x64', 'x86') DEFAULT 'x64',
`version` VARCHAR(10) DEFAULT '', `version` VARCHAR(10) DEFAULT '',
`path` text, `path` text,
`deployment_timeout` INT UNSIGNED DEFAULT 600,
`uploaded_by` VARCHAR(100) DEFAULT '', `uploaded_by` VARCHAR(100) DEFAULT '',
`uploaded` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was uploaded", `uploaded` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was uploaded",
`last_err` text, `last_err` text,
@ -4078,6 +4084,10 @@ ALTER TABLE `tperfil` DROP COLUMN `incident_view`;
ALTER TABLE `tperfil` DROP COLUMN `incident_edit`; ALTER TABLE `tperfil` DROP COLUMN `incident_edit`;
ALTER TABLE `tperfil` DROP COLUMN `incident_management`; ALTER TABLE `tperfil` DROP COLUMN `incident_management`;
ALTER TABLE `tperfil` ADD COLUMN `network_config_view`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_edit`tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE `tperfil` ADD COLUMN `network_config_management`tinyint(1) NOT NULL DEFAULT 0;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `talert_execution_queue` -- Table `talert_execution_queue`
-- ----------------------------------------------------- -- -----------------------------------------------------
@ -4092,3 +4102,153 @@ CREATE TABLE IF NOT EXISTS `talert_execution_queue` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de'; UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';
-- ----------------------------------------------------------------------
-- Table `tncm_vendor`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_vendor` (
`id` serial,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_model`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_model` (
`id` serial,
`id_vendor` bigint(20) unsigned NOT NULL,
`name` varchar(255) UNIQUE,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_template`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_template` (
`id` serial,
`name` text,
`vendors` text,
`models` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_script`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_script` (
`id` serial,
`type` int unsigned not null default 0,
`content` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_template_scripts`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_template_scripts` (
`id` serial,
`id_template` bigint(20) unsigned NOT NULL,
`id_script` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_agent`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_agent` int(10) unsigned NOT NULL,
`id_vendor` bigint(20) unsigned,
`id_model` bigint(20) unsigned,
`protocol` int unsigned not null default 0,
`cred_key` varchar(100),
`adv_key` varchar(100),
`port` int(4) unsigned default 22,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
`config_backup_id` bigint(20) UNSIGNED DEFAULT NULL,
`id_template` bigint(20) unsigned,
`execute_type` int(2) UNSIGNED NOT NULL default 0,
`execute` int(2) UNSIGNED NOT NULL default 0,
`last_error` text,
PRIMARY KEY (`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`cred_key`) REFERENCES `tcredential_store`(`identifier`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_template`) REFERENCES `tncm_template`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_vendor`) REFERENCES `tncm_vendor`(`id`) ON UPDATE CASCADE ON DELETE SET NULL,
FOREIGN KEY (`id_model`) REFERENCES `tncm_model`(`id`) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
-- Table `tncm_agent_data`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
`id` serial,
`id_agent` int(10) unsigned NOT NULL,
`script_type` int unsigned not null,
`data` LONGBLOB,
`status` int(4) NOT NULL default 5,
`updated_at` bigint(20) NOT NULL default 0,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `tncm_vendor` VALUES
(1,'Cisco'),
(2, 'D-Link Systems, Inc.'),
(3, 'MikroTik'),
(4, 'Alcatel-Lucent Enterprise'),
(5, 'Ubiquiti Networks, Inc.'),
(6, 'Allied Telesis, Inc.'),
(7, 'Frogfoot Networks'),
(8, 'IBM'),
(9, 'Dell Inc.'),
(10, 'Hitachi Communication Technologies, Ltd.'),
(11, 'Netlink'),
(12, 'Ascom'),
(13, 'Synology Inc.'),
(14, 'Fujitsu Network Communications, Inc.');
INSERT INTO `tncm_model` VALUES (1,1,'7200');
INSERT INTO `tncm_template` VALUES (1,'cisco-base','[\"1\"]','[\"1\"]');
INSERT INTO `tncm_script` VALUES
(1,0,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;exit'),
(2,1,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;running-config&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(3,2,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;terminal&#x0d;&#x0a;_applyconfigbackup_&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(4,3,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;capture:show&#x20;version&#x20;|&#x20;i&#x20;IOS&#x20;Software&#x0d;&#x0a;exit&#x0d;&#x0a;'),
(5,5,'enable&#x0d;&#x0a;expect:Password:&#92;s*&#x0d;&#x0a;_enablepass_&#x0d;&#x0a;term&#x20;length&#x20;0&#x0d;&#x0a;config&#x20;term&#x0d;&#x0a;end&#x0d;&#x0a;end&#x0d;&#x0a;exit&#x0d;&#x0a;');
INSERT INTO `tncm_template_scripts`(`id_template`, `id_script`) VALUES (1,1),(1,2),(1,3),(1,4),(1,5);
-- ----------------------------------------------------------------------
-- Table `talert_calendar`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `talert_calendar` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL default '',
`id_group` INT(10) NOT NULL DEFAULT 0,
`description` text,
PRIMARY KEY (`id`),
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO `talert_calendar` VALUES (1, 'Default', 0, 'Default calendar');
ALTER TABLE `talert_special_days` ADD COLUMN `id_calendar` int(10) unsigned NOT NULL DEFAULT 1;
ALTER TABLE `talert_special_days` ADD COLUMN `day_code` tinyint(2) unsigned NOT NULL DEFAULT 0;
UPDATE `talert_special_days` set `day_code` = 1 WHERE `same_day` = 'monday';
UPDATE `talert_special_days` set `day_code` = 2 WHERE `same_day` = 'tuesday';
UPDATE `talert_special_days` set `day_code` = 3 WHERE `same_day` = 'wednesday';
UPDATE `talert_special_days` set `day_code` = 4 WHERE `same_day` = 'thursday';
UPDATE `talert_special_days` set `day_code` = 5 WHERE `same_day` = 'friday';
UPDATE `talert_special_days` set `day_code` = 6 WHERE `same_day` = 'saturday';
UPDATE `talert_special_days` set `day_code` = 7 WHERE `same_day` = 'sunday';
ALTER TABLE `talert_special_days` DROP COLUMN `same_day`;
ALTER TABLE `talert_special_days` ADD FOREIGN KEY (`id_calendar`) REFERENCES `talert_calendar`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -46,11 +46,11 @@ ui_require_css_file('first_task');
ui_print_info_message(['no_close' => true, 'message' => __('There are no clusters defined yet.') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no clusters defined yet.') ]);
?> ?>
<div class="new_task_cluster"> <div class="new_task">
<div class="image_task_cluster"> <div class="image_task">
<?php echo html_print_image('images/first_task/icono-cluster-activo.png', true, ['title' => __('Clusters')]); ?> <?php echo html_print_image('images/first_task/icono-cluster-activo.png', true, ['title' => __('Clusters')]); ?>
</div> </div>
<div class="text_task_cluster"> <div class="text_task">
<h3> <?php echo __('Create Cluster'); ?></h3> <h3> <?php echo __('Create Cluster'); ?></h3>
<p id="description_task"> <p id="description_task">
<?php <?php

View File

@ -64,6 +64,8 @@ $data['monitor_critical'] = (int) $all_data['_monitors_critical_'];
$data['monitor_not_normal'] = (int) $all_data['_monitor_not_normal_']; $data['monitor_not_normal'] = (int) $all_data['_monitor_not_normal_'];
$data['monitor_alerts'] = (int) $all_data['_monitors_alerts_']; $data['monitor_alerts'] = (int) $all_data['_monitors_alerts_'];
$data['monitor_alerts_fired'] = (int) $all_data['_monitors_alerts_fired_']; $data['monitor_alerts_fired'] = (int) $all_data['_monitors_alerts_fired_'];
$data['monitor_total'] = (int) $all_data['_monitor_total_'];
$data['total_agents'] = (int) $all_data['_total_agents_']; $data['total_agents'] = (int) $all_data['_total_agents_'];

View File

@ -341,6 +341,7 @@ if (isset($groups[$grupo]) || $new_agent) {
'selected' => $grupo, 'selected' => $grupo,
'return' => true, 'return' => true,
'required' => true, 'required' => true,
'privilege' => 'AW',
] ]
); );
} else { } else {

View File

@ -196,6 +196,13 @@ if ($create_agent) {
$nombre_agente = hash('sha256', $alias.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000))); $nombre_agente = hash('sha256', $alias.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
$grupo = (int) get_parameter_post('grupo'); $grupo = (int) get_parameter_post('grupo');
if ((bool) check_acl($config['id_user'], $grupo, 'AW') === false) {
db_pandora_audit('ACL Violation', 'Trying to access agent manager');
include $config['homedir'].'/general/noaccess.php';
return;
}
$intervalo = (string) get_parameter_post('intervalo', SECONDS_5MINUTES); $intervalo = (string) get_parameter_post('intervalo', SECONDS_5MINUTES);
$comentarios = (string) get_parameter_post('comentarios', ''); $comentarios = (string) get_parameter_post('comentarios', '');
$modo = (int) get_parameter_post('modo'); $modo = (int) get_parameter_post('modo');
@ -485,6 +492,13 @@ if ($id_agente) {
$collectiontab = ''; $collectiontab = '';
} }
// NetworkConfigManager tab.
$ncm_tab = enterprise_hook('networkconfigmanager_tab');
if ($ncm_tab === ENTERPRISE_NOT_HOOK) {
$ncm_tab = '';
}
// Group tab. // Group tab.
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image( $grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image(
'images/group.png', 'images/group.png',
@ -616,6 +630,7 @@ if ($id_agente) {
'main' => $maintab, 'main' => $maintab,
'remote_configuration' => $remote_configuration_tab, 'remote_configuration' => $remote_configuration_tab,
'module' => $moduletab, 'module' => $moduletab,
'ncm' => $ncm_tab,
'alert' => $alerttab, 'alert' => $alerttab,
'template' => $templatetab, 'template' => $templatetab,
'inventory' => $inventorytab, 'inventory' => $inventorytab,
@ -631,6 +646,7 @@ if ($id_agente) {
'separator' => '', 'separator' => '',
'main' => $maintab, 'main' => $maintab,
'module' => $moduletab, 'module' => $moduletab,
'ncm' => $ncm_tab,
'alert' => $alerttab, 'alert' => $alerttab,
'template' => $templatetab, 'template' => $templatetab,
'inventory' => $inventorytab, 'inventory' => $inventorytab,
@ -699,6 +715,11 @@ if ($id_agente) {
$tab_name = 'Collection'; $tab_name = 'Collection';
break; break;
case 'ncm':
$tab_description = '- '.__('Network config manager');
$tab_name = 'Network config manager';
break;
case 'inventory': case 'inventory':
$tab_description = '- '.__('Inventory'); $tab_description = '- '.__('Inventory');
$help_header = 'inventory_tab'; $help_header = 'inventory_tab';
@ -976,6 +997,8 @@ if ($update_agent) {
$cps = get_parameter_switch('cps', -1); $cps = get_parameter_switch('cps', -1);
$old_values = db_get_row('tagente', 'id_agente', $id_agente); $old_values = db_get_row('tagente', 'id_agente', $id_agente);
$fields = db_get_all_fields_in_table('tagent_custom_fields'); $fields = db_get_all_fields_in_table('tagent_custom_fields');
$secondary_groups = (string) get_parameter('secondary_hidden', '');
if ($fields === false) { if ($fields === false) {
$fields = []; $fields = [];
@ -1205,7 +1228,16 @@ if ($update_agent) {
"Quiet":"'.(int) $quiet.'", "Quiet":"'.(int) $quiet.'",
"Cps":"'.(int) $cps.'"}'; "Cps":"'.(int) $cps.'"}';
enterprise_hook('update_agent', [$id_agente]); // Create the secondary groups.
enterprise_hook(
'agents_update_secondary_groups',
[
$id_agente,
explode(',', $secondary_groups),
[],
]
);
ui_print_success_message(__('Successfully updated')); ui_print_success_message(__('Successfully updated'));
db_pandora_audit( db_pandora_audit(
'Agent management', 'Agent management',
@ -2313,6 +2345,10 @@ switch ($tab) {
include 'agent_incidents.php'; include 'agent_incidents.php';
break; break;
case 'ncm':
enterprise_hook('ncm_agent_tab', [$id_agente]);
break;
case 'remote_configuration': case 'remote_configuration':
enterprise_include('godmode/agentes/agent_disk_conf_editor.php'); enterprise_include('godmode/agentes/agent_disk_conf_editor.php');
break; break;

View File

@ -1,577 +1,75 @@
<?php <?php
/**
* Calendar controller.
*
* @category Alerts
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // Begin.
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Copyright (c) 2012-2016 Junichi Satoh
// 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.
// Load global vars
global $config; global $config;
require_once 'include/functions_alerts.php'; require_once $config['homedir'].'/vendor/autoload.php';
require_once 'include/ics-parser/class.iCalReader.php'; require_once $config['homedir'].'/include/class/CalendarManager.class.php';
check_login(); use PandoraFMS\CalendarManager;
if (! check_acl($config['id_user'], 0, 'LM')) { $ajaxPage = 'godmode/alerts/alert_special_days';
db_pandora_audit( $url = 'index.php?sec=galertas&sec2=godmode/alerts/alert_special_days';
'ACL Violation',
'Trying to access Alert Management' // Control call flow.
); try {
include 'general/noaccess.php'; // User access and validation is being processed on class constructor.
$cs = new CalendarManager($url, $ajaxPage);
} catch (Exception $e) {
if ((bool) is_ajax() === true) {
echo json_encode(['error' => '[CalendarManager]'.$e->getMessage() ]);
exit; exit;
} else {
echo '[CalendarManager]'.$e->getMessage();
} }
if (is_ajax()) { // Stop this execution, but continue 'globally'.
$get_alert_command = (bool) get_parameter('get_alert_command');
if ($get_alert_command) {
$id = (int) get_parameter('id');
$command = alerts_get_alert_command($id);
echo json_encode($command);
}
return; return;
} }
// Header // AJAX controller.
ui_print_page_header( if ((bool) is_ajax() === true) {
__('Alerts').' &raquo; '.__('Special days list'), $method = get_parameter('method');
'images/gm_alerts.png',
false,
'alert_special_days',
true
);
$update_special_day = (bool) get_parameter('update_special_day'); if (method_exists($cs, $method) === true) {
$create_special_day = (bool) get_parameter('create_special_day'); if (CalendarManager::ajaxMethod($method) === true) {
$delete_special_day = (bool) get_parameter('delete_special_day'); $cs->{$method}();
$upload_ical = (bool) get_parameter('upload_ical', 0);
$display_range = (int) get_parameter('display_range');
if ($upload_ical) {
$same_day = (string) get_parameter('same_day');
$overwrite = (bool) get_parameter('overwrite', 0);
$values = [];
$values['id_group'] = (string) get_parameter('id_group');
$values['same_day'] = $same_day;
$error = $_FILES['ical_file']['error'];
$extension = substr($_FILES['ical_file']['name'], -3);
if ($error == 0 && strcasecmp($extension, 'ics') == 0) {
$skipped_dates = '';
// $today = date ('Ymd');
$this_month = date('Ym');
$ical = new ICal($_FILES['ical_file']['tmp_name']);
$events = $ical->events();
foreach ($events as $event) {
$event_date = substr($event['DTSTART'], 0, 8);
$event_month = substr($event['DTSTART'], 0, 6);
if ($event_month >= $this_month) {
$values['description'] = @$event['SUMMARY'];
$values['date'] = $event_date;
$date = date('Y-m-d', strtotime($event_date));
$date_check = '';
$filter['id_group'] = $values['id_group'];
$filter['date'] = $date;
$date_check = db_get_value_filter('date', 'talert_special_days', $filter);
if ($date_check == $date) {
if ($overwrite) {
$id_special_day = db_get_value_filter('id', 'talert_special_days', $filter);
alerts_update_alert_special_day($id_special_day, $values);
} else { } else {
if ($skipped_dates == '') { $cs->error('Unavailable method.');
$skipped_dates = __('Skipped dates: ');
}
$skipped_dates .= $date.' ';
} }
} else { } else {
alerts_create_alert_special_day($date, $same_day, $values); $cs->error('Method not found. ['.$method.']');
}
}
} }
$result = true; // Stop any execution.
exit;
} else { } else {
$result = false; // Run.
$cs->run();
} }
if ($result) {
db_pandora_audit('Special days list', 'Upload iCalendar '.$_FILES['ical_file']['name']);
}
ui_print_result_message($result, __('Success to upload iCalendar').'<br />'.$skipped_dates, __('Fail to upload iCalendar'));
}
if ($create_special_day) {
$date = (string) get_parameter('date');
$same_day = (string) get_parameter('same_day');
$values = [];
$values['id_group'] = (string) get_parameter('id_group');
$values['description'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$aviable_description = true;
if (preg_match('/script/i', $values['description'])) {
$aviable_description = false;
}
$array_date = explode('-', $date);
$year = $array_date[0];
$month = $array_date[1];
$day = $array_date[2];
if ($year == '*') {
// '0001' means every year.
$year = '0001';
$date = $year.'-'.$month.'-'.$day;
}
if (!checkdate($month, $day, $year)) {
$result = '';
} else {
$date_check = '';
$filter['id_group'] = $values['id_group'];
$filter['date'] = $date;
$date_check = db_get_value_filter('date', 'talert_special_days', $filter);
if ($date_check == $date) {
$result = '';
$messageAction = __('Could not be created, it already exists');
} else {
if ($aviable_description) {
$result = alerts_create_alert_special_day($date, $same_day, $values);
$info = '{"Date":"'.$date.'","Same day of the week":"'.$same_day.'","Description":"'.$values['description'].'"}';
} else {
$result = false;
}
}
}
if ($result) {
db_pandora_audit('Command management', 'Create special day '.$result, false, false, $info);
} else {
db_pandora_audit('Command management', 'Fail try to create special day', false, false);
}
// Show errors
if (!isset($messageAction)) {
$messageAction = __('Could not be created');
}
$messageAction = ui_print_result_message(
$result,
__('Successfully created'),
$messageAction
);
}
if ($update_special_day) {
$id = (int) get_parameter('id');
$alert = alerts_get_alert_special_day($id);
$date = (string) get_parameter('date');
$date_orig = (string) get_parameter('date_orig');
$same_day = (string) get_parameter('same_day');
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$id_group = (string) get_parameter('id_group');
$id_group_orig = (string) get_parameter('id_group_orig');
$aviable_description = true;
if (preg_match('/script/i', $description)) {
$aviable_description = false;
}
$array_date = explode('-', $date);
$year = $array_date[0];
$month = $array_date[1];
$day = $array_date[2];
if ($year == '*') {
// '0001' means every year.
$year = '0001';
$date = $year.'-'.$month.'-'.$day;
}
$values = [];
$values['date'] = $date;
$values['id_group'] = $id_group;
$values['same_day'] = $same_day;
$values['description'] = $description;
if (!checkdate($month, $day, $year)) {
$result = '';
} else {
if ($id_group != $id_group_orig || $date != $date_orig) {
$date_check = '';
$filter['id_group'] = $id_group;
$filter['date'] = $date;
$date_check = db_get_value_filter('date', 'talert_special_days', $filter);
if ($date_check == $date) {
$result = '';
$messageAction = __('Could not be updated, it already exists');
} else {
if ($aviable_description !== false) {
$result = alerts_update_alert_special_day($id, $values);
$info = '{"Date":"'.$date.'","Same day of the week":"'.$same_day.'","Description":"'.$description.'"}';
}
}
} else {
if ($aviable_description !== false) {
$result = alerts_update_alert_special_day($id, $values);
$info = '{"Date":"'.$date.'","Same day of the week":"'.$same_day.'","Description":"'.$description.'"}';
}
}
}
if ($result) {
db_pandora_audit('Command management', 'Update special day '.$id, false, false, $info);
} else {
db_pandora_audit('Command management', 'Fail to update special day '.$id, false, false);
}
// Show errors
if (!isset($messageAction)) {
$messageAction = __('Could not be updated');
}
$messageAction = ui_print_result_message(
$result,
__('Successfully updated'),
$messageAction
);
}
if ($delete_special_day) {
$id = (int) get_parameter('id');
$result = alerts_delete_alert_special_day($id);
if ($result) {
db_pandora_audit('Command management', 'Delete special day '.$id);
} else {
db_pandora_audit('Command management', 'Fail to delete special day '.$id);
}
ui_print_result_message(
$result,
__('Successfully deleted'),
__('Could not be deleted')
);
}
echo "<table cellpadding='4' cellspacing='4' class='databox upload bolder margin-bottom-10' width='100%
'><tr>";
echo "<form method='post' enctype='multipart/form-data' action='index.php?sec=gagente&sec2=godmode/alerts/alert_special_days'>";
echo '<td>';
echo __('iCalendar(.ics) file').'&nbsp;';
html_print_input_file('ical_file', false, false);
echo '</td><td>';
echo __('Same day of the week');
$days = [];
$days['monday'] = __('Monday');
$days['tuesday'] = __('Tuesday');
$days['wednesday'] = __('Wednesday');
$days['thursday'] = __('Thursday');
$days['friday'] = __('Friday');
$days['saturday'] = __('Saturday');
$days['sunday'] = __('Sunday');
html_print_select($days, 'same_day', $same_day, '', '', 0, false, false, false);
echo '</td><td>';
echo __('Group').'&nbsp;';
$own_info = get_user_info($config['id_user']);
if (!users_can_manage_group_all('LM')) {
$can_manage_group_all = false;
} else {
$can_manage_group_all = true;
}
echo '<div class="inline w250px">';
html_print_select_groups(false, 'LM', $can_manage_group_all, 'id_group', $id_group, false, '', 0, false, false, true, '', false, 'width:100px;');
echo '</div>';
echo '</td><td>';
echo __('Overwrite');
ui_print_help_tip(__('Check this box, if you want to overwrite existing same days.'), false);
echo '&nbsp;';
html_print_checkbox('overwrite', 1, $overwrite, false, false, false, true);
echo '</td><td>';
html_print_input_hidden('upload_ical', 1);
echo "<input name='srcbutton' type='submit' class='sub next' value='".__('Upload')."'>";
echo '</td></form>';
echo '</tr></table>';
$this_year = date('Y');
$this_month = date('m');
$filter = [];
if (!is_user_admin($config['id_user'])) {
$filter['id_group'] = array_keys(users_get_groups(false, 'LM'));
}
// Show display range.
$html = "<table cellpadding='4' cellspacing='4' width='100%' margin-bottom: 10px;'><tr><td>".__('Display range: ');
if ($display_range) {
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days">['.__('Default').']</a>&nbsp;&nbsp;';
if ($display_range > 1970) {
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= ($display_range - 1);
$html .= '">&lt;&lt;&nbsp;</a>';
}
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range='.$display_range.'" class="bolder">['.$display_range.']</a>';
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= ($display_range + 1);
$html .= '">&nbsp;&gt;&gt;</a>';
} else {
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days" class="bolder">['.__('Default').']</a>&nbsp;&nbsp;';
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= ($this_year - 1);
$html .= '">&lt;&lt;&nbsp;</a>';
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= $this_year;
$html .= '">[';
$html .= $this_year;
$html .= ']</a>';
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= ($this_year + 1);
$html .= '">&nbsp;&gt;&gt;</a>';
}
$html .= '</td></tr>';
echo $html;
// Show calendar
for ($month = 1; $month <= 12; $month++) {
if ($display_range) {
$display_month = $month;
$display_year = $display_range;
} else {
$display_month = ($this_month + $month - 1);
$display_year = $this_year;
}
if ($display_month > 12) {
$display_month -= 12;
$display_year += 1;
}
$cal_table = new stdClass();
$cal_table->width = '100%';
$cal_table->class = 'databox data';
$cal_table->data = [];
$cal_table->head = [];
$cal_table->head[0] = __('Sun');
$cal_table->head[1] = __('Mon');
$cal_table->head[2] = __('Tue');
$cal_table->head[3] = __('Wed');
$cal_table->head[4] = __('Thu');
$cal_table->head[5] = __('Fri');
$cal_table->head[6] = __('Sat');
$cal_table->cellstyle = [];
$cal_table->size = [];
$cal_table->size[0] = '14%';
$cal_table->size[1] = '14%';
$cal_table->size[2] = '14%';
$cal_table->size[3] = '14%';
$cal_table->size[4] = '14%';
$cal_table->size[5] = '14%';
$cal_table->size[6] = '14%';
$cal_table->align = [];
$cal_table->border = '1';
$cal_table->titlestyle = 'text-align:center; font-weight: bold;';
switch ($display_month) {
case 1:
$cal_table->title = __('January');
break;
case 2:
$cal_table->title = __('February');
break;
case 3:
$cal_table->title = __('March');
break;
case 4:
$cal_table->title = __('April');
break;
case 5:
$cal_table->title = __('May');
break;
case 6:
$cal_table->title = __('June');
break;
case 7:
$cal_table->title = __('July');
break;
case 8:
$cal_table->title = __('August');
break;
case 9:
$cal_table->title = __('September');
break;
case 10:
$cal_table->title = __('October');
break;
case 11:
$cal_table->title = __('November');
break;
case 12:
$cal_table->title = __('December');
break;
}
$cal_table->title .= ' / '.$display_year;
$last_day = date('j', mktime(0, 0, 0, ($display_month + 1), 0, $display_year));
$cal_line = 0;
for ($day = 1; $day < ($last_day + 1); $day++) {
$week = date('w', mktime(0, 0, 0, $display_month, $day, $display_year));
if ($cal_line == 0 && $week != 0 && $day == 1) {
for ($i = 0; $i < $week; $i++) {
$cal_table->cellstyle[$cal_line][$i] = 'font-size: 18px;';
$cal_table->data[$cal_line][$i] = '-';
}
}
if ($week == 0 || $week == 6) {
$cal_table->cellstyle[$cal_line][$week] = 'color: red;';
}
$date = sprintf('%04d-%02d-%02d', $display_year, $display_month, $day);
$date_wildcard = sprintf('0001-%02d-%02d', $display_month, $day);
$special_days = '';
$filter['date'] = [
$date,
$date_wildcard,
];
$filter['order']['field'] = 'date';
$filter['order']['order'] = 'DESC';
$special_days = db_get_all_rows_filter('talert_special_days', $filter);
if ($special_days != '') {
foreach ($special_days as $special_day) {
$cal_table->data[$cal_line][$week] .= '<div class="font_18px" style="';
if ($special_day['same_day'] == 'sunday' || $special_day['same_day'] == 'saturday') {
$cal_table->data[$cal_line][$week] .= 'color: red;';
}
$cal_table->data[$cal_line][$week] .= '">';
$cal_table->data[$cal_line][$week] .= $day;
$cal_table->data[$cal_line][$week] .= '</div>';
$cal_table->data[$cal_line][$week] .= ui_print_group_icon($special_day['id_group'], true);
if ($special_day['date'] == $date_wildcard) {
$cal_table->data[$cal_line][$week] .= '('.ui_print_help_tip('This is valid every year. However, this will be ignored if indivisual setting for the same group is available.', true).') ';
}
$cal_table->data[$cal_line][$week] .= __('Same as ');
switch ($special_day['same_day']) {
case 'monday':
$cal_table->data[$cal_line][$week] .= __('Monday');
break;
case 'tuesday':
$cal_table->data[$cal_line][$week] .= __('Tuesday');
break;
case 'wednesday':
$cal_table->data[$cal_line][$week] .= __('Wednesday');
break;
case 'thursday':
$cal_table->data[$cal_line][$week] .= __('Thursday');
break;
case 'friday':
$cal_table->data[$cal_line][$week] .= __('Friday');
break;
case 'saturday':
$cal_table->data[$cal_line][$week] .= __('Saturday');
break;
case 'sunday':
$cal_table->data[$cal_line][$week] .= __('Sunday');
break;
}
// Only show description if is filled.
if (empty($special_day['description']) === false) {
$cal_table->data[$cal_line][$week] .= ui_print_help_tip($special_day['description'], true);
}
if ($special_day['id_group'] || ($can_manage_group_all && $special_day['id_group'] == 0)) {
$cal_table->data[$cal_line][$week] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days&id='.$special_day['id'].'" title=';
$cal_table->data[$cal_line][$week] .= __('Edit');
$cal_table->data[$cal_line][$week] .= '>'.html_print_image(
'images/config.png',
true,
['class' => 'invert_filter']
).'</a> &nbsp;';
$cal_table->data[$cal_line][$week] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&delete_special_day=1&id='.$special_day['id'].'"onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;" title=';
$cal_table->data[$cal_line][$week] .= __('Remove');
$cal_table->data[$cal_line][$week] .= '>'.html_print_image(
'images/cross.png',
true,
['class' => 'invert_filter']
).'</a>';
;
}
$cal_table->data[$cal_line][$week] .= '<br>';
$cal_table->cellstyle[$cal_line][$week] = 'font-weight: bold;';
}
} else {
$cal_table->cellstyle[$cal_line][$week] .= 'font-size: 18px;';
$cal_table->data[$cal_line][$week] = $day.'&nbsp;';
}
$cal_table->data[$cal_line][$week] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days&create_special_day=1&date='.$date.'" title=';
$cal_table->data[$cal_line][$week] .= __('Create');
$cal_table->data[$cal_line][$week] .= '>'.html_print_image(
'images/add_mc.png',
true,
['class' => 'invert_filter']
).'</a>';
if ($week == 6) {
$cal_line++;
}
}
for ($padding = ($week + 1); $padding <= 6; $padding++) {
$cal_table->cellstyle[$cal_line][$padding] = 'font-size: 18px;';
$cal_table->data[$cal_line][$padding] = '-';
}
html_print_table($cal_table);
}
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
html_print_input_hidden('create_special_day', 1);
echo '</form>';
echo '</div>';

View File

@ -237,7 +237,7 @@ $create_ticket_command_id = db_get_value('id', 'talert_commands', 'name', io_saf
$sql_exclude_command_id = ''; $sql_exclude_command_id = '';
if ($config['integria_enabled'] == 0 && $create_ticket_command_id !== false) { if (!is_metaconsole() && $config['integria_enabled'] == 0 && $create_ticket_command_id !== false) {
$sql_exclude_command_id = ' AND id <> '.$create_ticket_command_id; $sql_exclude_command_id = ' AND id <> '.$create_ticket_command_id;
} }
@ -597,6 +597,7 @@ $(document).ready (function () {
$("#id_command").change (function () { $("#id_command").change (function () {
values = Array (); values = Array ();
// No se envia el valor del commando.
values.push({ values.push({
name: "page", name: "page",
value: "godmode/alerts/alert_commands"}); value: "godmode/alerts/alert_commands"});

View File

@ -1,159 +0,0 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Copyright (c) 2012-2013 Junichi Satoh
// 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.
// Load global vars.
global $config;
require_once 'include/functions_alerts.php';
check_login();
if (! check_acl($config['id_user'], 0, 'LM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Alert Management'
);
include 'general/noaccess.php';
exit;
}
ui_require_javascript_file('calendar');
$id = (int) get_parameter('id');
$date = (string) get_parameter('date');
$name = '';
$command = '';
$description = '';
$same_day = '';
$id_group = 0;
if ($id) {
$special_day = alerts_get_alert_special_day($id);
$date = str_replace('0001', '*', $special_day['date']);
$date_orig = $date;
$same_day = $special_day['same_day'];
$description = $special_day['description'];
$id_group = $special_day['id_group'];
$id_group_orig = $id_group;
}
if ($date == '') {
$date = date('Y-m-d', get_system_time());
}
// Header.
ui_print_page_header(
__('Alerts').' &raquo; '.__('Configure special day'),
'images/gm_alerts.png',
false,
'',
true
);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->style = [];
$table->style[0] = 'font-weight: bold';
$table->size = [];
$table->size[0] = '20%';
$table->data = [];
$table->data[0][0] = __('Date');
$table->data[0][1] = html_print_input_text(
'date',
$date,
'',
10,
10,
true
);
$table->data[0][1] .= html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'onclick' => "scwShow(scwID('text-date'),this);",
'class' => 'invert_filter',
]
);
$table->data[1][0] = __('Group');
$groups = users_get_groups();
$own_info = get_user_info($config['id_user']);
// Only display group "All" if user is administrator or has "LM" privileges.
if (users_can_manage_group_all('LM')) {
$display_all_group = true;
} else {
$display_all_group = false;
}
$table->data[1][1] = html_print_select_groups(
false,
'LW',
$display_all_group,
'id_group',
$id_group,
'',
'',
0,
true
);
$table->data[2][0] = __('Same day of the week');
$days = [];
$days['monday'] = __('Monday');
$days['tuesday'] = __('Tuesday');
$days['wednesday'] = __('Wednesday');
$days['thursday'] = __('Thursday');
$days['friday'] = __('Friday');
$days['saturday'] = __('Saturday');
$days['sunday'] = __('Sunday');
$table->data[2][1] = html_print_select(
$days,
'same_day',
$same_day,
'',
'',
0,
true,
false,
false
);
$table->data[3][0] = __('Description');
$table->data[3][1] = html_print_textarea(
'description',
10,
30,
$description,
'',
true
);
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id) {
html_print_input_hidden('id', $id);
html_print_input_hidden('update_special_day', 1);
html_print_input_hidden('id_group_orig', $id_group_orig);
html_print_input_hidden('date_orig', $date_orig);
html_print_submit_button(__('Update'), 'create', false, 'class="sub upd"');
} else {
html_print_input_hidden('create_special_day', 1);
html_print_submit_button(__('Create'), 'create', false, 'class="sub wand"');
}
echo '</div>';
echo '</form>';

View File

@ -11,8 +11,11 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars.
global $config; global $config;
use PandoraFMS\Calendar;
require_once $config['homedir'].'/include/functions_alerts.php'; require_once $config['homedir'].'/include/functions_alerts.php';
require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_users.php';
enterprise_include_once('meta/include/functions_alerts_meta.php'); enterprise_include_once('meta/include/functions_alerts_meta.php');
@ -288,7 +291,7 @@ function update_template($step)
$friday = (bool) get_parameter('friday'); $friday = (bool) get_parameter('friday');
$saturday = (bool) get_parameter('saturday'); $saturday = (bool) get_parameter('saturday');
$sunday = (bool) get_parameter('sunday'); $sunday = (bool) get_parameter('sunday');
$special_day = (bool) get_parameter('special_day'); $special_day = (int) get_parameter('special_day');
$time_from = (string) get_parameter('time_from'); $time_from = (string) get_parameter('time_from');
$time_from = date('H:i:00', strtotime($time_from)); $time_from = date('H:i:00', strtotime($time_from));
$time_to = (string) get_parameter('time_to'); $time_to = (string) get_parameter('time_to');
@ -418,7 +421,7 @@ $thursday = true;
$friday = true; $friday = true;
$saturday = true; $saturday = true;
$sunday = true; $sunday = true;
$special_day = false; $special_day = 0;
$default_action = 0; $default_action = 0;
$fields = []; $fields = [];
for ($i = 1; $i <= $config['max_macro_fields']; $i++) { for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
@ -561,7 +564,7 @@ if ($id && ! $create_template) {
$friday = (bool) $template['friday']; $friday = (bool) $template['friday'];
$saturday = (bool) $template['saturday']; $saturday = (bool) $template['saturday'];
$sunday = (bool) $template['sunday']; $sunday = (bool) $template['sunday'];
$special_day = (bool) $template['special_day']; $special_day = (int) $template['special_day'];
$max_alerts = $template['max_alerts']; $max_alerts = $template['max_alerts'];
$min_alerts = $template['min_alerts']; $min_alerts = $template['min_alerts'];
$min_alerts_reset_counter = $template['min_alerts_reset_counter']; $min_alerts_reset_counter = $template['min_alerts_reset_counter'];
@ -671,11 +674,36 @@ if ($step == 2) {
); );
$table->data[0][2] = __('Use special days list'); $table->data[0][2] = __('Use special days list');
$table->data[0][3] = html_print_checkbox( $data_special_days = Calendar::calendars(
// Fields.
[ '`talert_calendar`.*' ],
// Filter.
[],
// Count.
false,
// Offset.
null,
// Limit.
null,
// Order.
null,
// Sort field.
null,
// Reduce to a select.
true
);
$table->data[0][3] = html_print_select(
$data_special_days,
'special_day', 'special_day',
1,
$special_day, $special_day,
'',
__('None'),
0,
true, true,
false,
false,
'',
(!$is_management_allowed | $disabled) (!$is_management_allowed | $disabled)
); );

View File

@ -219,7 +219,8 @@ $alertstab = [
'title' => __('Alerts operations'), 'title' => __('Alerts operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_alerts', ).'</a>',
'active' => $tab == 'massive_alerts',
]; ];
$userstab = [ $userstab = [
@ -230,7 +231,8 @@ $userstab = [
'title' => __('Users operations'), 'title' => __('Users operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_users', ).'</a>',
'active' => $tab == 'massive_users',
]; ];
$agentstab = [ $agentstab = [
@ -241,7 +243,8 @@ $agentstab = [
'title' => __('Agents operations'), 'title' => __('Agents operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_agents', ).'</a>',
'active' => $tab == 'massive_agents',
]; ];
$modulestab = [ $modulestab = [
@ -252,7 +255,8 @@ $agentstab = [
'title' => __('Modules operations'), 'title' => __('Modules operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_modules', ).'</a>',
'active' => $tab == 'massive_modules',
]; ];
$pluginstab = [ $pluginstab = [
@ -263,7 +267,8 @@ $agentstab = [
'title' => __('Plugins operations'), 'title' => __('Plugins operations'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
).'</a>', 'active' => $tab == 'massive_plugins', ).'</a>',
'active' => $tab == 'massive_plugins',
]; ];
$policiestab = enterprise_hook('massive_policies_tab'); $policiestab = enterprise_hook('massive_policies_tab');

View File

@ -60,7 +60,7 @@ if (check_acl($config['id_user'], 0, 'AR')
// Add to menu. // Add to menu.
$menu_godmode['discovery']['text'] = __('Discovery'); $menu_godmode['discovery']['text'] = __('Discovery');
$menu_godmode['discovery']['sec2'] = 'godmode/servers/discovery'; $menu_godmode['discovery']['sec2'] = '';
$menu_godmode['discovery']['id'] = 'god-discovery'; $menu_godmode['discovery']['id'] = 'god-discovery';
$menu_godmode['discovery']['sub'] = $sub; $menu_godmode['discovery']['sub'] = $sub;
} }
@ -175,6 +175,10 @@ if (check_acl($config['id_user'], 0, 'AW')) {
enterprise_hook('agents_submenu'); enterprise_hook('agents_submenu');
} }
if (check_acl($config['id_user'], 0, 'NW')) {
enterprise_hook('agents_ncm_submenu');
}
if (check_acl($config['id_user'], 0, 'AW')) { if (check_acl($config['id_user'], 0, 'AW')) {
$sub['gmassive']['text'] = __('Bulk operations'); $sub['gmassive']['text'] = __('Bulk operations');
$sub['gmassive']['id'] = 'Bulk operations'; $sub['gmassive']['id'] = 'Bulk operations';
@ -250,20 +254,20 @@ if (check_acl($config['id_user'], 0, 'LW')
$sub = []; $sub = [];
if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EM')) { if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EM')) {
// Custom event fields // Custom event fields
$sub['godmode/events/events&amp;section=filter']['text'] = __('Event filters'); $sub['godmode/events/events&section=filter']['text'] = __('Event filters');
$sub['godmode/events/events&amp;section=filter']['id'] = 'Event filters'; $sub['godmode/events/events&section=filter']['id'] = 'Event filters';
} }
if (check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'PM')) {
$sub['godmode/events/events&amp;section=fields']['text'] = __('Custom events'); $sub['godmode/events/events&section=fields']['text'] = __('Custom events');
$sub['godmode/events/events&amp;section=fields']['id'] = 'Custom events'; $sub['godmode/events/events&section=fields']['id'] = 'Custom events';
$sub['godmode/events/events&amp;section=responses']['text'] = __('Event responses'); $sub['godmode/events/events&section=responses']['text'] = __('Event responses');
$sub['godmode/events/events&amp;section=responses']['id'] = 'Event responses'; $sub['godmode/events/events&section=responses']['id'] = 'Event responses';
} }
if (!empty($sub)) { if (!empty($sub)) {
$menu_godmode['geventos']['text'] = __('Events'); $menu_godmode['geventos']['text'] = __('Events');
$menu_godmode['geventos']['sec2'] = 'godmode/events/events&amp;section=filter'; $menu_godmode['geventos']['sec2'] = 'godmode/events/events&section=filter';
$menu_godmode['geventos']['id'] = 'god-events'; $menu_godmode['geventos']['id'] = 'god-events';
$menu_godmode['geventos']['sub'] = $sub; $menu_godmode['geventos']['sub'] = $sub;
} }
@ -303,7 +307,7 @@ if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, '
if (check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'PM')) {
// Setup // Setup
$menu_godmode['gsetup']['text'] = __('Setup'); $menu_godmode['gsetup']['text'] = __('Setup');
$menu_godmode['gsetup']['sec2'] = 'godmode/setup/setup&section=general'; $menu_godmode['gsetup']['sec2'] = 'general';
$menu_godmode['gsetup']['id'] = 'god-setup'; $menu_godmode['gsetup']['id'] = 'god-setup';
$sub = []; $sub = [];
@ -315,50 +319,50 @@ if (check_acl($config['id_user'], 0, 'PM')) {
$sub['general']['subtype'] = 'nolink'; $sub['general']['subtype'] = 'nolink';
$sub2 = []; $sub2 = [];
$sub2['godmode/setup/setup&amp;section=general']['text'] = __('General Setup'); $sub2['godmode/setup/setup&section=general']['text'] = __('General Setup');
$sub2['godmode/setup/setup&amp;section=general']['id'] = 'General Setup'; $sub2['godmode/setup/setup&section=general']['id'] = 'General Setup';
$sub2['godmode/setup/setup&amp;section=general']['refr'] = 0; $sub2['godmode/setup/setup&section=general']['refr'] = 0;
enterprise_hook('password_submenu'); enterprise_hook('password_submenu');
enterprise_hook('enterprise_submenu'); enterprise_hook('enterprise_submenu');
enterprise_hook('historydb_submenu'); enterprise_hook('historydb_submenu');
enterprise_hook('log_collector_submenu'); enterprise_hook('log_collector_submenu');
$sub2['godmode/setup/setup&amp;section=auth']['text'] = __('Authentication'); $sub2['godmode/setup/setup&section=auth']['text'] = __('Authentication');
$sub2['godmode/setup/setup&amp;section=auth']['refr'] = 0; $sub2['godmode/setup/setup&section=auth']['refr'] = 0;
$sub2['godmode/setup/setup&amp;section=perf']['text'] = __('Performance'); $sub2['godmode/setup/setup&section=perf']['text'] = __('Performance');
$sub2['godmode/setup/setup&amp;section=perf']['refr'] = 0; $sub2['godmode/setup/setup&section=perf']['refr'] = 0;
$sub2['godmode/setup/setup&amp;section=vis']['text'] = __('Visual styles'); $sub2['godmode/setup/setup&section=vis']['text'] = __('Visual styles');
$sub2['godmode/setup/setup&amp;section=vis']['refr'] = 0; $sub2['godmode/setup/setup&section=vis']['refr'] = 0;
if (check_acl($config['id_user'], 0, 'AW')) { if (check_acl($config['id_user'], 0, 'AW')) {
if ($config['activate_netflow']) { if ($config['activate_netflow']) {
$sub2['godmode/setup/setup&amp;section=net']['text'] = __('Netflow'); $sub2['godmode/setup/setup&section=net']['text'] = __('Netflow');
$sub2['godmode/setup/setup&amp;section=net']['refr'] = 0; $sub2['godmode/setup/setup&section=net']['refr'] = 0;
} }
} }
$sub2['godmode/setup/setup&amp;section=ehorus']['text'] = __('eHorus'); $sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus');
$sub2['godmode/setup/setup&amp;section=ehorus']['refr'] = 0; $sub2['godmode/setup/setup&section=ehorus']['refr'] = 0;
$sub2['godmode/setup/setup&amp;section=integria']['text'] = __('Integria IMS'); $sub2['godmode/setup/setup&section=integria']['text'] = __('Integria IMS');
$sub2['godmode/setup/setup&amp;section=integria']['refr'] = 0; $sub2['godmode/setup/setup&section=integria']['refr'] = 0;
enterprise_hook('module_library_submenu'); enterprise_hook('module_library_submenu');
$sub2['godmode/setup/setup&amp;section=notifications']['text'] = __('Notifications'); $sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications');
$sub2['godmode/setup/setup&amp;section=notifications']['refr'] = 0; $sub2['godmode/setup/setup&section=notifications']['refr'] = 0;
$sub2['godmode/setup/setup&amp;section=websocket_engine']['text'] = __('Websocket Engine'); $sub2['godmode/setup/setup&section=websocket_engine']['text'] = __('Websocket Engine');
$sub2['godmode/setup/setup&amp;section=websocket_engine']['refr'] = 0; $sub2['godmode/setup/setup&section=websocket_engine']['refr'] = 0;
$sub2['godmode/setup/setup&amp;section=external_tools']['text'] = __('External Tools'); $sub2['godmode/setup/setup&section=external_tools']['text'] = __('External Tools');
$sub2['godmode/setup/setup&amp;section=external_tools']['refr'] = 0; $sub2['godmode/setup/setup&section=external_tools']['refr'] = 0;
if ($config['activate_gis']) { if ($config['activate_gis']) {
$sub2['godmode/setup/setup&amp;section=gis']['text'] = __('Map conections GIS'); $sub2['godmode/setup/setup&section=gis']['text'] = __('Map conections GIS');
} }
$sub['general']['sub2'] = $sub2; $sub['general']['sub2'] = $sub2;
@ -458,9 +462,9 @@ if (is_array($config['extensions'])) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon']; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
if ($extmenu['name'] == 'Cron jobs') { if ($extmenu['name'] == 'Cron jobs') {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = 'extensions'; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
} else { } else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = 'gextensions'; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
} }
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['extension'] = true; $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['extension'] = true;
@ -521,8 +525,8 @@ $menu_godmode['links']['sub'] = $sub;
// Update Manager // Update Manager
if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager']) { if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager']) {
$menu_godmode['messages']['text'] = __('Update manager'); $menu_godmode['messages']['text'] = __('Update manager');
$menu_godmode['messages']['sec2'] = '';
$menu_godmode['messages']['id'] = 'god-um_messages'; $menu_godmode['messages']['id'] = 'god-um_messages';
$menu_godmode['messages']['sec2'] = '';
$sub = []; $sub = [];
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline'); $sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
@ -539,7 +543,6 @@ if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager'])
// Module library. // Module library.
if (check_acl($config['id_user'], 0, 'AR')) { if (check_acl($config['id_user'], 0, 'AR')) {
$menu_godmode['gmodule_library']['text'] = __('Module library'); $menu_godmode['gmodule_library']['text'] = __('Module library');
$menu_godmode['gmodule_library']['sec2'] = 'godmode/module_library/module_library_view';
$menu_godmode['gmodule_library']['id'] = 'god-module_library'; $menu_godmode['gmodule_library']['id'] = 'god-module_library';
$sub = []; $sub = [];

View File

@ -581,7 +581,7 @@ if ($is_management_allowed === true && $multiple_delete) {
$id = 0; $id = 0;
} }
if ($id || $new_component if ((bool) $id !== false || $new_component
|| $create_network_from_module || $create_network_from_module
|| $create_network_from_snmp_browser || $create_network_from_snmp_browser
) { ) {
@ -598,6 +598,7 @@ $url = ui_get_url_refresh(
'offset' => false, 'offset' => false,
'search_string' => $search_string, 'search_string' => $search_string,
'search_id_group' => $search_id_group, 'search_id_group' => $search_id_group,
'id' => $id,
], ],
true, true,
false false

View File

@ -3505,7 +3505,7 @@ function print_SLA_list($width, $action, $idItem=null)
<tr id="sla_template" class="datos"> <tr id="sla_template" class="datos">
<td colspan="6"> <td colspan="6">
<?php <?php
echo __('Please save the SLA for start to add items in this list.'); echo __('Please save the item before adding entries to this list.');
?> ?>
</td> </td>
</tr> </tr>

View File

@ -1970,9 +1970,11 @@ switch ($action) {
); );
$values['id_group'] = get_parameter('combo_group'); $values['id_group'] = get_parameter('combo_group');
if ($values['server_name'] == '') {
$values['server_name'] = get_parameter( $values['server_name'] = get_parameter(
'combo_server' 'combo_server'
); );
}
if ((($values['type'] == 'custom_graph') if ((($values['type'] == 'custom_graph')
|| ($values['type'] == 'automatic_custom_graph')) || ($values['type'] == 'automatic_custom_graph'))

View File

@ -204,6 +204,15 @@ foreach ($layoutDatas as $layoutData) {
); );
break; break;
case CIRCULAR_INTERIOR_PROGRESS_BAR:
case CIRCULAR_PROGRESS_BAR:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/percentile_item.png',
true,
['title' => __('Percentile')]
);
break;
case MODULE_GRAPH: case MODULE_GRAPH:
$table->data[($i + 1)]['icon'] = html_print_image( $table->data[($i + 1)]['icon'] = html_print_image(
'images/chart_curve.png', 'images/chart_curve.png',
@ -306,6 +315,16 @@ foreach ($layoutDatas as $layoutData) {
break; break;
case NETWORK_LINK: case NETWORK_LINK:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/network_link_item.png',
true,
[
'title' => __('Network link'),
'class' => 'invert_filter',
]
);
break;
case LINE_ITEM: case LINE_ITEM:
$table->data[($i + 1)]['icon'] = html_print_image( $table->data[($i + 1)]['icon'] = html_print_image(
'images/line_item.png', 'images/line_item.png',
@ -325,6 +344,30 @@ foreach ($layoutDatas as $layoutData) {
); );
break; break;
case BASIC_CHART:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/basic_chart.png',
true,
['title' => __('Basic chart')]
);
break;
case ODOMETER:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/odometer.png',
true,
['title' => __('Odometer')]
);
break;
case CLOCK:
$table->data[($i + 1)]['icon'] = html_print_image(
'images/clock-tab.png',
true,
['title' => __('Clock')]
);
break;
default: default:
if (enterprise_installed()) { if (enterprise_installed()) {
$table->data[($i + 1)]['icon'] = enterprise_visual_map_print_list_element('icon', $layoutData); $table->data[($i + 1)]['icon'] = enterprise_visual_map_print_list_element('icon', $layoutData);
@ -394,6 +437,13 @@ foreach ($layoutDatas as $layoutData) {
$table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true).' x '.html_print_input_text('height_'.$idLayoutData, $layoutData['width'], '', 2, 5, true); $table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true).' x '.html_print_input_text('height_'.$idLayoutData, $layoutData['width'], '', 2, 5, true);
break; break;
case CIRCULAR_PROGRESS_BAR:
case CIRCULAR_INTERIOR_PROGRESS_BAR:
case PERCENTILE_BUBBLE:
case PERCENTILE_BAR:
$table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true);
break;
default: default:
$table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true).' x '.html_print_input_text('height_'.$idLayoutData, $layoutData['height'], '', 2, 5, true); $table->data[($i + 1)][2] = html_print_input_text('width_'.$idLayoutData, $layoutData['width'], '', 2, 5, true).' x '.html_print_input_text('height_'.$idLayoutData, $layoutData['height'], '', 2, 5, true);
break; break;
@ -478,6 +528,7 @@ foreach ($layoutDatas as $layoutData) {
case LABEL: case LABEL:
case NETWORK_LINK: case NETWORK_LINK:
case LINE_ITEM: case LINE_ITEM:
case CLOCK:
$table->data[($i + 2)][0] = ''; $table->data[($i + 2)][0] = '';
break; break;
@ -520,7 +571,7 @@ foreach ($layoutDatas as $layoutData) {
$params['value'] = db_get_value('alias', 'tagente', 'id_agente', $layoutData['id_agent']); $params['value'] = db_get_value('alias', 'tagente', 'id_agente', $layoutData['id_agent']);
} }
if ($layoutData['id_agent'] == 0 and $layoutData['id_custom_graph'] != 0) { if ($layoutData['id_custom_graph'] != 0) {
$table->data[($i + 2)][0] = __('Custom graph'); $table->data[($i + 2)][0] = __('Custom graph');
} else { } else {
$table->data[($i + 2)][0] = ui_print_agent_autocomplete_input($params); $table->data[($i + 2)][0] = ui_print_agent_autocomplete_input($params);
@ -540,6 +591,7 @@ foreach ($layoutDatas as $layoutData) {
case NETWORK_LINK: case NETWORK_LINK:
case LINE_ITEM: case LINE_ITEM:
case GROUP_ITEM: case GROUP_ITEM:
case CLOCK:
$table->data[($i + 2)][1] = ''; $table->data[($i + 2)][1] = '';
break; break;
@ -569,7 +621,7 @@ foreach ($layoutDatas as $layoutData) {
$modules = io_safe_output($modules); $modules = io_safe_output($modules);
if ($layoutData['id_agent'] == 0 and $layoutData['id_custom_graph'] != 0) { if ($layoutData['id_custom_graph'] != 0) {
if (is_metaconsole()) { if (is_metaconsole()) {
$graphs = []; $graphs = [];
$graphs = metaconsole_get_custom_graphs(true); $graphs = metaconsole_get_custom_graphs(true);

View File

@ -433,7 +433,10 @@ switch ($activeTab) {
$idsElements = db_get_all_rows_filter( $idsElements = db_get_all_rows_filter(
'tlayout_data', 'tlayout_data',
['id_layout' => $idVisualConsole], ['id_layout' => $idVisualConsole],
['id'] [
'id',
'type',
]
); );
if ($idsElements === false) { if ($idsElements === false) {
@ -449,18 +452,33 @@ switch ($activeTab) {
$values['height'] = get_parameter('height_'.$id, 0); $values['height'] = get_parameter('height_'.$id, 0);
$values['pos_x'] = get_parameter('left_'.$id, 0); $values['pos_x'] = get_parameter('left_'.$id, 0);
$values['pos_y'] = get_parameter('top_'.$id, 0); $values['pos_y'] = get_parameter('top_'.$id, 0);
$type = db_get_value('type', 'tlayout_data', 'id', $id); switch ($idElement['type']) {
switch ($type) { case NETWORK_LINK:
case MODULE_GRAPH: case LINE_ITEM:
continue 2;
break;
case SIMPLE_VALUE_MAX: case SIMPLE_VALUE_MAX:
case SIMPLE_VALUE_MIN: case SIMPLE_VALUE_MIN:
case SIMPLE_VALUE_AVG: case SIMPLE_VALUE_AVG:
$values['period'] = get_parameter('period_'.$id, 0); $values['period'] = get_parameter('period_'.$id, 0);
break; break;
case MODULE_GRAPH:
$values['period'] = get_parameter('period_'.$id, 0);
unset($values['image']);
break;
case GROUP_ITEM: case GROUP_ITEM:
$values['id_group'] = get_parameter('group_'.$id, 0); $values['id_group'] = get_parameter('group_'.$id, 0);
$values['show_statistics'] = get_parameter('show_statistics', 0); break;
case CIRCULAR_PROGRESS_BAR:
case CIRCULAR_INTERIOR_PROGRESS_BAR:
case PERCENTILE_BUBBLE:
case PERCENTILE_BAR:
unset($values['height']);
break; break;
} }

View File

@ -231,8 +231,8 @@ if (isset($_GET['server'])) {
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
$(document).ready (function () { $(document).ready (function () {
var id_server = <?php echo $id_server; ?>; var id_server = '<?php echo $id_server; ?>';
var server_type = <?php echo $row['server_type']; ?>; var server_type = '<?php echo $row['server_type']; ?>';
$("#check_exec_server img").on("click", function () { $("#check_exec_server img").on("click", function () {
$("#check_exec_server img").attr("src", "images/spinner.gif"); $("#check_exec_server img").attr("src", "images/spinner.gif");

View File

@ -571,7 +571,7 @@ $table_remote->data['integria_test'] = $row;
// Print. // Print.
echo '<div class="center pdd_b_20px">'; echo '<div class="center pdd_b_20px">';
echo '<a target="_blank" rel="noopener noreferrer" href="http://integriaims.com">'; echo '<a target="_blank" rel="noopener noreferrer" href="http://integriaims.com">';
html_print_image('images/integria_logo.png'); html_print_image('images/integria_logo.svg');
echo '</a>'; echo '</a>';
echo '<br />'; echo '<br />';
echo '<div clsas="integria_title">'; echo '<div clsas="integria_title">';

View File

@ -1513,7 +1513,7 @@ $(document).ready (function () {
$('#table_macros-field' + i) $('#table_macros-field' + i)
.removeAttr('class'); .removeAttr('class');
$("[name=field" + i + "_value]").val(old_value); $("[name=field" + i + "_value]").val(old_value).trigger('change');
$('#table_macros-field').show(); $('#table_macros-field').show();
} }
} }

View File

@ -1270,12 +1270,13 @@ class Client
} }
$content = file_get_contents($delete_files_txt); $content = file_get_contents($delete_files_txt);
$files = explode('\n', $content); $files = explode("\n", $content);
$processed = []; $processed = [];
foreach ($files as $file) { foreach ($files as $file) {
$file = trim(str_replace("\0", '', $this->productPath.'/'.$file)); $file = trim(str_replace("\0", '', $this->productPath.'/'.$file));
if (file_exists($file) === true if (file_exists($file) === true
&& is_file($delete_files_txt) === true && is_file($delete_files_txt) === true
&& is_dir($file) === false
) { ) {
unlink($file); unlink($file);
$processed[$file] = 'removed'; $processed[$file] = 'removed';
@ -1674,7 +1675,7 @@ class Client
); );
$this->updateMR( $this->updateMR(
$this->extract_to.'/extras/mr/'.$mr, $extract_to.'/extras/mr/'.$mr,
$this->dbhHistory, $this->dbhHistory,
$historical_MR $historical_MR
); );

View File

@ -183,7 +183,7 @@ class ClientTest extends \PHPUnit\Framework\TestCase
try { try {
$this->conf = new \Config('client/conf/test.ini'); $this->conf = new \Config('client/conf/test.ini');
} catch (\Exception $e) { } catch (\Exception $e) {
$this->fail($e->xdebug_message); $this->fail($e->getMessage());
} }
// Verify endpoint has all needed stuff, like licenses and OUM packages. // Verify endpoint has all needed stuff, like licenses and OUM packages.
@ -510,7 +510,12 @@ class ClientTest extends \PHPUnit\Framework\TestCase
$this->assertEquals(0, $umc_enterprise->getMR()); $this->assertEquals(0, $umc_enterprise->getMR());
try {
$umc_enterprise->updateLastVersion(); $umc_enterprise->updateLastVersion();
} catch (\Exception $e) {
echo $e->getTraceAsString();
$this->fail('Failed while updating: '.$e->getMessage());
}
$this->assertEquals( $this->assertEquals(
4, 4,

View File

@ -1,17 +1,28 @@
<?php <?php
/**
* * Configure profiles.
*
* @category Profiles
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
*
* Pandora FMS - http://pandorafms.com
* ==================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
// Pandora FMS - http://pandorafms.com // Global variables.
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation 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.
// Global variables
global $config; global $config;
check_login(); check_login();
@ -32,7 +43,7 @@ enterprise_include_once('meta/include/functions_users_meta.php');
$tab = get_parameter('tab', 'profile'); $tab = get_parameter('tab', 'profile');
$pure = get_parameter('pure', 0); $pure = get_parameter('pure', 0);
// Header // Header.
if (!is_metaconsole()) { if (!is_metaconsole()) {
$buttons = [ $buttons = [
'user' => [ 'user' => [
@ -79,50 +90,55 @@ if (!is_metaconsole()) {
$new_profile = (bool) get_parameter('new_profile'); $new_profile = (bool) get_parameter('new_profile');
$id_profile = (int) get_parameter('id'); $id_profile = (int) get_parameter('id');
// Edit profile // Edit profile.
if ($id_profile || $new_profile) { if ($id_profile || $new_profile) {
if ($new_profile) { if ($new_profile) {
// Name // Name.
$name = ''; $name = '';
// Agents // Agents.
$agent_view = 0; $agent_view = 0;
$agent_edit = 0; $agent_edit = 0;
$agent_disable = 0; $agent_disable = 0;
// Alerts // Alerts.
$alert_edit = 0; $alert_edit = 0;
$alert_management = 0; $alert_management = 0;
// Users // Users.
$user_management = 0; $user_management = 0;
// DB // DB.
$db_management = 0; $db_management = 0;
// Pandora // Pandora.
$pandora_management = 0; $pandora_management = 0;
// Events // Events.
$event_view = 0; $event_view = 0;
$event_edit = 0; $event_edit = 0;
$event_management = 0; $event_management = 0;
// Reports // Reports.
$report_view = 0; $report_view = 0;
$report_edit = 0; $report_edit = 0;
$report_management = 0; $report_management = 0;
// Network maps // Network maps.
$map_view = 0; $map_view = 0;
$map_edit = 0; $map_edit = 0;
$map_management = 0; $map_management = 0;
// Visual console // Visual console.
$vconsole_view = 0; $vconsole_view = 0;
$vconsole_edit = 0; $vconsole_edit = 0;
$vconsole_management = 0; $vconsole_management = 0;
// NCM.
$network_config_view = 0;
$network_config_edit = 0;
$network_config_management = 0;
$page_title = __('Create profile'); $page_title = __('Create profile');
} else { } else {
$profile = db_get_row('tperfil', 'id_perfil', $id_profile); $profile = db_get_row('tperfil', 'id_perfil', $id_profile);
@ -140,54 +156,82 @@ if ($id_profile || $new_profile) {
exit; exit;
} }
// Name // Name.
$name = $profile['name']; $name = $profile['name'];
// Agents // Agents.
$agent_view = (bool) $profile['agent_view']; $agent_view = (bool) $profile['agent_view'];
$agent_edit = (bool) $profile['agent_edit']; $agent_edit = (bool) $profile['agent_edit'];
$agent_disable = (bool) $profile['agent_disable']; $agent_disable = (bool) $profile['agent_disable'];
// Alerts // Alerts.
$alert_edit = (bool) $profile['alert_edit']; $alert_edit = (bool) $profile['alert_edit'];
$alert_management = (bool) $profile['alert_management']; $alert_management = (bool) $profile['alert_management'];
// Users // Users.
$user_management = (bool) $profile['user_management']; $user_management = (bool) $profile['user_management'];
// DB // DB.
$db_management = (bool) $profile['db_management']; $db_management = (bool) $profile['db_management'];
// Pandora // Pandora.
$pandora_management = (bool) $profile['pandora_management']; $pandora_management = (bool) $profile['pandora_management'];
// Events // Events.
$event_view = (bool) $profile['event_view']; $event_view = (bool) $profile['event_view'];
$event_edit = (bool) $profile['event_edit']; $event_edit = (bool) $profile['event_edit'];
$event_management = (bool) $profile['event_management']; $event_management = (bool) $profile['event_management'];
// Reports // Reports.
$report_view = (bool) $profile['report_view']; $report_view = (bool) $profile['report_view'];
$report_edit = (bool) $profile['report_edit']; $report_edit = (bool) $profile['report_edit'];
$report_management = (bool) $profile['report_management']; $report_management = (bool) $profile['report_management'];
// Network maps // Network maps.
$map_view = (bool) $profile['map_view']; $map_view = (bool) $profile['map_view'];
$map_edit = (bool) $profile['map_edit']; $map_edit = (bool) $profile['map_edit'];
$map_management = (bool) $profile['map_management']; $map_management = (bool) $profile['map_management'];
// Visual console // Visual console.
$vconsole_view = (bool) $profile['vconsole_view']; $vconsole_view = (bool) $profile['vconsole_view'];
$vconsole_edit = (bool) $profile['vconsole_edit']; $vconsole_edit = (bool) $profile['vconsole_edit'];
$vconsole_management = (bool) $profile['vconsole_management']; $vconsole_management = (bool) $profile['vconsole_management'];
// NCM.
$network_config_management = (bool) $profile['network_config_management'];
$network_config_view = (bool) $profile['network_config_view'] || $network_config_management;
$network_config_edit = (bool) $profile['network_config_edit'] || $network_config_management;
$id_audit = db_pandora_audit( $id_audit = db_pandora_audit(
'User management', 'User management',
'Edit profile '.io_safe_output($name) 'Edit profile '.io_safe_output($name)
); );
enterprise_include_once('include/functions_audit.php'); enterprise_include_once('include/functions_audit.php');
$info = 'Name: '.$name.' Agent view: '.$agent_view.' Agent edit: '.$agent_edit.' Agent disable: '.$agent_disable.' Alert edit: '.$alert_edit.' Alert management: '.$alert_management.' User management: '.$user_management.' DB management: '.$db_management.' Event view: '.$event_view.' Event edit: '.$event_edit.' Event management: '.$event_management.' Report view: '.$report_view.' Report edit: '.$report_edit.' Report management: '.$report_management.' Network map view: '.$map_view.' Network map edit: '.$map_edit.' Network map management: '.$map_management.' Visual console view: '.$vconsole_view.' Visual console edit: '.$vconsole_edit.' Visual console management: '.$vconsole_management.' '.get_product_name().' Management: '.$pandora_management; $info = 'Name: '.$name;
$info .= ' Agent view: '.$agent_view;
$info .= ' Agent edit: '.$agent_edit;
$info .= ' Agent disable: '.$agent_disable;
$info .= ' Alert edit: '.$alert_edit;
$info .= ' Alert management: '.$alert_management;
$info .= ' User management: '.$user_management;
$info .= ' DB management: '.$db_management;
$info .= ' Event view: '.$event_view;
$info .= ' Event edit: '.$event_edit;
$info .= ' Event management: '.$event_management;
$info .= ' Report view: '.$report_view;
$info .= ' Report edit: '.$report_edit;
$info .= ' Report management: '.$report_management;
$info .= ' Network map view: '.$map_view;
$info .= ' Network map edit: '.$map_edit;
$info .= ' Network map management: '.$map_management;
$info .= ' Visual console view: '.$vconsole_view;
$info .= ' Visual console edit: '.$vconsole_edit;
$info .= ' Visual console management: '.$vconsole_management;
$info .= ' Network config view: '.$network_config_view;
$info .= ' Network config write: '.$network_config_write;
$info .= ' Network config management: '.$network_config_management;
$info .= ' '.get_product_name().' Management: '.$pandora_management;
enterprise_hook('audit_pandora_enterprise', [$id_audit, $info]); enterprise_hook('audit_pandora_enterprise', [$id_audit, $info]);
@ -216,14 +260,14 @@ if ($id_profile || $new_profile) {
$table->style[0] = 'font-weight: bold'; $table->style[0] = 'font-weight: bold';
$table->data = []; $table->data = [];
// Name // Name.
$row = []; $row = [];
$row['name'] = __('Profile name'); $row['name'] = __('Profile name');
$row['input'] = html_print_input_text('name', $name, '', 30, 60, true); $row['input'] = html_print_input_text('name', $name, '', 30, 60, true);
$table->data['name'] = $row; $table->data['name'] = $row;
$table->data[] = '<hr>'; $table->data[] = '<hr>';
// Agents // Agents.
$row = []; $row = [];
$row['name'] = __('View agents'); $row['name'] = __('View agents');
$row['input'] = html_print_checkbox('agent_view', 1, $agent_view, true); $row['input'] = html_print_checkbox('agent_view', 1, $agent_view, true);
@ -238,7 +282,7 @@ if ($id_profile || $new_profile) {
$table->data['AW'] = $row; $table->data['AW'] = $row;
$table->data[] = '<hr>'; $table->data[] = '<hr>';
// Alerts // Alerts.
$row = []; $row = [];
$row['name'] = __('Edit alerts'); $row['name'] = __('Edit alerts');
$row['input'] = html_print_checkbox('alert_edit', 1, $alert_edit, true); $row['input'] = html_print_checkbox('alert_edit', 1, $alert_edit, true);
@ -249,7 +293,7 @@ if ($id_profile || $new_profile) {
$table->data['LM'] = $row; $table->data['LM'] = $row;
$table->data[] = '<hr>'; $table->data[] = '<hr>';
// Events // Events.
$row = []; $row = [];
$row['name'] = __('View events'); $row['name'] = __('View events');
$row['input'] = html_print_checkbox('event_view', 1, $event_view, true); $row['input'] = html_print_checkbox('event_view', 1, $event_view, true);
@ -264,7 +308,7 @@ if ($id_profile || $new_profile) {
$table->data['EM'] = $row; $table->data['EM'] = $row;
$table->data[] = '<hr>'; $table->data[] = '<hr>';
// Reports // Reports.
$row = []; $row = [];
$row['name'] = __('View reports'); $row['name'] = __('View reports');
$row['input'] = html_print_checkbox('report_view', 1, $report_view, true); $row['input'] = html_print_checkbox('report_view', 1, $report_view, true);
@ -279,7 +323,7 @@ if ($id_profile || $new_profile) {
$table->data['RM'] = $row; $table->data['RM'] = $row;
$table->data[] = '<hr>'; $table->data[] = '<hr>';
// Network maps // Network maps.
$row = []; $row = [];
$row['name'] = __('View network maps'); $row['name'] = __('View network maps');
$row['input'] = html_print_checkbox('map_view', 1, $map_view, true); $row['input'] = html_print_checkbox('map_view', 1, $map_view, true);
@ -294,7 +338,7 @@ if ($id_profile || $new_profile) {
$table->data['MM'] = $row; $table->data['MM'] = $row;
$table->data[] = '<hr>'; $table->data[] = '<hr>';
// Visual console // Visual console.
$row = []; $row = [];
$row['name'] = __('View visual console'); $row['name'] = __('View visual console');
$row['input'] = html_print_checkbox('vconsole_view', 1, $vconsole_view, true); $row['input'] = html_print_checkbox('vconsole_view', 1, $vconsole_view, true);
@ -314,21 +358,36 @@ if ($id_profile || $new_profile) {
$disable_option = ''; $disable_option = '';
} }
// Users // NCM.
$row = [];
$row['name'] = __('View NCM data');
$row['input'] = html_print_checkbox('network_config_view', 1, $network_config_view, true);
$table->data['NR'] = $row;
$row = [];
$row['name'] = __('Operate NCM');
$row['input'] = html_print_checkbox('network_config_edit', 1, $network_config_edit, true, false, 'autoclick_profile_users(\'network_config_edit\', \'network_config_view\', \'false\')');
$table->data['NW'] = $row;
$row = [];
$row['name'] = __('Manage NCM');
$row['input'] = html_print_checkbox('network_config_management', 1, $network_config_management, true, false, 'autoclick_profile_users(\'network_config_management\', \'network_config_view\', \'network_config_edit\')');
$table->data['NM'] = $row;
$table->data[] = '<hr>';
// Users.
$row = []; $row = [];
$row['name'] = __('Manage users'); $row['name'] = __('Manage users');
$row['input'] = html_print_checkbox('user_management', 1, $user_management, true, false, $disable_option); $row['input'] = html_print_checkbox('user_management', 1, $user_management, true, false, $disable_option);
$table->data['UM'] = $row; $table->data['UM'] = $row;
$table->data[] = '<hr>'; $table->data[] = '<hr>';
// DB // DB.
$row = []; $row = [];
$row['name'] = __('Manage database'); $row['name'] = __('Manage database');
$row['input'] = html_print_checkbox('db_management', 1, $db_management, true, false, $disable_option); $row['input'] = html_print_checkbox('db_management', 1, $db_management, true, false, $disable_option);
$table->data['DM'] = $row; $table->data['DM'] = $row;
$table->data[] = '<hr>'; $table->data[] = '<hr>';
// Pandora // Pandora.
$row = []; $row = [];
$row['name'] = __('%s management', get_product_name()); $row['name'] = __('%s management', get_product_name());
$row['input'] = html_print_checkbox('pandora_management', 1, $pandora_management, true, false, $disable_option); $row['input'] = html_print_checkbox('pandora_management', 1, $pandora_management, true, false, $disable_option);

View File

@ -140,7 +140,9 @@ if (is_ajax()) {
$has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id2); $has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id2);
if ($has_profile == false) { $user_is_global_admin = users_is_admin($id2);
if ($has_profile === false && $user_is_global_admin === false) {
$result = delete_user($id2); $result = delete_user($id2);
if ($result) { if ($result) {
@ -1321,6 +1323,8 @@ if (isset($double_authentication)) {
if ($meta) { if ($meta) {
enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once('include/functions_metaconsole.php');
$access_node = db_get_value('metaconsole_access_node', 'tusuario', 'id_user', $id);
$metaconsole_agents_manager = '<div class="label_select_simple" id="metaconsole_agents_manager_div"><p class="edit_user_labels">'.__('Enable agents managment').'</p>'; $metaconsole_agents_manager = '<div class="label_select_simple" id="metaconsole_agents_manager_div"><p class="edit_user_labels">'.__('Enable agents managment').'</p>';
$metaconsole_agents_manager .= html_print_checkbox_switch( $metaconsole_agents_manager .= html_print_checkbox_switch(
'metaconsole_agents_manager', 'metaconsole_agents_manager',
@ -1342,7 +1346,7 @@ if ($meta) {
$metaconsole_access_node .= html_print_checkbox( $metaconsole_access_node .= html_print_checkbox(
'metaconsole_access_node', 'metaconsole_access_node',
1, 1,
$user_info['metaconsole_access_node'], $access_node,
true true
).'</div>'; ).'</div>';
} }
@ -1542,6 +1546,7 @@ $(document).ready (function () {
var img_delete = '<?php echo $delete_image; ?>'; var img_delete = '<?php echo $delete_image; ?>';
var id_user = '<?php echo io_safe_output($id); ?>'; var id_user = '<?php echo io_safe_output($id); ?>';
var is_metaconsole = '<?php echo $meta; ?>'; var is_metaconsole = '<?php echo $meta; ?>';
var user_is_global_admin = '<?php echo users_is_admin($id); ?>';
var data = []; var data = [];
$('input:image[name="add"]').click(function (e) { $('input:image[name="add"]').click(function (e) {
@ -1586,7 +1591,7 @@ $(document).ready (function () {
$('input:image[name="del"]').click(function (e) { $('input:image[name="del"]').click(function (e) {
e.preventDefault(); e.preventDefault();
var rows = $("#table_profiles tr").length; var rows = $("#table_profiles tr").length;
if ((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) { if (((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
if (!confirm('<?php echo __('Deleting last profile will delete this user'); ?>' + '. ' + '<?php echo __('Are you sure?'); ?>')) { if (!confirm('<?php echo __('Deleting last profile will delete this user'); ?>' + '. ' + '<?php echo __('Are you sure?'); ?>')) {
return; return;
} }
@ -1608,8 +1613,11 @@ $(document).ready (function () {
success: function (data) { success: function (data) {
row.remove(); row.remove();
var rows = $("#table_profiles tr").length; var rows = $("#table_profiles tr").length;
if ((is_metaconsole === '1' && rows <= 3) || (is_metaconsole === '' && rows <= 2)) {
if (is_metaconsole === '' && rows <= 2 && user_is_global_admin !== '1') {
window.location.replace("<?php echo ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0', false, false, false); ?>"); window.location.replace("<?php echo ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0', false, false, false); ?>");
} else if (is_metaconsole === '1' && rows <= 3 && user_is_global_admin !== '1') {
window.location.replace("<?php echo ui_get_full_url('index.php?sec=advanced&sec2=advanced/users_setup', false, false, true); ?>");
} }
} }
}); });
@ -1748,7 +1756,6 @@ function show_double_auth_info () {
var $dialogContainer = $("div#dialog-double_auth-container"); var $dialogContainer = $("div#dialog-double_auth-container");
$dialogContainer.html($loadingSpinner); $dialogContainer.html($loadingSpinner);
console.log(userID);
// Load the info page // Load the info page
var request = $.ajax({ var request = $.ajax({
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>", url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
@ -1913,7 +1920,6 @@ function show_double_auth_deactivation () {
}, },
success: function(data, textStatus, xhr) { success: function(data, textStatus, xhr) {
console.log(data);
if (data === -1) { if (data === -1) {
$dialogContainer.html("<?php echo '<b><div class=\"red\">'.__('Authentication error').'</div></b>'; ?>"); $dialogContainer.html("<?php echo '<b><div class=\"red\">'.__('Authentication error').'</div></b>'; ?>");
} }

View File

@ -178,6 +178,11 @@ if ($is_management_allowed === true && ($create_profile === true || $update_prof
$vconsole_edit = (bool) get_parameter('vconsole_edit'); $vconsole_edit = (bool) get_parameter('vconsole_edit');
$vconsole_management = (bool) get_parameter('vconsole_management'); $vconsole_management = (bool) get_parameter('vconsole_management');
// NCM.
$network_config_view = (bool) get_parameter('network_config_view');
$network_config_edit = (bool) get_parameter('network_config_edit');
$network_config_management = (bool) get_parameter('network_config_management');
$values = [ $values = [
'name' => $name, 'name' => $name,
'agent_view' => $agent_view, 'agent_view' => $agent_view,
@ -199,6 +204,9 @@ if ($is_management_allowed === true && ($create_profile === true || $update_prof
'vconsole_view' => $vconsole_view, 'vconsole_view' => $vconsole_view,
'vconsole_edit' => $vconsole_edit, 'vconsole_edit' => $vconsole_edit,
'vconsole_management' => $vconsole_management, 'vconsole_management' => $vconsole_management,
'network_config_view' => $network_config_view,
'network_config_edit' => $network_config_edit,
'network_config_management' => $network_config_management,
'pandora_management' => $pandora_management, 'pandora_management' => $pandora_management,
]; ];
} }
@ -228,6 +236,9 @@ if ($is_management_allowed === true && $update_profile === true) {
"Visual console view":"'.$vconsole_view.'", "Visual console view":"'.$vconsole_view.'",
"Visual console edit":"'.$vconsole_edit.'", "Visual console edit":"'.$vconsole_edit.'",
"Visual console management":"'.$vconsole_management.'", "Visual console management":"'.$vconsole_management.'",
"NCM view":"'.$network_config_view.'",
"NCM edit":"'.$network_config_edit.'",
"NCM management":"'.$network_config_management.'",
"'.get_product_name().' Management":"'.$pandora_management.'"}'; "'.get_product_name().' Management":"'.$pandora_management.'"}';
db_pandora_audit( db_pandora_audit(
@ -276,6 +287,9 @@ if ($is_management_allowed === true && $create_profile === true) {
"Visual console view":"'.$vconsole_view.'", "Visual console view":"'.$vconsole_view.'",
"Visual console edit":"'.$vconsole_edit.'", "Visual console edit":"'.$vconsole_edit.'",
"Visual console management":"'.$vconsole_management.'", "Visual console management":"'.$vconsole_management.'",
"NCM view":"'.$network_config_view.'",
"NCM edit":"'.$network_config_edit.'",
"NCM management":"'.$network_config_management.'",
"'.get_product_name().' Management":"'.$pandora_management.'"}'; "'.get_product_name().' Management":"'.$pandora_management.'"}';
db_pandora_audit( db_pandora_audit(
@ -327,6 +341,9 @@ $table->head['MM'] = 'MM';
$table->head['VR'] = 'VR'; $table->head['VR'] = 'VR';
$table->head['VW'] = 'VW'; $table->head['VW'] = 'VW';
$table->head['VM'] = 'VM'; $table->head['VM'] = 'VM';
$table->head['NR'] = 'NR';
$table->head['NW'] = 'NW';
$table->head['NM'] = 'NM';
$table->head['PM'] = 'PM'; $table->head['PM'] = 'PM';
if ($is_management_allowed === true) { if ($is_management_allowed === true) {
$table->head['operations'] = '<span title="Operations">'.__('Op.').'</span>'; $table->head['operations'] = '<span title="Operations">'.__('Op.').'</span>';
@ -354,6 +371,9 @@ $table->size['MM'] = '10px';
$table->size['VR'] = '10px'; $table->size['VR'] = '10px';
$table->size['VW'] = '10px'; $table->size['VW'] = '10px';
$table->size['VM'] = '10px'; $table->size['VM'] = '10px';
$table->size['NR'] = '10px';
$table->size['NW'] = '10px';
$table->size['NM'] = '10px';
$table->size['PM'] = '10px'; $table->size['PM'] = '10px';
if ($is_management_allowed === true) { if ($is_management_allowed === true) {
$table->size['operations'] = '5%'; $table->size['operations'] = '5%';
@ -401,6 +421,9 @@ foreach ($profiles as $profile) {
$data['VR'] = (empty($profile['vconsole_view']) === false) ? $img : ''; $data['VR'] = (empty($profile['vconsole_view']) === false) ? $img : '';
$data['VW'] = (empty($profile['vconsole_edit']) === false) ? $img : ''; $data['VW'] = (empty($profile['vconsole_edit']) === false) ? $img : '';
$data['VM'] = (empty($profile['vconsole_management']) === false) ? $img : ''; $data['VM'] = (empty($profile['vconsole_management']) === false) ? $img : '';
$data['NR'] = (empty($profile['network_config_view']) === false) ? $img : '';
$data['NW'] = (empty($profile['network_config_edit']) === false) ? $img : '';
$data['NM'] = (empty($profile['network_config_management']) === false) ? $img : '';
$data['PM'] = (empty($profile['pandora_management']) === false) ? $img : ''; $data['PM'] = (empty($profile['pandora_management']) === false) ? $img : '';
$table->cellclass[]['operations'] = 'action_buttons'; $table->cellclass[]['operations'] = 'action_buttons';
if ($is_management_allowed === true) { if ($is_management_allowed === true) {

View File

@ -178,7 +178,8 @@ class DiscoveryTaskList extends HTML
'attributes' => 'class="sub cancel"', 'attributes' => 'class="sub cancel"',
'return' => true, 'return' => true,
], ],
],[ ],
[
'class' => 'action-buttons rule-builder-actions', 'class' => 'action-buttons rule-builder-actions',
'arguments' => [ 'arguments' => [
'name' => 'refresh', 'name' => 'refresh',

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="748px" height="142px" viewBox="0 0 748 142" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Integria IMS</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Integria-IMS" fill-rule="nonzero">
<path d="M71.81,-2.81979301e-15 C43.0949491,-0.325771451 17.0111429,16.6781107 5.72147618,43.0827259 C-5.56819051,69.4873411 0.159601761,100.092722 20.23398,120.627561 C40.3083582,141.1624 70.7759943,147.582689 97.4298109,136.894643 C124.083628,126.206596 141.674581,100.515055 142,71.8 C142.444347,32.5906412 111.019353,0.444829018 71.81,-2.81979301e-15 Z" id="Path" fill="#F65803"></path>
<circle id="Oval" fill="#FFFFFF" cx="43.51" cy="49.89" r="13.76"></circle>
<path d="M43.51,71.66 L43.26,71.66 C41.5736669,71.6393594 39.8955597,71.4212055 38.26,71.01 L38,98.36 C37.9839995,99.6878244 38.4968596,100.967474 39.4254669,101.916717 C40.3540742,102.86596 41.6221446,103.406817 42.95,103.42 L43,103.42 C44.3260824,103.42 45.597852,102.893216 46.5355339,101.955534 C47.4732158,101.017852 48,99.7460824 48,98.42 L48.31,71.06 C46.7379912,71.4417108 45.1275989,71.6430099 43.51,71.66 L43.51,71.66 Z" id="Path" fill="#FFFFFF"></path>
<path d="M94.41,48.12 C88.3631135,41.9016532 80.0832535,38.3557132 71.41,38.27 C68.4333361,38.2395201 65.4662912,38.6129237 62.59,39.38 C64.2200628,42.3331841 65.1313519,45.6288987 65.25,49 C67.208565,48.4885287 69.2257979,48.2363746 71.25,48.25 C77.2810939,48.3159047 83.0384799,50.7772152 87.2533639,55.0915157 C91.468248,59.4058163 93.7946914,65.2190086 93.72,71.25 L93.42,99 C93.4039912,100.326111 93.9154828,101.604257 94.841933,102.553212 C95.7683831,103.502167 97.0338871,104.044182 98.36,104.06 L98.42,104.06 C101.181424,104.06 103.42,101.821424 103.42,99.06 L103.74,71.33 C103.850133,62.6586006 100.491174,54.3026057 94.41,48.12 Z" id="Path" fill="#FFFFFF"></path>
<path d="M171.72,67.81 L171.84,21.08 C171.8139,20.1443474 172.175822,19.2395415 172.84,18.58 C173.507689,17.9157505 174.418525,17.5543075 175.36,17.58 L182.36,17.58 C183.315282,17.5557708 184.239991,17.9176872 184.925039,18.583915 C185.610086,19.2501428 185.997615,20.1644142 186,21.12 L185.88,67.77 C185.889979,68.7136623 185.501469,69.6177631 184.81,70.26 C184.132306,70.9151221 183.222463,71.2747439 182.28,71.26 L175.28,71.26 C174.343006,71.2771853 173.438469,70.9168123 172.77,70.26 C172.079224,69.6357031 171.69568,68.7407667 171.72,67.81 L171.72,67.81 Z" id="Path" fill="#282828"></path>
<path d="M196.6,67.79 L196.72,21.15 C196.703942,20.2132116 197.064148,19.3090953 197.72,18.64 C198.367817,17.9706027 199.269041,17.6072059 200.2,17.64 L211.2,17.64 C212.220464,17.6786713 213.201721,18.0431383 214,18.68 C214.954333,19.3581671 215.769164,20.2137401 216.4,21.2 L238.94,56.06 L239,21.18 C238.972558,20.2529263 239.335335,19.3568684 240,18.71 C240.660878,18.0478442 241.564774,17.6862858 242.5,17.71 L249,17.71 C249.930306,17.697074 250.827049,18.0572118 251.49,18.71 C252.168239,19.3808021 252.531442,20.3069699 252.49,21.26 L252.37,67.91 C252.393322,68.8422107 252.031614,69.7428638 251.37,70.4 C250.707806,71.0601595 249.804802,71.4213611 248.87,71.4 L236.43,71.4 C235.352189,71.3759533 234.306677,71.0274494 233.43,70.4 C232.448952,69.7519451 231.61994,68.8990519 231,67.9 L210.36,35.7 L210.28,67.85 C210.302135,68.7819962 209.940608,69.6821976 209.28,70.34 C208.624212,71.0036445 207.722642,71.3657208 206.79,71.34 L200.2,71.34 C199.262799,71.3583203 198.357839,70.9977785 197.69,70.34 C196.973178,69.6889199 196.575278,68.758054 196.6,67.79 Z" id="Path" fill="#282828"></path>
<path d="M258.64,24.83 L258.64,21.31 C258.611761,20.3566005 258.979489,19.4340518 259.655831,18.7614981 C260.332174,18.0889444 261.256774,17.7264056 262.21,17.76 L309.75,17.88 C310.703399,17.8517613 311.625948,18.2194887 312.298502,18.8958315 C312.971056,19.5721742 313.333594,20.4967742 313.3,21.45 L313.3,25 C313.332066,25.9455402 312.969867,26.8619037 312.3,27.53 C311.623087,28.1989008 310.701164,28.5604392 309.75,28.53 L293.04,28.53 L292.93,68.21 C292.958015,69.1313139 292.594703,70.0214284 291.93,70.66 C291.264603,71.3152777 290.363755,71.675617 289.43,71.6604873 L282.35,71.6604873 C281.420522,71.668505 280.52541,71.3090224 279.86,70.66 C279.197933,70.0155113 278.835379,69.1236302 278.86,68.2 L278.96,28.52 L262.25,28.52 C261.299851,28.544612 260.38013,28.1839373 259.7,27.52 C258.965201,26.8249172 258.576895,25.8394983 258.64,24.83 L258.64,24.83 Z" id="Path" fill="#282828"></path>
<path d="M319.3,68 L319.42,21.35 C319.400371,20.4122847 319.78681,19.5118088 320.48,18.88 C321.149716,18.2251023 322.053417,17.8650622 322.99,17.8795531 L366.19,17.99 C367.130438,17.9859488 368.031045,18.3693397 368.68,19.05 C369.337779,19.717839 369.69832,20.6227989 369.68,21.56 L369.68,25.09 C369.677352,26.0235632 369.303953,26.9178376 368.641949,27.5760911 C367.979945,28.2343446 367.083563,28.6026559 366.15,28.6 L333.52,28.51 L333.52,39.42 L361.62,39.49 C362.553563,39.4926484 363.447838,39.8660468 364.106091,40.528051 C364.764345,41.1900553 365.132656,42.0864368 365.13,43.02 L365.13,46.54 C365.156933,47.4728584 364.79467,48.3748937 364.13,49.03 C363.469788,49.6931635 362.565439,50.054903 361.63,50.03 L333.47,50 L333.47,61.06 L366.03,61.14 C366.94651,61.1221856 367.829599,61.4841076 368.47,62.14 C369.129526,62.7903112 369.491355,63.6840288 369.47,64.61 L369.47,68.21 C369.482675,69.150132 369.102026,70.0528141 368.42,70.7 C367.748458,71.3583482 366.840234,71.7187547 365.9,71.7 L322.9,71.59 C321.962384,71.6106136 321.056564,71.2497292 320.39,70.59 C319.672391,69.9226941 319.2755,68.9796223 319.3,68 L319.3,68 Z" id="Path" fill="#282828"></path>
<path d="M380.06,65.38 C375.64,60.9 373.44,54.0566667 373.459865,44.85 C373.48,35.6433333 375.813333,28.83 380.46,24.41 C385.126667,19.99 392.08,17.7933333 401.32,17.82 L409.68,17.82 C414.926078,17.759622 420.087688,19.1434315 424.6,21.82 C429.026667,24.4866667 431.233333,27.7833333 431.22,31.71 C431.335739,32.9177383 430.840442,34.1034513 429.9,34.87 C429.175254,35.4543658 428.280429,35.7877321 427.35,35.82 L422.9,35.82 C420.76,35.82 419.053333,34.59 417.78,32.13 C416.506667,29.67 413.363333,28.44 408.35,28.44 L401.68,28.44 C396.206667,28.44 392.493333,29.6033333 390.54,31.93 C388.54,34.28 387.6,38.59 387.54,44.93 C387.48,51.27 388.38,55.58 390.13,57.99 C391.88,60.4 394.99,61.62 399.48,61.63 L407.17,61.63 C411.17,61.63 414.043333,60.87 415.79,59.35 C417.596876,57.6376908 418.574219,55.2271554 418.47,52.74 L410,52.74 C409.064789,52.7427064 408.167392,52.3710205 407.507977,51.7078475 C406.848561,51.0446746 406.48198,50.1451807 406.49,49.21 L406.49,46.23 C406.472533,45.2988546 406.833351,44.400416 407.49,43.74 C408.146465,43.0773742 409.047574,42.7154829 409.98,42.74 L428.79,42.79 C429.722858,42.763067 430.624894,43.1253302 431.28,43.79 C431.943164,44.4502124 432.304903,45.354561 432.28,46.29 L432.28,50.44 C432.28,57.44 430.17,62.8133333 425.95,66.56 C421.73,70.3066667 415.566667,72.17 407.46,72.1501593 L399.03,72.1501593 C390.803333,72.1233333 384.48,69.8666667 380.06,65.38 Z" id="Path" fill="#282828"></path>
<path d="M495.8,70.48 C495.8,71.55 495.16,72.09 493.89,72.0801364 L484.89,72.0801364 C483.778533,72.0359158 482.700008,71.6902348 481.77,71.08 C480.713597,70.4696085 479.821334,69.6116631 479.17,68.58 L472.83,58.58 C470.223333,54.48 467.056667,52.4233333 463.33,52.41 L454.18,52.41 L454.18,68.52 C454.203322,69.4522107 453.841614,70.3528638 453.18,71.01 C452.517806,71.6701595 451.614802,72.0313611 450.68,72.01 L443.68,72.01 C442.743006,72.0271853 441.838469,71.6668123 441.17,71.01 C440.503774,70.351816 440.141481,69.446082 440.17,68.51 L440.29,21.86 C440.269803,20.9254087 440.630829,20.0228444 441.29,19.36 C441.927395,18.6758743 442.825092,18.2942622 443.76,18.3095318 L474.67,18.39 C480.39,18.39 485.076667,19.94 488.73,23.04 C492.383333,26.14 494.203333,30.29 494.19,35.49 C494.063333,42.7033333 489.3,47.2066667 479.9,49 C481.484067,49.6135252 482.904514,50.5855906 484.05,51.84 C485.674847,53.654962 487.137133,55.6091383 488.42,57.68 L495.21,68.52 C495.577221,69.1093518 495.780866,69.7858671 495.8,70.48 L495.8,70.48 Z M454.21,41.74 L470.21,41.74 C472.559199,41.8094724 474.88989,41.3048899 477,40.27 C478.881403,39.380915 480.044647,37.4487472 479.95,35.37 C480.055656,33.2834473 478.890265,31.3398116 477,30.45 C474.897868,29.3847581 472.566149,28.8524806 470.21,28.9 L454.21,28.9 L454.21,41.74 Z" id="Shape" fill="#282828"></path>
<path d="M502,68.66 L502.12,21.93 C502.106969,20.9868821 502.48745,20.0809738 503.17,19.43 C503.826139,18.7489431 504.734359,18.3690106 505.68,18.3797664 L512.68,18.3797664 C513.640691,18.3689866 514.564824,18.7478276 515.241347,19.4300041 C515.91787,20.1121806 516.289008,21.039434 516.27,22 L516.15,68.65 C516.159979,69.5936623 515.771469,70.4977631 515.08,71.14 C514.402306,71.7951221 513.492463,72.1547439 512.55,72.14 L505.55,72.14 C504.613006,72.1571853 503.708469,71.7968123 503.04,71.14 C502.344797,70.5069922 501.964251,69.5995358 502,68.66 Z" id="Path" fill="#282828"></path>
<path d="M522.48,68.71 L532,33.06 C534.566667,23.3466667 542.87,18.5 556.91,18.5199384 L577.11,18.57 C577.996001,18.5541891 578.841559,18.9402048 579.41,19.62 C580.006346,20.2917863 580.330809,21.1617749 580.320262,22.06 L580.2,68.86 C580.23056,69.7817714 579.866841,70.6728823 579.2,71.31 C578.525984,71.9645342 577.619419,72.3242822 576.68,72.31 L569.68,72.31 C568.735914,72.3337643 567.822711,71.9728143 567.15,71.31 C566.480133,70.6419037 566.117934,69.7255402 566.15,68.78 L566.15,59.33 L539.51,59.27 L536.98,68.7 C536.727496,69.7139708 536.129991,70.6084614 535.29,71.23 C534.499985,71.8626048 533.521963,72.214411 532.51,72.23 L525.13,72.23 C524.459988,72.2878818 523.794912,72.0733836 523.284971,71.6349475 C522.775031,71.1965113 522.463235,70.571116 522.42,69.9 C522.400467,69.5023251 522.420566,69.1036934 522.48,68.71 Z M542.24,48.64 L566.11,48.7 L566.11,29.14 L555.43,29.14 C550.779549,29.0158892 546.663838,32.130706 545.52,36.64 L542.24,48.64 Z" id="Shape" fill="#282828"></path>
<path d="M590.9,68.88 L591,22.16 C590.986969,21.2168821 591.36745,20.3109738 592.05,19.66 C592.709218,18.9774003 593.621131,18.5974368 594.57,18.6096981 L601.57,18.6096981 C602.520183,18.6019547 603.433929,18.9751711 604.106773,19.6461353 C604.779617,20.3170996 605.155387,21.2297986 605.150057,22.18 L605,68.85 C605.028154,69.7830757 604.665702,70.6855811 604,71.34 C603.323524,71.9970099 602.412865,72.3569544 601.47,72.34 L594.47,72.34 C593.533006,72.3571853 592.628469,71.9968123 591.96,71.34 C591.263951,70.7144482 590.876621,69.8155493 590.9,68.88 Z" id="Path" fill="#F65803"></path>
<path d="M615.78,68.8 L615.9,22.3 C615.875203,21.340928 616.235317,20.4118317 616.9,19.72 C617.547817,19.0506027 618.449041,18.6872059 619.38,18.72 L634.63,18.72 C635.64758,18.7359883 636.627509,19.1074416 637.4,19.77 C638.233003,20.4058524 638.845164,21.2873645 639.15,22.29 L650.15,54.29 L661.29,22.29 C661.608719,21.2943995 662.226826,20.4213666 663.06,19.79 C663.836411,19.140258 664.817595,18.7860398 665.83,18.79 L681.08,18.79 C682.009485,18.7723021 682.901791,19.1547191 683.53,19.84 C684.192419,20.5373141 684.551934,21.4684571 684.53,22.43 L684.38,69 C684.412024,69.9543928 684.050454,70.8800124 683.38,71.56 C682.723535,72.2226258 681.822426,72.5845171 680.89,72.56 L674.1,72.56 C673.168855,72.5774675 672.270416,72.2166488 671.61,71.56 C670.941001,70.8749956 670.579921,69.9470191 670.61,68.99 L670.7,32.39 L657.36,69.13 C656.988416,70.0838348 656.349536,70.9102123 655.52,71.51 C654.734577,72.1438986 653.759218,72.4960135 652.75,72.51 L647.39,72.51 C646.387527,72.4923334 645.419667,72.140384 644.64,71.51 C643.818452,70.8953887 643.179069,70.0693751 642.79,69.12 L629.7,32.23 L629.6,68.83 C629.634802,69.787823 629.273023,70.7175951 628.6,71.4 C627.944212,72.0636445 627.042642,72.4257208 626.11,72.4 L619.37,72.4 C618.432799,72.4183203 617.527839,72.0577785 616.86,71.4 C616.143427,70.7285743 615.750037,69.7815254 615.78,68.8 L615.78,68.8 Z" id="Path" fill="#F65803"></path>
<path d="M692.08,58.84 C691.973218,57.6336327 692.466829,56.4519567 693.4,55.68 C694.12014,55.0807712 695.014494,54.7300443 695.95,54.68 L700.41,54.68 C702.663333,54.68 704.373333,55.91 705.54,58.37 C706.7,60.82 709.34,62.05 713.43,62.06 L726.55,62.35 C730.943333,62.35 733.143333,60.92 733.15,58.06 C733.15,55.8933333 730.483333,54.1766667 725.15,52.91 C722.75,52.33 720.15,51.75 717.21,51.18 C714.27,50.61 711.44,49.9 708.58,49.05 C705.87988,48.2547647 703.245348,47.2517704 700.7,46.05 C698.399488,44.9682289 696.403219,43.3327311 694.89,41.29 C693.392835,39.2306421 692.616105,36.7352654 692.68,34.19 C692.68,29.17 694.473333,25.3066667 698.06,22.6 C701.646667,19.8933333 707.796667,18.56 716.51,18.6 L726.02,18.85 C730.924684,18.8052317 735.735418,20.1956173 739.86,22.85 C743.96,25.5166667 746.003333,28.8133333 745.99,32.74 C746.104216,33.9511338 745.614157,35.1407428 744.68,35.92 C743.972856,36.5214361 743.087125,36.8729163 742.16,36.92 L737.7,36.92 C735.46,36.92 733.75,35.68 732.58,33.22 C731.41,30.76 728.78,29.52 724.68,29.51 L713.41,29.25 C709.01,29.25 706.806667,30.68 706.8,33.54 C706.8,35.12 708.19,36.41 710.97,37.41 C714.24125,38.5440576 717.594334,39.426624 721,40.05 C725,40.8233333 729,41.7533333 733,42.84 C736.752403,43.796252 740.228609,45.6182636 743.15,48.16 C745.84998,50.4490644 747.377502,53.8309112 747.31,57.37 C747.31,62.39 745.506667,66.2533333 741.9,68.96 C738.293333,71.6666667 732.153333,73 723.48,72.96 L712.12,72.71 C707.211841,72.7573081 702.397191,71.3667955 698.27,68.71 C694.143333,66.0833333 692.08,62.7933333 692.08,58.84 Z" id="Path" fill="#F65803"></path>
<path d="M176,111.05 L176,123.81 L171.69,123.81 L171.69,92.61 L183.04,92.61 C188.81,92.61 192.68,96.61 192.68,101.85 C192.68,107.09 188.81,111.05 183.04,111.05 L176,111.05 Z M182.25,107.17 C185.99,107.17 188.25,105.1 188.25,101.89 C188.25,98.68 185.96,96.48 182.25,96.48 L176,96.48 L176,107.17 L182.25,107.17 Z" id="Shape" fill="#888888"></path>
<path d="M203.53,111.71 L209.25,110.87 C210.53,110.69 210.88,110.03 210.88,109.28 C210.88,107.22 209.51,105.5 206.3,105.5 C205.094424,105.418003 203.906525,105.824303 203.003696,106.627445 C202.100867,107.430587 201.558975,108.563079 201.5,109.77 L197.5,108.84 C197.94,104.84 201.6,101.98 206.17,101.98 C212.51,101.98 214.98,105.59 214.98,109.72 L214.98,120.33 C214.964645,121.495374 215.051646,122.659846 215.24,123.81 L211.19,123.81 C211.04052,122.881154 210.976918,121.940514 211,121 C209.510823,123.298723 206.916404,124.637778 204.18,124.52 C199.87,124.52 197.09,121.52 197.09,118.18 C197.1,114.35 199.88,112.23 203.53,111.71 Z M210.88,114.71 L210.88,113.71 L204.41,114.71 C202.65,114.98 201.33,115.99 201.33,117.88 C201.363095,118.748086 201.746619,119.565693 202.392987,120.146105 C203.039355,120.726517 203.893369,121.020169 204.76,120.96 C208.15,121 210.88,119.36 210.88,114.74 L210.88,114.71 Z" id="Shape" fill="#888888"></path>
<path d="M227.77,123.81 L223.64,123.81 L223.64,102.64 L227.64,102.64 L227.64,105.64 C228.983384,103.304982 231.507823,101.904226 234.2,102 C239.26,102 241.77,105.66 241.77,110.37 L241.77,123.79 L237.63,123.79 L237.63,111.09 C237.63,108.09 236.4,105.76 232.7,105.76 C229.44,105.76 227.77,108.36 227.77,111.57 L227.77,123.81 Z" id="Path" fill="#888888"></path>
<path d="M265.39,120.59 C264.123446,123.01383 261.57259,124.489821 258.84,124.38 C252.63,124.38 248.84,119.45 248.84,113.16 C248.84,107.16 252.84,102.07 258.84,102.07 C262.58,102.07 264.6,103.92 265.31,105.63 L265.31,92 L269.4,92 L269.4,119.94 C269.393999,121.249913 269.467467,122.558984 269.62,123.86 L265.62,123.86 C265.474248,122.913625 265.400702,121.957533 265.4,121 L265.39,120.59 Z M259.23,120.73 C263.02,120.73 265.35,117.43 265.35,113.07 C265.35,108.71 263.06,105.72 259.28,105.72 C255.5,105.72 253,108.8 253,113.16 C253,117.52 255.27,120.73 259.23,120.73 L259.23,120.73 Z" id="Shape" fill="#888888"></path>
<path d="M298.53,113.2 C298.53,119.67 294.04,124.47 287.7,124.47 C281.36,124.47 276.88,119.67 276.88,113.2 C276.88,106.73 281.36,102 287.7,102 C294.04,102 298.53,106.78 298.53,113.2 Z M294.3,113.2 C294.3,108.32 291.22,105.68 287.7,105.68 C284.18,105.68 281.1,108.32 281.1,113.2 C281.1,118.08 284.18,120.77 287.7,120.77 C291.22,120.77 294.3,118.13 294.3,113.2 L294.3,113.2 Z" id="Shape" fill="#888888"></path>
<path d="M317.75,106.82 C317.153912,106.733389 316.552347,106.689942 315.95,106.69 C312.47,106.69 310.14,108.54 310.14,113.2 L310.14,123.81 L306,123.81 L306,102.64 L310.05,102.64 L310.05,106.34 C311.132122,103.823292 313.652596,102.233087 316.39,102.34 C316.846155,102.34552 317.301059,102.389004 317.75,102.47 L317.75,106.82 Z" id="Path" fill="#888888"></path>
<path d="M329.46,111.71 L335.18,110.87 C336.45,110.69 336.81,110.03 336.81,109.28 C336.81,107.22 335.44,105.5 332.23,105.5 C331.023761,105.415203 329.834309,105.820526 328.930841,106.624236 C328.027373,107.427945 327.486272,108.562094 327.43,109.77 L323.43,108.84 C323.87,104.84 327.52,101.98 332.1,101.98 C338.44,101.98 340.9,105.59 340.9,109.72 L340.9,120.33 C340.886006,121.495732 340.976367,122.660377 341.17,123.81 L337.17,123.81 C337.007383,122.865645 336.933727,121.908116 336.95,120.95 C335.459417,123.247172 332.865953,124.585734 330.13,124.47 C325.81,124.47 323.04,121.47 323.04,118.13 C323,114.35 325.8,112.23 329.46,111.71 Z M336.81,114.71 L336.81,113.71 L330.34,114.71 C328.58,114.98 327.26,115.99 327.26,117.88 C327.293095,118.748086 327.676619,119.565693 328.322987,120.146105 C328.969355,120.726517 329.823369,121.020169 330.69,120.96 C334.08,121 336.81,119.36 336.81,114.74 L336.81,114.71 Z" id="Shape" fill="#888888"></path>
<polygon id="Path" fill="#888888" points="363.2 123.81 363.2 92.61 382.2 92.61 382.2 96.61 367.52 96.61 367.52 106.61 380.81 106.61 380.81 110.61 367.52 110.61 367.52 123.73"></polygon>
<polygon id="Path" fill="#888888" points="419.09 123.81 419.09 99.52 408.44 123.81 404.44 123.81 393.92 99.52 393.92 123.81 389.65 123.81 389.65 92.61 395.5 92.61 406.5 118 417.59 92.61 423.36 92.61 423.36 123.81"></polygon>
<path d="M449.49,101.06 C448.982092,97.8538566 446.131216,95.5515584 442.89,95.73 C439.37,95.73 436.89,98.02 436.89,100.92 C436.89,103.17 438.25,104.92 440.89,105.46 L445.56,106.46 C450.75,107.6 453.66,110.86 453.66,115.22 C453.66,120.06 449.52,124.46 442.87,124.46 C435.35,124.46 431.78,119.62 431.21,115.17 L435.35,113.85 C435.453196,115.729635 436.299659,117.49107 437.702796,118.746015 C439.105932,120.000959 440.950542,120.64638 442.83,120.54 C447.14,120.54 449.26,118.3 449.26,115.54 C449.26,113.29 447.71,111.36 444.59,110.7 L440.15,109.7 C435.7,108.7 432.53,105.83 432.53,101.16 C432.53,96.28 437.07,91.88 442.83,91.88 C449.83,91.88 452.69,96.23 453.39,99.62 L449.49,101.06 Z" id="Path" fill="#888888"></path>
<polygon id="Path" fill="#888888" points="475 123.81 475 92.61 479.4 92.61 479.4 123.81"></polygon>
<polygon id="Path" fill="#888888" points="500.7 96.61 500.7 123.81 496.39 123.81 496.39 96.61 486 96.61 486 92.61 511.17 92.61 511.17 96.61"></polygon>
<path d="M533.75,101.06 C533.242092,97.8538566 530.391216,95.5515584 527.15,95.73 C523.63,95.73 521.15,98.02 521.15,100.92 C521.15,103.17 522.51,104.92 525.15,105.46 L529.82,106.46 C535.01,107.6 537.91,110.86 537.91,115.22 C537.91,120.06 533.78,124.46 527.13,124.46 C519.61,124.46 516.04,119.62 515.47,115.17 L519.61,113.85 C519.713196,115.729635 520.559659,117.49107 521.962796,118.746015 C523.365932,120.000959 525.210542,120.64638 527.09,120.54 C531.4,120.54 533.51,118.3 533.51,115.54 C533.51,113.29 531.97,111.36 528.85,110.7 L524.4,109.7 C519.96,108.7 516.79,105.83 516.79,101.16 C516.79,96.28 521.32,91.88 527.09,91.88 C534.09,91.88 536.95,96.23 537.65,99.62 L533.75,101.06 Z" id="Path" fill="#888888"></path>
<polygon id="Path" fill="#888888" points="575.46 123.81 575.46 99.52 564.81 123.81 560.81 123.81 550.29 99.52 550.29 123.81 546 123.81 546 92.61 551.85 92.61 562.85 118 574 92.61 579.77 92.61 579.77 123.81"></polygon>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1378,7 +1378,7 @@ if ($get_extended_event) {
} }
// Tabs. // Tabs.
$tabs = "<ul class=''>"; $tabs = "<ul class='event_detail_tab_menu'>";
$tabs .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image( $tabs .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image(
'images/lightning_go.png', 'images/lightning_go.png',
true, true,
@ -1436,7 +1436,7 @@ if ($get_extended_event) {
).'<span>'.__('Responses').'</span></a></li>'; ).'<span>'.__('Responses').'</span></a></li>';
} }
if ($event['custom_data'] != '') { if (empty($event['custom_data']) === false) {
$tabs .= "<li><a href='#extended_event_custom_data_page' id='link_custom_data'>".html_print_image( $tabs .= "<li><a href='#extended_event_custom_data_page' id='link_custom_data'>".html_print_image(
'images/custom_field_col.png', 'images/custom_field_col.png',
true, true,
@ -1612,6 +1612,7 @@ if ($get_extended_event) {
data : { data : {
page: "include/ajax/events", page: "include/ajax/events",
get_comments: 1, get_comments: 1,
meta: '.(int) is_metaconsole().',
event: '.json_encode($event).', event: '.json_encode($event).',
}, },
dataType : "html", dataType : "html",

View File

@ -41,6 +41,8 @@ if ($get_sec_pages) {
$pages = menu_get_sec_pages($sec, $menu_hash); $pages = menu_get_sec_pages($sec, $menu_hash);
} }
$pages = menu_pepare_acl_select_data($pages, $sec);
echo json_encode($pages); echo json_encode($pages);
return; return;
} }

View File

@ -218,6 +218,11 @@ function process_user_login_remote($login, $pass, $api=false)
switch ($config['auth']) { switch ($config['auth']) {
// LDAP // LDAP
case 'ldap': case 'ldap':
// Use local authentication if user is global admin.
if (is_user_admin($login) === true) {
return false;
}
$sr = ldap_process_user_login($login, $pass); $sr = ldap_process_user_login($login, $pass);
if (!$sr) { if (!$sr) {
@ -227,6 +232,11 @@ function process_user_login_remote($login, $pass, $api=false)
// Active Directory // Active Directory
case 'ad': case 'ad':
// Use local authentication if user is global admin.
if (is_user_admin($login) === true) {
return false;
}
if (enterprise_hook('ad_process_user_login', [$login, $pass]) === false) { if (enterprise_hook('ad_process_user_login', [$login, $pass]) === false) {
$config['auth_error'] = 'User not found in database or incorrect password'; $config['auth_error'] = 'User not found in database or incorrect password';
return false; return false;
@ -349,18 +359,24 @@ function process_user_login_remote($login, $pass, $api=false)
return false; return false;
} }
$user_info = [
'fullname' => $login,
'comments' => 'Imported from '.$config['auth'],
];
if (is_metaconsole() === true) {
$user_info['metaconsole_access_node'] = $config['ad_adv_user_node'];
}
// Create the user. // Create the user.
if (enterprise_hook( if (enterprise_hook(
'prepare_permissions_groups_of_user_ad', 'prepare_permissions_groups_of_user_ad',
[ [
$login, $login,
$pass, $pass,
[ $user_info,
'fullname' => $login,
'comments' => 'Imported from '.$config['auth'],
],
false, false,
defined('METACONSOLE'), defined('METACONSOLE') && is_centralized() === false,
] ]
) === false ) === false
) { ) {
@ -373,6 +389,10 @@ function process_user_login_remote($login, $pass, $api=false)
return false; return false;
} }
if (is_metaconsole() === true) {
$user_info['metaconsole_access_node'] = $config['ldap_adv_user_node'];
}
$permissions = fill_permissions_ldap($sr); $permissions = fill_permissions_ldap($sr);
if (empty($permissions) === true) { if (empty($permissions) === true) {
$config['auth_error'] = __('User not found in database or incorrect password'); $config['auth_error'] = __('User not found in database or incorrect password');
@ -387,7 +407,7 @@ function process_user_login_remote($login, $pass, $api=false)
$pass, $pass,
$user_info, $user_info,
$permissions, $permissions,
is_metaconsole() is_metaconsole() && is_centralized() === false
); );
} }
} else { } else {
@ -770,7 +790,7 @@ function ldap_process_user_login($login, $password)
io_safe_output($config['ldap_base_dn']), io_safe_output($config['ldap_base_dn']),
$config['ldap_login_attr'], $config['ldap_login_attr'],
io_safe_output($config['ldap_admin_login']), io_safe_output($config['ldap_admin_login']),
io_safe_output($config['ldap_admin_pass']), io_output_password($config['ldap_admin_pass']),
io_safe_output($login) io_safe_output($login)
); );
@ -794,7 +814,7 @@ function ldap_process_user_login($login, $password)
} else { } else {
// PHP LDAP function // PHP LDAP function
if ($config['ldap_admin_login'] != '' && $config['ldap_admin_pass'] != '') { if ($config['ldap_admin_login'] != '' && $config['ldap_admin_pass'] != '') {
if (!@ldap_bind($ds, io_safe_output($config['ldap_admin_login']), $config['ldap_admin_pass'])) { if (!@ldap_bind($ds, io_safe_output($config['ldap_admin_login']), io_output_password($config['ldap_admin_pass']))) {
$config['auth_error'] = 'Admin ldap connection fail'; $config['auth_error'] = 'Admin ldap connection fail';
@ldap_close($ds); @ldap_close($ds);
return false; return false;

View File

@ -1042,40 +1042,20 @@ class AgentWizard extends HTML
$oidExplore = '.1.3.6.1.2.1.31.1.1.1.1'; $oidExplore = '.1.3.6.1.2.1.31.1.1.1.1';
} else { } else {
$this->interfacesx64 = false; $this->interfacesx64 = false;
$oidExplore = '1.3.6.1.2.1.2.2.1.2'; $oidExplore = '.1.3.6.1.2.1.2.2.1.2';
} }
// Explore interface names.
$oidExplore = '.1.3.6.1.2.1.31.1.1.1.1';
$receivedOid = $this->snmpWalkValues(
$oidExplore,
false,
true
);
} else { } else {
// Get the device PEN. // Get the device PEN.
$oidExplore = '.1.3.6.1.2.1.1.2.0'; $oidExplore = '.1.3.6.1.2.1.1.2.0';
} }
// Doc Interfaces de red. // Explore general or interfaces
$receivedOid = $this->snmpWalkValues( $receivedOid = $this->snmpWalkValues(
$oidExplore, $oidExplore,
false, false,
false false
); );
if (empty($receivedOid) || preg_grep('/no.*object/i', $receivedOid)) {
$this->interfacesx64 = false;
$oidExplore = '1.3.6.1.2.1.2.2.1.2';
// Doc Interfaces de red.
$receivedOid = $this->snmpWalkValues(
$oidExplore,
false,
true
);
}
// The snmpwalk return information. // The snmpwalk return information.
if (empty($receivedOid) === false) { if (empty($receivedOid) === false) {
if ($this->wizardSection === 'snmp_interfaces_explorer') { if ($this->wizardSection === 'snmp_interfaces_explorer') {
@ -2443,7 +2423,8 @@ class AgentWizard extends HTML
} }
// Get current value. // Get current value.
if (in_array( if ($this->serverType === SERVER_TYPE_ENTERPRISE_SATELLITE
|| in_array(
$moduleData['module_type'], $moduleData['module_type'],
[ [
MODULE_TYPE_REMOTE_SNMP, MODULE_TYPE_REMOTE_SNMP,
@ -2453,8 +2434,10 @@ class AgentWizard extends HTML
] ]
) === true ) === true
) { ) {
if (isset($moduleData['value']) === true) {
$currentValue = $this->snmpGetValue($moduleData['value']); $currentValue = $this->snmpGetValue($moduleData['value']);
} }
}
// It unit of measure have data, attach to current value. // It unit of measure have data, attach to current value.
if (empty($moduleData['module_unit']) === false) { if (empty($moduleData['module_unit']) === false) {
@ -2613,7 +2596,8 @@ class AgentWizard extends HTML
// Get current value. // Get current value.
$currentValue = ''; $currentValue = '';
if (in_array( if ($this->serverType === SERVER_TYPE_ENTERPRISE_SATELLITE
|| in_array(
$moduleData['module_type'], $moduleData['module_type'],
[ [
MODULE_TYPE_REMOTE_SNMP, MODULE_TYPE_REMOTE_SNMP,
@ -2623,8 +2607,10 @@ class AgentWizard extends HTML
] ]
) === true ) === true
) { ) {
if (isset($moduleData['value']) === true) {
$currentValue = $this->snmpGetValue($moduleData['value']); $currentValue = $this->snmpGetValue($moduleData['value']);
} }
}
// Format current value with thousands and decimals. // Format current value with thousands and decimals.
if (is_numeric($currentValue) === true) { if (is_numeric($currentValue) === true) {
@ -3481,7 +3467,7 @@ class AgentWizard extends HTML
} else { } else {
preg_match('/\.\d+$/', $key, $index); preg_match('/\.\d+$/', $key, $index);
$tmp = explode(': ', $oid_unit); $tmp = explode(': ', $oid_unit);
$output[$index[0]] = ($tmp[1] ?? ''); $output[$index[0]] = str_replace('"', '', ($tmp[1] ?? ''));
} }
} }
} }

View File

@ -133,7 +133,9 @@ class AgentsAlerts extends HTML
// Refresh rate. // Refresh rate.
$this->refreshSelectedRate = (string) get_parameter('refresh-rate', '30'); $this->refreshSelectedRate = (string) get_parameter('refresh-rate', '30');
// Show Modules without alerts table. // Show Modules without alerts table.
$this->showWithoutAlertModules = isset($_POST['show-modules-without-alerts']); $this->showWithoutAlertModules = (isset($_POST['show-modules-without-alerts']))
? true
: isset($_GET['show-modules-without-alerts']);
// Selected group. // Selected group.
$this->groupId = (int) get_parameter('group-id', 0); $this->groupId = (int) get_parameter('group-id', 0);
// Create alert token. // Create alert token.
@ -200,6 +202,8 @@ class AgentsAlerts extends HTML
*/ */
private function createAlertTable() private function createAlertTable()
{ {
global $config;
$table = new stdClass(); $table = new stdClass();
if ($this->groupId > 0) { if ($this->groupId > 0) {
@ -219,7 +223,7 @@ class AgentsAlerts extends HTML
$sql = 'SELECT tagente.alias, tagente_modulo.nombre, $sql = 'SELECT tagente.alias, tagente_modulo.nombre,
tagente_modulo.id_agente_modulo FROM tagente_modulo tagente_modulo.id_agente_modulo FROM tagente_modulo
INNER JOIN tagente ON tagente.id_agente = tagente_modulo.id_agente INNER JOIN tagente ON tagente.id_agente = tagente_modulo.id_agente
WHERE id_agente_modulo NOT IN (SELECT id_agent_module FROM talert_template_modules) '.$grupo.' LIMIT 20 OFFSET '.$offset_modules; WHERE id_agente_modulo NOT IN (SELECT id_agent_module FROM talert_template_modules) '.$grupo.' LIMIT '.$config['block_size'].' OFFSET '.$offset_modules;
$agent_modules = db_get_all_rows_sql($sql); $agent_modules = db_get_all_rows_sql($sql);
@ -227,7 +231,7 @@ class AgentsAlerts extends HTML
$count_agent_module[0]['COUNT(tagente_modulo.nombre)'], $count_agent_module[0]['COUNT(tagente_modulo.nombre)'],
ui_get_url_refresh(), ui_get_url_refresh(),
0, 0,
0, false,
false, false,
'offset', 'offset',
true, true,
@ -831,6 +835,7 @@ class AgentsAlerts extends HTML
'arguments' => [ 'arguments' => [
'type' => 'button', 'type' => 'button',
'return' => true, 'return' => true,
'label' => '',
'name' => 'pure', 'name' => 'pure',
'attributes' => 'class="full_screen_button '.$screenSwitchClass.'" title="'.$screenSwitchTitle.'"', 'attributes' => 'class="full_screen_button '.$screenSwitchClass.'" title="'.$screenSwitchTitle.'"',
], ],

File diff suppressed because it is too large Load Diff

View File

@ -52,6 +52,12 @@ class ConsoleSupervisor
*/ */
public const MIN_PERFORMANCE_MODULES = 100; public const MIN_PERFORMANCE_MODULES = 100;
/**
* Minimum queued elements in synchronization queue to be warned..
*/
public const MIN_SYNC_QUEUE_LENGTH = 200;
/** /**
* Show if console supervisor is enabled or not. * Show if console supervisor is enabled or not.
* *
@ -242,6 +248,16 @@ class ConsoleSupervisor
$this->checkAuditLogOldLocation(); $this->checkAuditLogOldLocation();
/*
* Checks if sync queue is longer than limits.
* NOTIF.SYNCQUEUE.LENGTH
*/
if (is_metaconsole() === true) {
$this->checkSyncQueueLength();
$this->checkSyncQueueStatus();
}
} }
@ -492,6 +508,16 @@ class ConsoleSupervisor
*/ */
$this->checkAuditLogOldLocation(); $this->checkAuditLogOldLocation();
/*
* Checks if sync queue is longer than limits.
* NOTIF.SYNCQUEUE.LENGTH
*/
if (is_metaconsole() === true) {
$this->checkSyncQueueLength();
$this->checkSyncQueueStatus();
}
} }
@ -2684,4 +2710,117 @@ class ConsoleSupervisor
} }
/**
* Verifies the status of synchronization queue and warns if something is
* not working as expected.
*
* @return void
*/
public function checkSyncQueueLength()
{
global $config;
if (is_metaconsole() !== true) {
return;
}
$sync = new PandoraFMS\Enterprise\Metaconsole\Synchronizer();
$counts = $sync->getQueues(true);
if (count($counts) === 0) {
// Clean all.
$this->cleanNotifications('NOTIF.SYNCQUEUE.LENGTH.%');
}
$items_min = $config['sync_queue_items_max'];
if (is_numeric($items_min) !== true && $items_min <= 0) {
$items_min = self::MIN_SYNC_QUEUE_LENGTH;
}
foreach ($counts as $node_id => $count) {
if ($count < $items_min) {
$this->cleanNotifications('NOTIF.SYNCQUEUE.LENGTH.'.$node_id);
} else {
try {
$node = new PandoraFMS\Enterprise\Metaconsole\Node($node_id);
$url = '__url__/index.php?sec=advanced&sec2=advanced/metasetup&tab=consoles';
$this->notify(
[
'type' => 'NOTIF.SYNCQUEUE.LENGTH.'.$node_id,
'title' => __('Node %s sync queue length exceeded, ', $node->server_name()),
'message' => __(
'Synchronization queue lenght for node %s is %d items, this value should be 0 or lower than %d, please check the queue status.',
$node->server_name(),
$count,
$items_min
),
'url' => $url,
]
);
} catch (\Exception $e) {
// Clean, exception in node finding.
$this->cleanNotifications('NOTIF.SYNCQUEUE.LENGTH.'.$node_id);
}
}
}
}
/**
* Verifies the status of synchronization queue and warns if something is
* not working as expected.
*
* @return void
*/
public function checkSyncQueueStatus()
{
if (is_metaconsole() !== true) {
return;
}
$sync = new PandoraFMS\Enterprise\Metaconsole\Synchronizer();
$queues = $sync->getQueues();
if (count($queues) === 0) {
// Clean all.
$this->cleanNotifications('NOTIF.SYNCQUEUE.STATUS.%');
}
foreach ($queues as $node_id => $queue) {
if (count($queue) === 0) {
$this->cleanNotifications('NOTIF.SYNCQUEUE.STATUS.'.$node_id);
continue;
}
$item = $queue[0];
if (empty($item->error()) === false) {
try {
$node = new PandoraFMS\Enterprise\Metaconsole\Node($node_id);
$url = '__url__/index.php?sec=advanced&sec2=advanced/metasetup&tab=consoles';
$this->notify(
[
'type' => 'NOTIF.SYNCQUEUE.STATUS.'.$node_id,
'title' => __('Node %s sync queue failed, ', $node->server_name()),
'message' => __(
'Node %s cannot process synchronization queue due %s, please check the queue status.',
$node->server_name(),
$item->error()
),
'url' => $url,
]
);
} catch (\Exception $e) {
// Clean, exception in node finding.
$this->cleanNotifications('NOTIF.SYNCQUEUE.STATUS.'.$node_id);
}
}
}
}
} }

View File

@ -149,7 +149,7 @@ class CredentialStore extends Wizard
* @param string $ajax_controller Path of ajaxController, is the 'page' * @param string $ajax_controller Path of ajaxController, is the 'page'
* variable sent in ajax calls. * variable sent in ajax calls.
* *
* @return Object * @return object
*/ */
public function __construct($ajax_controller) public function __construct($ajax_controller)
{ {
@ -248,7 +248,11 @@ class CredentialStore extends Wizard
); );
} else { } else {
$groups = [ $filter['filter_id_group'] ]; $groups = [ $filter['filter_id_group'] ];
$childrens = groups_get_children($id_group, null, true); $childrens = groups_get_children(
$filter['filter_id_group'],
null,
true
);
if (!empty($childrens)) { if (!empty($childrens)) {
foreach ($childrens as $child) { foreach ($childrens as $child) {
$groups[] = (int) $child['id_grupo']; $groups[] = (int) $child['id_grupo'];
@ -353,6 +357,10 @@ class CredentialStore extends Wizard
$return = db_get_all_rows_sql($sql); $return = db_get_all_rows_sql($sql);
if ($return === false) {
$return = [];
}
// Filter out those items of group all that cannot be edited by user. // Filter out those items of group all that cannot be edited by user.
$return = array_filter( $return = array_filter(
$return, $return,

View File

@ -600,7 +600,7 @@ class Tree
if (is_metaconsole()) { if (is_metaconsole()) {
$module['serverID'] = $this->serverID; $module['serverID'] = $this->serverID;
$module['serverName'] = $this->serverName; $module['serverName'] = empty($this->serverName) === false ? $this->serverName : servers_get_name($this->serverID);
} else { } else {
$module['serverName'] = false; $module['serverName'] = false;
$module['serverID'] = false; $module['serverID'] = false;
@ -895,10 +895,16 @@ class Tree
protected function processAgents(&$agents, $server=false) protected function processAgents(&$agents, $server=false)
{ {
if (!empty($agents)) { if (!empty($agents)) {
$agents_aux = [];
foreach ($agents as $iterator => $agent) { foreach ($agents as $iterator => $agent) {
$this->processAgent($agents[$iterator], $server); $this->processAgent($agents[$iterator], $server);
if ($agents[$iterator]['counters']['total'] !== '0') {
$agents_aux[] = $agents[$iterator];
} }
} }
$agents = $agents_aux;
}
} }
@ -950,10 +956,9 @@ class Tree
$module_status_inner = ''; $module_status_inner = '';
$module_search_inner = ''; $module_search_inner = '';
$module_search_filter = ''; $module_search_filter = '';
if (!empty($this->filter['searchModule'])) { if (!empty($this->filter['searchModule'])) {
$module_search_inner = ' $module_search_inner = '
INNER JOIN tagente_modulo tam
ON ta.id_agente = tam.id_agente
INNER JOIN tagente_estado tae INNER JOIN tagente_estado tae
ON tae.id_agente_modulo = tam.id_agente_modulo'; ON tae.id_agente_modulo = tam.id_agente_modulo';
$module_search_filter = "AND tam.disabled = 0 $module_search_filter = "AND tam.disabled = 0

View File

@ -32,6 +32,8 @@ class TreeOS extends Tree
'tco.icon_name AS iconHTML', 'tco.icon_name AS iconHTML',
]; ];
$this->L1inner = 'INNER JOIN tconfig_os tco ON tco.id_os = x2.g'; $this->L1inner = 'INNER JOIN tconfig_os tco ON tco.id_os = x2.g';
$this->L1innerInside = 'INNER JOIN tagente_modulo tam
ON ta.id_agente = tam.id_agente';
$this->L1orderByFinal = 'tco.name'; $this->L1orderByFinal = 'tco.name';
$this->L2condition = 'AND ta.id_os = '.$this->rootID; $this->L2condition = 'AND ta.id_os = '.$this->rootID;

View File

@ -20,8 +20,8 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC211008'; $build_version = 'PC211122';
$pandora_version = 'v7.0NG.757'; $pandora_version = 'v7.0NG.758';
// 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

@ -425,6 +425,8 @@ define('SERVER_TYPE_SYSLOG', 18);
define('SERVER_TYPE_AUTOPROVISION', 19); define('SERVER_TYPE_AUTOPROVISION', 19);
define('SERVER_TYPE_MIGRATION', 20); define('SERVER_TYPE_MIGRATION', 20);
define('SERVER_TYPE_ALERT', 21); define('SERVER_TYPE_ALERT', 21);
define('SERVER_TYPE_CORRELATION', 22);
define('SERVER_TYPE_NCM', 23);
// REPORTS. // REPORTS.
define('REPORT_TOP_N_MAX', 1); define('REPORT_TOP_N_MAX', 1);

View File

@ -766,7 +766,7 @@ function mysql_db_format_array_where_clause_sql($values, $join='AND', $prefix=fa
if ($value === null) { if ($value === null) {
$not = (($negative === true) ? 'NOT' : ''); $not = (($negative === true) ? 'NOT' : '');
$query .= sprintf('%s IS %s NULL', $field, $negative); $query .= sprintf('%s IS %s NULL', $field, $not);
} else if (is_int($value) || is_bool($value)) { } else if (is_int($value) || is_bool($value)) {
$not = (($negative === true) ? '!' : ''); $not = (($negative === true) ? '!' : '');
$query .= sprintf('%s %s= %d', $field, $not, $value); $query .= sprintf('%s %s= %d', $field, $not, $value);
@ -883,7 +883,7 @@ function mysql_db_get_row_sql($sql, $search_history_db=false, $cache=true)
* *
* @return mixed Array of the row or false in case of error. * @return mixed Array of the row or false in case of error.
*/ */
function mysql_db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false) function mysql_db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false, $cache=true)
{ {
if (empty($fields)) { if (empty($fields)) {
$fields = '*'; $fields = '*';
@ -905,7 +905,7 @@ function mysql_db_get_row_filter($table, $filter, $fields=false, $where_join='AN
$sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter); $sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter);
return db_get_row_sql($sql, $historydb); return db_get_row_sql($sql, $historydb, $cache);
} }

View File

@ -1041,7 +1041,7 @@ function oracle_db_get_row_sql($sql, $search_history_db=false, $cache=true)
* *
* @return mixed Array of the row or false in case of error. * @return mixed Array of the row or false in case of error.
*/ */
function oracle_db_get_row_filter($table, $filter, $fields=false, $where_join='AND') function oracle_db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $history_db=false, $cache=true)
{ {
if (empty($fields)) { if (empty($fields)) {
$fields = '*'; $fields = '*';
@ -1063,7 +1063,7 @@ function oracle_db_get_row_filter($table, $filter, $fields=false, $where_join='A
$sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter); $sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter);
return db_get_row_sql($sql); return db_get_row_sql($sql, $history_db, $cache);
} }

View File

@ -750,7 +750,7 @@ function postgresql_db_get_row_sql($sql, $search_history_db=false, $cache=true)
* *
* @return mixed Array of the row or false in case of error. * @return mixed Array of the row or false in case of error.
*/ */
function postgresql_db_get_row_filter($table, $filter, $fields=false, $where_join='AND') function postgresql_db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false, $cache=true)
{ {
if (empty($fields)) { if (empty($fields)) {
$fields = '*'; $fields = '*';
@ -772,7 +772,7 @@ function postgresql_db_get_row_filter($table, $filter, $fields=false, $where_joi
$sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter); $sql = sprintf('SELECT %s FROM %s %s', $fields, $table, $filter);
return db_get_row_sql($sql); return db_get_row_sql($sql, $historydb, $cache);
} }

View File

@ -1732,9 +1732,9 @@ function is_management_allowed($hkey='')
$nodes = (int) $nodes; $nodes = (int) $nodes;
} }
return ( (is_metaconsole() && (is_centrallised() || $nodes === 0)) return ( (is_metaconsole() && (is_centralized() || $nodes === 0))
|| (!is_metaconsole() && !is_centrallised()) || (!is_metaconsole() && !is_centralized())
|| (!is_metaconsole() && is_centrallised()) && $hkey == generate_hash_to_api()); || (!is_metaconsole() && is_centralized()) && $hkey == generate_hash_to_api());
} }
@ -1743,7 +1743,7 @@ function is_management_allowed($hkey='')
* *
* @return boolean * @return boolean
*/ */
function is_centrallised() function is_centralized()
{ {
global $config; global $config;
@ -1763,7 +1763,7 @@ function is_centrallised()
*/ */
function is_central_policies() function is_central_policies()
{ {
return is_metaconsole() && is_centrallised(); return is_metaconsole() && is_centralized();
} }
@ -2089,8 +2089,14 @@ function get_snmpwalk(
exec($command_str, $output, $rc); exec($command_str, $output, $rc);
} }
// Parse the output of snmpwalk.
$snmpwalk = []; $snmpwalk = [];
// Check if OID is available.
if (count($output) == 1 && strpos($output[0], 'No Such Object available on this agent at this OID') !== false) {
return $snmpwalk;
}
// Parse the output of snmpwalk.
foreach ($output as $line) { foreach ($output as $line) {
// Separate the OID from the value. // Separate the OID from the value.
if (strpos($format, 'q') === false) { if (strpos($format, 'q') === false) {
@ -2446,86 +2452,74 @@ function get_acl_column($access)
case 'AR': case 'AR':
return 'agent_view'; return 'agent_view';
break;
case 'AW': case 'AW':
return 'agent_edit'; return 'agent_edit';
break;
case 'AD': case 'AD':
return 'agent_disable'; return 'agent_disable';
break;
case 'LW': case 'LW':
return 'alert_edit'; return 'alert_edit';
break;
case 'LM': case 'LM':
return 'alert_management'; return 'alert_management';
break;
case 'PM': case 'PM':
return 'pandora_management'; return 'pandora_management';
break;
case 'DM': case 'DM':
return 'db_management'; return 'db_management';
break;
case 'UM': case 'UM':
return 'user_management'; return 'user_management';
break;
case 'RR': case 'RR':
return 'report_view'; return 'report_view';
break;
case 'RW': case 'RW':
return 'report_edit'; return 'report_edit';
break;
case 'RM': case 'RM':
return 'report_management'; return 'report_management';
break;
case 'ER': case 'ER':
return 'event_view'; return 'event_view';
break;
case 'EW': case 'EW':
return 'event_edit'; return 'event_edit';
break;
case 'EM': case 'EM':
return 'event_management'; return 'event_management';
break;
case 'MR': case 'MR':
return 'map_view'; return 'map_view';
break;
case 'MW': case 'MW':
return 'map_edit'; return 'map_edit';
break;
case 'MM': case 'MM':
return 'map_management'; return 'map_management';
break;
case 'VR': case 'VR':
return 'vconsole_view'; return 'vconsole_view';
break;
case 'VW': case 'VW':
return 'vconsole_edit'; return 'vconsole_edit';
break;
case 'VM': case 'VM':
return 'vconsole_management'; return 'vconsole_management';
break; case 'NR':
return 'network_config_view';
case 'NW':
return 'network_config_edit';
case 'NM':
return 'network_config_management';
default: default:
return ''; return '';
break;
} }
} }
@ -2559,7 +2553,10 @@ function get_users_acl($id_user)
sum(tperfil.map_management) as map_management, sum(tperfil.map_management) as map_management,
sum(tperfil.vconsole_view) as vconsole_view, sum(tperfil.vconsole_view) as vconsole_view,
sum(tperfil.vconsole_edit) as vconsole_edit, sum(tperfil.vconsole_edit) as vconsole_edit,
sum(tperfil.vconsole_management) as vconsole_management sum(tperfil.vconsole_management) as vconsole_management,
sum(tperfil.network_config_view) as network_config_view,
sum(tperfil.network_config_edit) as network_config_edit,
sum(tperfil.network_config_management) as network_config_management
FROM tusuario_perfil, tperfil FROM tusuario_perfil, tperfil
WHERE tusuario_perfil.id_perfil = tperfil.id_perfil WHERE tusuario_perfil.id_perfil = tperfil.id_perfil
AND tusuario_perfil.id_usuario = '%s'", AND tusuario_perfil.id_usuario = '%s'",

View File

@ -679,7 +679,7 @@ function agents_get_agents(
// Add the group filter to // Add the group filter to
$where = db_format_array_where_clause_sql($filter, 'AND', '('.$where_secondary.') AND '); $where = db_format_array_where_clause_sql($filter, 'AND', '('.$where_secondary.') AND ');
if ($where == '' && $where_secondary != '') { if ($where == '' && $where_secondary != '') {
$where = $where_secondary; $where = '('.$where_secondary.')';
} }
$where_nogroup = db_format_array_where_clause_sql( $where_nogroup = db_format_array_where_clause_sql(
@ -1181,6 +1181,10 @@ function agents_get_group_agents(
} }
} }
if (isset($search['all_agents'])) {
unset($search['all_agents']);
}
if (isset($search['string']) === true) { if (isset($search['string']) === true) {
$string = io_safe_input($search['string']); $string = io_safe_input($search['string']);
$filter[] = "(nombre COLLATE utf8_general_ci LIKE '%$string%' OR direccion LIKE '%$string%')"; $filter[] = "(nombre COLLATE utf8_general_ci LIKE '%$string%' OR direccion LIKE '%$string%')";
@ -1283,7 +1287,7 @@ function agents_get_group_agents(
if (!$add_alert_bulk_op) { if (!$add_alert_bulk_op) {
// Add the rest of the filter from the search array. // Add the rest of the filter from the search array.
foreach ($search as $key => $value) { foreach ($search as $key => $value) {
$filter[] = $value; $filter[$key] = $value;
} }
} }
} else if ($filter !== true) { } else if ($filter !== true) {

View File

@ -2380,118 +2380,6 @@ function get_alert_last_fire_timestamp_in_period($id_alert_module, $period, $dat
} }
/**
* Insert in talert_special_days a new special day.
*
* @param date of special day.
* @param same day of the week.
* @param mixed A single value or array of values to insert (can be a multiple a mount of rows).
*
* @return mixed False in case of error or invalid values passed. Affected rows otherwise.
*/
function alerts_create_alert_special_day($date, $same_day, $values=false)
{
if (empty($date)) {
return false;
}
if (empty($same_day)) {
return false;
}
if (! is_array($values)) {
$values = [];
}
global $config;
$date_db = '';
switch ($config['dbtype']) {
case 'mysql':
$date_db = 'date';
break;
case 'oracle':
$date_db = '"date"';
break;
}
$values[$date_db] = $date;
$values['same_day'] = $same_day;
return @db_process_sql_insert('talert_special_days', $values);
}
/**
* Update a special day in talert_special_days.
*
* @param int special day Id.
* @param mixed Array of values to update.
*
* @return mixed False in case of error or invalid values passed. Affected rows otherwise
*/
function alerts_update_alert_special_day($id_special_day, $values)
{
$id_special_day = safe_int($id_special_day, 1);
if (empty($id_special_day)) {
return false;
}
if (! is_array($values)) {
return false;
}
return (@db_process_sql_update(
'talert_special_days',
$values,
['id' => $id_special_day]
)) !== false;
}
/**
* Delete a special day in talert_special_days.
*
* @param int special day Id.
*
* @return mixed False in case of error or invalid values passed. Affected rows otherwise
*/
function alerts_delete_alert_special_day($id_special_day)
{
$id_special_day = safe_int($id_special_day, 1);
if (empty($id_special_day)) {
return false;
}
return (@db_process_sql_delete(
'talert_special_days',
['id' => $id_special_day]
)) !== false;
}
/**
* Get a special day in talert_special_days.
*
* @param int special day Id.
*
* @return mixed False in case of error or invalid values passed. All row of the selected command otherwise
*/
function alerts_get_alert_special_day($id_special_day)
{
$id_special_day = safe_int($id_special_day, 1);
if (empty($id_special_day)) {
return false;
}
return db_get_row('talert_special_days', 'id', $id_special_day);
}
/** /**
* Get number of alert fired that an action is executed. Only fot non default alerts * Get number of alert fired that an action is executed. Only fot non default alerts
* *

View File

@ -55,6 +55,7 @@ enterprise_include_once('include/functions_alerts.php');
// Clases. // Clases.
use PandoraFMS\Module; use PandoraFMS\Module;
use PandoraFMS\Enterprise\Cluster; use PandoraFMS\Enterprise\Cluster;
use PandoraFMS\SpecialDay;
/** /**
@ -14131,7 +14132,7 @@ function api_get_special_days($thrash1, $thrash2, $other, $thrash3)
* *
* @param $thrash1 Don't use. * @param $thrash1 Don't use.
* @param $thrash2 Don't use. * @param $thrash2 Don't use.
* @param array $other it's array, $other as param is <special_day>;<same_day>;<description>;<id_group>; in this order * @param array $other it's array, $other as param is <special_day>;<day_code>;<description>;<id_group>; in this order
* and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>) * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
* @param $thrash3 Don't use * @param $thrash3 Don't use
* *
@ -14150,6 +14151,7 @@ function api_set_create_special_day($thrash1, $thrash2, $other, $thrash3)
$same_day = $other['data'][1]; $same_day = $other['data'][1];
$description = $other['data'][2]; $description = $other['data'][2];
$idGroup = $other['data'][3]; $idGroup = $other['data'][3];
$calendar_name = (isset($other['data'][4]) === true) ? $other['data'][4] : 'Default';
if (!check_acl($config['id_user'], $idGroup, 'LM', true)) { if (!check_acl($config['id_user'], $idGroup, 'LM', true)) {
returnError('forbidden', 'string'); returnError('forbidden', 'string');
@ -14186,17 +14188,51 @@ function api_set_create_special_day($thrash1, $thrash2, $other, $thrash3)
} }
} }
$values = [ $weekdays = [
'description' => $other['data'][2], 'monday' => 1,
'id_group' => $other['data'][3], 'tuesday' => 2,
'wednesday' => 3,
'thursday' => 4,
'friday' => 5,
'saturday' => 6,
'sunday' => 7,
'holiday' => 8,
]; ];
$idSpecialDay = alerts_create_alert_special_day($special_day, $same_day, $values); $day_code = (isset($weekdays[$same_day]) === true) ? $weekdays[$same_day] : 0;
if (is_error($idSpecialDay)) { if ($day_code === 0) {
returnError('Special Day could not be created'); returnError('Special Day could not be created. Same day doesn\'t exists.');
return;
}
$id_calendar = db_get_value_sql(
sprintf(
'SELECT id FROM talert_calendar WHERE name="%s"',
$calendar_name
)
);
if ($id_calendar === false) {
returnError('Special Day could not be created. Calendar doesn\'t exists.');
return;
}
try {
$sd = new SpecialDay();
$sd->date($special_day);
$sd->id_group($idGroup);
$sd->day_code($day_code);
$sd->description($description);
$sd->id_calendar($id_calendar);
$sd->save();
if ($sd->save() === true) {
returnData('string', ['type' => 'string', 'data' => $sd->id()]);
} else { } else {
returnData('string', ['type' => 'string', 'data' => $idSpecialDay]); returnError('Special Day could not be created');
}
} catch (Exception $e) {
returnData('string', ['type' => 'string', 'data' => $e]);
} }
} }
@ -14641,12 +14677,59 @@ function api_set_add_element_service($thrash1, $thrash2, $other, $thrash3)
} }
/**
* Example: http://127.0.0.1/pandora_console/include/api.php?op=set&op2=recreate_service_modules&id=1&user=admin&apipass=1234&pass=pandora
* Recreates modules for given service id, if needed.
*
* @param integer $id Id service.
* @param integer|null $id_agent Agent id to allocate service if node env.
* @return void
*/
function api_set_recreate_service_modules($id, $id_agent)
{
global $config;
if (!check_acl($config['id_user'], $service['id_group'], 'AW')) {
returnError('forbidden', 'string');
return;
}
$id_agent = (int) $id_agent;
if (empty($id_agent) === true) {
$id_agent = null;
}
if (is_metaconsole() === true) {
// Force agent recreation in MC if modules are missing.
$id_agent = null;
}
$result = false;
try {
$service = new PandoraFMS\Enterprise\Service($id);
if ($service->migrateModules() !== true) {
$service->addModules($id_agent);
}
$result = true;
} catch (Exception $e) {
$result = false;
$error = $e->getMessage();
}
if ($result === true) {
returnData('string', ['type' => 'string', 'data' => 'OK']);
} else {
returnError('The service modules could not be recreated: '.$error);
}
}
/** /**
* Update a special day. And return a message with the result of the operation. * Update a special day. And return a message with the result of the operation.
* *
* @param string $id Id of the special day to update. * @param string $id Id of the special day to update.
* @param $thrash2 Don't use. * @param $thrash2 Don't use.
* @param array $other it's array, $other as param is <special_day>;<same_day>;<description>;<id_group>; in this order * @param array $other it's array, $other as param is <special_day>;<day_code>;<description>;<id_group>; in this order
* and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>) * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
* @param $thrash3 Don't use * @param $thrash3 Don't use
* *
@ -14662,9 +14745,10 @@ function api_set_update_special_day($id_special_day, $thrash2, $other, $thrash3)
} }
$special_day = $other['data'][0]; $special_day = $other['data'][0];
$same_day = $other['data'][1]; $day_code = $other['data'][1];
$description = $other['data'][2]; $description = $other['data'][2];
$idGroup = $other['data'][3]; $idGroup = $other['data'][3];
$id_calendar = $other['data'][4];
if (!check_acl($config['id_user'], $idGroup, 'LM', true)) { if (!check_acl($config['id_user'], $idGroup, 'LM', true)) {
returnError('forbidden', 'string'); returnError('forbidden', 'string');
@ -14695,24 +14779,22 @@ function api_set_update_special_day($id_special_day, $thrash2, $other, $thrash3)
return; return;
} }
$return = db_process_sql_update( try {
'talert_special_days', $sd = new SpecialDay();
[ $sd->date($special_day);
'date' => $special_day, $sd->id_group($idGroup);
'same_day' => $same_day, $sd->day_code($day_code);
'description' => $description, $sd->description($description);
'id_group' => $idGroup, $sd->id_calendar($id_calendar);
], $sd->save();
['id' => $id_special_day] if ($sd->save() === true) {
); returnError('Special Day could not be updated');
} else {
returnData( returnData('string', ['type' => 'string', 'data' => $sd->id()]);
'string', }
[ } catch (Exception $e) {
'type' => 'string', returnData('string', ['type' => 'string', 'data' => $e]);
'data' => (int) ((bool) $return), }
]
);
} }
@ -14758,13 +14840,20 @@ function api_set_delete_special_day($id_special_day, $thrash2, $thrash3, $thrash
return; return;
} }
$return = alerts_delete_alert_special_day($id_special_day); try {
$specialDay = new SpecialDay($id_special_day);
if (is_error($return)) { } catch (\Exception $e) {
if ($id > 0) {
returnError('The Special Day could not be deleted.'); returnError('The Special Day could not be deleted.');
} else {
returnData('string', ['type' => 'string', 'data' => $return]);
} }
return;
}
// Remove.
$specialDay->delete();
$return = 'success';
returnData('string', ['type' => 'string', 'data' => $return]);
} }

View File

@ -620,7 +620,7 @@ function config_update_config()
$error_update[] = __('Admin LDAP login'); $error_update[] = __('Admin LDAP login');
} }
if (!config_update_value('ldap_admin_pass', get_parameter('ldap_admin_pass'))) { if (!config_update_value('ldap_admin_pass', io_input_password(io_safe_output(get_parameter('ldap_admin_pass'))))) {
$error_update[] = __('Admin LDAP password'); $error_update[] = __('Admin LDAP password');
} }

View File

@ -595,7 +595,7 @@ function cron_list_table()
} }
} }
$report_type = $args[7]; $report_type = $args[8];
$report_per_agent = $args[3]; $report_per_agent = $args[3];
$report_name = $args[4]; $report_name = $args[4];
$email = $args[5]; $email = $args[5];

View File

@ -518,24 +518,25 @@ function db_get_row($table, $field_search, $condition, $fields=false, $cache=tru
* @param mixed Fields of the table to retrieve. Can be an array or a coma * @param mixed Fields of the table to retrieve. Can be an array or a coma
* separated string. All fields are retrieved by default * separated string. All fields are retrieved by default
* @param string Condition to join the filters (AND, OR). * @param string Condition to join the filters (AND, OR).
* @param boolean $cache Use cache or not.
* *
* @return mixed Array of the row or false in case of error. * @return mixed Array of the row or false in case of error.
*/ */
function db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false) function db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $historydb=false, $cache=true)
{ {
global $config; global $config;
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
return mysql_db_get_row_filter($table, $filter, $fields, $where_join, $historydb); return mysql_db_get_row_filter($table, $filter, $fields, $where_join, $historydb, $cache);
break; break;
case 'postgresql': case 'postgresql':
return postgresql_db_get_row_filter($table, $filter, $fields, $where_join); return postgresql_db_get_row_filter($table, $filter, $fields, $where_join, $historydb, $cache);
break; break;
case 'oracle': case 'oracle':
return oracle_db_get_row_filter($table, $filter, $fields, $where_join); return oracle_db_get_row_filter($table, $filter, $fields, $where_join, $historydb, $cache);
break; break;
} }

View File

@ -4662,6 +4662,8 @@ function events_page_custom_data($event)
return ''; return '';
} }
$table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->data = []; $table->data = [];
$table->head = []; $table->head = [];
@ -4669,14 +4671,31 @@ function events_page_custom_data($event)
$json_custom_data = base64_decode($event['custom_data']); $json_custom_data = base64_decode($event['custom_data']);
$custom_data = json_decode($json_custom_data); $custom_data = json_decode($json_custom_data);
if ($custom_data === null) {
// Try again because is possible that info not come coded.
$custom_data = json_decode(io_safe_output($event['custom_data']));
if ($custom_data === null) { if ($custom_data === null) {
return '<div id="extended_event_custom_data_page" class="extended_event_pages">'.__('Invalid custom data: %s', $json_custom_data).'</div>'; return '<div id="extended_event_custom_data_page" class="extended_event_pages">'.__('Invalid custom data: %s', $json_custom_data).'</div>';
} }
}
$i = 0; $i = 0;
foreach ($custom_data as $field => $value) { foreach ($custom_data as $field => $value) {
$table->data[$i][0] = io_safe_output($field); $table->data[$i][0] = ucfirst(io_safe_output($field));
if (is_array($value) === true) {
$table->data[$i][1] = '<ul>';
foreach ($value as $individualValue) {
$table->data[$i][1] .= sprintf('<li>%s</li>', $individualValue);
}
$table->data[$i][1] .= '</ul>';
} else {
$table->data[$i][1] = io_safe_output($value); $table->data[$i][1] = io_safe_output($value);
}
$i++; $i++;
} }
@ -4872,7 +4891,8 @@ function events_page_general($event)
$data = []; $data = [];
$data[0] = __('Event ID'); $data[0] = __('Event ID');
$data[1] = '#'.$event['id_evento']; $table_event_id = (isset($event['max_id_evento']) === true) ? $event['max_id_evento'] : $event['id_evento'];
$data[1] = '#'.$table_event_id;
$table_general->data[] = $data; $table_general->data[] = $data;
$data = []; $data = [];

View File

@ -2050,7 +2050,7 @@ function graphic_combined_module(
$width, $width,
$height, $height,
$color, $color,
$module_name_list, [],
$long_index, $long_index,
ui_get_full_url( ui_get_full_url(
'images/image_problem_area_small.png', 'images/image_problem_area_small.png',

View File

@ -728,7 +728,8 @@ function html_print_select(
$simple_multiple_options=false, $simple_multiple_options=false,
$required=false, $required=false,
$truncate_size=false, $truncate_size=false,
$select2_enable=true $select2_enable=true,
$multiple_select2=false
) { ) {
$output = "\n"; $output = "\n";
@ -900,7 +901,8 @@ function html_print_select(
$select2 = 'select2_dark.min'; $select2 = 'select2_dark.min';
} }
if ($multiple === false && $select2_enable === true) { // Note that multiple_select2 is introduced as a workaround to overcome the pointless limitation of preventing "multiple" select inputs from using select2 library without affecting the existing calls to this function.
if ($multiple === false && $select2_enable === true || $multiple_select2 === true) {
if (is_ajax()) { if (is_ajax()) {
$output .= '<script src="'; $output .= '<script src="';
$output .= ui_get_full_url( $output .= ui_get_full_url(
@ -2521,7 +2523,8 @@ function html_print_input_text(
$formTo='', $formTo='',
$onKeyUp='', $onKeyUp='',
$disabled=false, $disabled=false,
$list='' $list='',
$placeholder=null
) { ) {
if ($maxlength == 0) { if ($maxlength == 0) {
$maxlength = 255; $maxlength = 255;
@ -2566,6 +2569,10 @@ function html_print_input_text(
$attr['list'] = $list; $attr['list'] = $list;
} }
if ($list !== null) {
$attr['placeholder'] = $placeholder;
}
return html_print_input_text_extended( return html_print_input_text_extended(
$name, $name,
$value, $value,
@ -4035,6 +4042,10 @@ function html_print_input_file($name, $return=false, $options=false)
if (isset($options['class'])) { if (isset($options['class'])) {
$output .= ' class="'.$options['class'].'"'; $output .= ' class="'.$options['class'].'"';
} }
if (isset($options['required'])) {
$output .= ' required';
}
} }
$output .= ' />'; $output .= ' />';
@ -4548,7 +4559,8 @@ function html_print_input($data, $wrapper='div', $input_only=false)
((isset($data['form']) === true) ? $data['form'] : ''), ((isset($data['form']) === true) ? $data['form'] : ''),
((isset($data['onKeyUp']) === true) ? $data['onKeyUp'] : ''), ((isset($data['onKeyUp']) === true) ? $data['onKeyUp'] : ''),
((isset($data['disabled']) === true) ? $data['disabled'] : false), ((isset($data['disabled']) === true) ? $data['disabled'] : false),
((isset($data['list']) === true) ? $data['list'] : '') ((isset($data['list']) === true) ? $data['list'] : ''),
((isset($data['placeholder']) === true) ? $data['placeholder'] : '')
); );
break; break;

View File

@ -454,3 +454,46 @@ function get_tickets_integriaims($tickets_filters)
return $array_get_incidents; return $array_get_incidents;
} }
function integriaims_upload_file($filename, $incident_id, $file_description)
{
if ($_FILES[$filename]['name'] != '') {
$filename = io_safe_input($_FILES[$filename]['name']);
$filesize = io_safe_input($_FILES[$filename]['size']);
$extension = pathinfo($filename, PATHINFO_EXTENSION);
$invalid_extensions = '/^(bat|exe|cmd|sh|php|php1|php2|php3|php4|php5|pl|cgi|386|dll|com|torrent|js|app|jar|iso|
pif|vb|vbscript|wsf|asp|cer|csr|jsp|drv|sys|ade|adp|bas|chm|cpl|crt|csh|fxp|hlp|hta|inf|ins|isp|jse|htaccess|
htpasswd|ksh|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|ops|pcd|prg|reg|scr|sct|shb|shs|url|vbe|vbs|wsc|wsf|wsh)$/i';
if (!preg_match($invalid_extensions, $extension)) {
// The following is if you have clamavlib installed.
// (php5-clamavlib) and enabled in php.ini
// http://www.howtoforge.com/scan_viruses_with_php_clamavlib
if (extension_loaded('clamav')) {
cl_setlimits(5, 1000, 200, 0, 10485760);
$malware = cl_scanfile($_FILES['file']['tmp_name']);
if ($malware) {
$error = 'Malware detected: '.$malware.'<br>ClamAV version: '.clam_get_version();
die($error);
}
}
$filecontent = base64_encode(file_get_contents($_FILES[$filename]['tmp_name']));
$result_api_call = integria_api_call(null, null, null, null, 'attach_file', [$incident_id, $filename, $filesize, $file_description, $filecontent], false, '', '|;|');
// API method returns '0' string if success.
$file_added = ($result_api_call === '0') ? true : false;
ui_print_result_message(
$file_added,
__('File successfully added'),
__('File could not be added')
);
} else {
ui_print_error_message(__('File has an invalid extension'));
}
}
}

View File

@ -483,24 +483,16 @@ function menu_add_extras(&$menu)
$menu_extra['gusuarios']['sub']['godmode/users/configure_user']['text'] = __('Configure user'); $menu_extra['gusuarios']['sub']['godmode/users/configure_user']['text'] = __('Configure user');
$menu_extra['gusuarios']['sub']['godmode/users/configure_profile']['text'] = __('Configure profile'); $menu_extra['gusuarios']['sub']['godmode/users/configure_profile']['text'] = __('Configure profile');
$menu_extra['gservers']['sub']['godmode/servers/manage_recontask_form']['text'] = __('Manage recontask');
$menu_extra['gmodules']['sub']['godmode/modules/manage_network_templates_form']['text'] = __('Module templates management'); $menu_extra['gmodules']['sub']['godmode/modules/manage_network_templates_form']['text'] = __('Module templates management');
$menu_extra['gmodules']['sub']['enterprise/godmode/modules/manage_inventory_modules_form']['text'] = __('Inventory modules management'); $menu_extra['gmodules']['sub']['enterprise/godmode/modules/manage_inventory_modules_form']['text'] = __('Inventory modules management');
$menu_extra['gmodules']['sub']['godmode/tag/edit_tag']['text'] = __('Tags management');
$menu_extra['gagente']['sub']['godmode/agentes/configurar_agente']['text'] = __('Agents management'); $menu_extra['gagente']['sub']['godmode/agentes/configurar_agente']['text'] = __('Agents management');
$menu_extra['estado']['sub']['operation/agentes/ver_agente']['text'] = __('View agent');
$menu_extra['galertas']['sub']['godmode/alerts/configure_alert_template']['text'] = __('Configure alert template'); $menu_extra['galertas']['sub']['godmode/alerts/configure_alert_template']['text'] = __('Configure alert template');
$menu_extra['network']['sub']['operation/agentes/networkmap']['text'] = __('Manage network map');
$menu_extra['network']['sub']['operation/visual_console/render_view']['text'] = __('View visual console'); $menu_extra['network']['sub']['operation/visual_console/render_view']['text'] = __('View visual console');
$menu_extra['network']['sub']['godmode/reporting/visual_console_builder']['text'] = __('Builder visual console'); $menu_extra['network']['sub']['godmode/reporting/visual_console_builder']['text'] = __('Builder visual console');
$menu_extra['eventos']['sub']['godmode/events/events']['text'] = __('Administration events');
$menu_extra['reporting']['sub']['operation/reporting/reporting_viewer']['text'] = __('View reporting'); $menu_extra['reporting']['sub']['operation/reporting/reporting_viewer']['text'] = __('View reporting');
$menu_extra['reporting']['sub']['operation/reporting/graph_viewer']['text'] = __('Graph viewer'); $menu_extra['reporting']['sub']['operation/reporting/graph_viewer']['text'] = __('Graph viewer');
@ -516,7 +508,6 @@ function menu_add_extras(&$menu)
$menu_extra['godgismaps']['sub']['godmode/gis_maps/configure_gis_map']['text'] = __('Manage GIS Maps'); $menu_extra['godgismaps']['sub']['godmode/gis_maps/configure_gis_map']['text'] = __('Manage GIS Maps');
} }
$menu_extra['workspace']['sub']['operation/incidents/incident_statistics']['text'] = __('Incidents statistics');
$menu_extra['workspace']['sub']['operation/messages/message_edit']['text'] = __('Manage messages'); $menu_extra['workspace']['sub']['operation/messages/message_edit']['text'] = __('Manage messages');
$menu_extra['gagente']['sub']['godmode/groups/configure_group']['text'] = __('Manage groups'); $menu_extra['gagente']['sub']['godmode/groups/configure_group']['text'] = __('Manage groups');
@ -525,14 +516,9 @@ function menu_add_extras(&$menu)
$menu_extra['galertas']['sub']['godmode/alerts/configure_alert_action']['text'] = __('Manage alert actions'); $menu_extra['galertas']['sub']['godmode/alerts/configure_alert_action']['text'] = __('Manage alert actions');
$menu_extra['galertas']['sub']['godmode/alerts/configure_alert_command']['text'] = __('Manage commands'); $menu_extra['galertas']['sub']['godmode/alerts/configure_alert_command']['text'] = __('Manage commands');
$menu_extra['galertas']['sub']['enterprise/godmode/alerts/alert_correlation']['text'] = __('Manage event alerts');
$menu_extra['gservers']['sub']['enterprise/godmode/servers/manage_export_form']['text'] = __('Manage export targets'); $menu_extra['gservers']['sub']['enterprise/godmode/servers/manage_export_form']['text'] = __('Manage export targets');
$menu_extra['estado']['sub']['enterprise/godmode/services/manage_services']['text'] = __('Manage services');
$menu_extra['estado']['sub']['godmode/snmpconsole/snmp_alert']['text'] = __('SNMP alerts');
$menu_extra['estado']['sub']['godmode/snmpconsole/snmp_filters']['text'] = __('SNMP filters');
$menu_extra['estado']['sub']['enterprise/godmode/snmpconsole/snmp_trap_editor']['text'] = __('SNMP trap editor');
$menu_extra['estado']['sub']['snmpconsole']['sub2']['godmode/snmpconsole/snmp_trap_generator']['text'] = __('SNMP trap generator'); $menu_extra['estado']['sub']['snmpconsole']['sub2']['godmode/snmpconsole/snmp_trap_generator']['text'] = __('SNMP trap generator');
$menu_extra['estado']['sub']['snmpconsole']['sub2']['operation/snmpconsole/snmp_view']['text'] = __('SNMP console'); $menu_extra['estado']['sub']['snmpconsole']['sub2']['operation/snmpconsole/snmp_view']['text'] = __('SNMP console');
@ -588,6 +574,10 @@ function menu_get_sec($with_categories=false)
} }
} }
if ($k === 'discovery') {
$in_godmode = true;
}
if ($in_godmode) { if ($in_godmode) {
$category = __('Administration'); $category = __('Administration');
} else { } else {
@ -658,12 +648,10 @@ function menu_get_sec_pages($sec, $menu_hash=false)
foreach ($menu[$sec]['sub'] as $k => $v) { foreach ($menu[$sec]['sub'] as $k => $v) {
// Avoid special cases of standalone windows. // Avoid special cases of standalone windows.
if (preg_match('/^javascript:/', $k) || preg_match('/\.php/', $k)) { if (preg_match('/^javascript:/', $k) || preg_match('/\.php/', $k)) {
if ($sec !== 'links') {
continue; continue;
} }
}
// If this value has various parameters, we only get the first.
$k = explode('&', $k);
$k = $k[0];
$sec2_array[$k] = $v['text']; $sec2_array[$k] = $v['text'];
} }
@ -695,6 +683,7 @@ function menu_get_sec2_pages($sec, $sec2, $menu_hash=false)
} }
$sec3_array = []; $sec3_array = [];
$sec2 = io_safe_output($sec2);
if (isset($menu[$sec]['sub']) && isset($menu[$sec]['sub'][$sec2]['sub2'])) { if (isset($menu[$sec]['sub']) && isset($menu[$sec]['sub'][$sec2]['sub2'])) {
// Get the sec2 of the subsections. // Get the sec2 of the subsections.
@ -719,10 +708,6 @@ function menu_sec2_in_sec($sec, $sec2)
{ {
$sec2_array = menu_get_sec_pages($sec); $sec2_array = menu_get_sec_pages($sec);
// If this value has various parameters, we only get the first.
$sec2 = explode('&', $sec2);
$sec2 = $sec2[0];
if ($sec2_array != null && in_array($sec2, array_keys($sec2_array))) { if ($sec2_array != null && in_array($sec2, array_keys($sec2_array))) {
return true; return true;
} }
@ -735,13 +720,47 @@ function menu_sec3_in_sec2($sec, $sec2, $sec3)
{ {
$sec3_array = menu_get_sec2_pages($sec, $sec2, $menu_hash = false); $sec3_array = menu_get_sec2_pages($sec, $sec2, $menu_hash = false);
// If this value has various parameters, we only get the first.
$sec3 = explode('&', $sec3);
$sec3 = $sec3[0];
if ($sec3_array != null && in_array($sec3, array_keys($sec3_array))) { if ($sec3_array != null && in_array($sec3, array_keys($sec3_array))) {
return true; return true;
} }
return false; return false;
} }
/**
* Prepare menu data for enterprise acl conf.
*
* @param array $pages
* @param string $sec
* @return string $pages
*/
function menu_pepare_acl_select_data($pages, $sec)
{
$exclude_pages = [
'estado' => 'operation/agentes/tactical',
'network' => 'operation/agentes/networkmap_list',
'extensions' => [
'operation/extensions',
'enterprise/extensions/vmware',
'extensions/users_connected',
],
'gmodules' => 'godmode/modules/manage_network_templates',
'geventos' => 'godmode/events/events&amp;section=filter',
'gsetup' => 'godmode/setup/setup&section=general',
];
foreach ($exclude_pages as $exclude_sec => $sec2) {
if ($sec === $exclude_sec) {
if (is_array($sec2) === true) {
foreach ($sec2 as $value) {
unset($pages[$value]);
}
}
unset($pages[$sec2]);
}
}
return $pages;
}

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