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

This commit is contained in:
Daniel Cebrian 2023-03-27 12:11:59 +02:00
commit aeab39737b
218 changed files with 9919 additions and 7499 deletions

View File

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

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.769-230313"
pandora_version="7.0NG.769-230323"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1023,7 +1023,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.769';
use constant AGENT_BUILD => '230313';
use constant AGENT_BUILD => '230323';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -3749,6 +3749,7 @@ sub module_plugin ($) {
# Do not save the output if there was an error
if ($? != 0) {
log_message ('error', "plugin execution '". $command ."' exited with error code " . $?);
return ();
}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.769
%define release 230313
%define release 230323
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.769
%define release 230313
%define release 230323
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.769"
PI_BUILD="230313"
PI_BUILD="230323"
OS_NAME=`uname -s`
FORCE=0

View File

@ -6,21 +6,22 @@
#
# (c) A. Kevin Rojas <kevin.rojas@pandorafms.com>
#
# Edited in 2023 by Alejandro Sánchez <alejandro.sanchez@pandorafms.com>
#
# TO DO LIST:
# - Enable child services detection (Windows)
# - Make CPU/Memory usage available for child services (Windows)
#
###################################################
try:
from sys import argv
from sys import stderr
from sys import exit
import psutil
from subprocess import Popen
from subprocess import PIPE
from subprocess import DEVNULL
from subprocess import getstatusoutput
import psutil
except ModuleNotFoundError as err:
print("{} error: {}. Exiting...".format(argv[0], err), file=stderr)
exit(1)
@ -28,99 +29,100 @@ except ModuleNotFoundError as err:
module_list = []
VERSION = "1.2"
def win_service(servicelist, option=False, memcpu=False):
#########################################################################################
# Powershell class
#########################################################################################
class PSCheck:
@staticmethod
def check_service(servicename, option=False, memcpu=False):
"""Check services with powershell by parsing their DisplayName. Returns a dict\
list with the name of the service and a boolean with its status.\n
Requires service name (case insensitive)."""
pscall = Popen(["powershell", "Get-Service", "-Name", "'*"+ str(servicename) + "*'",
"|", "Select-Object", "-ExpandProperty", "Name"],
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
result = pscall.communicate()
result = str(result[0]).strip().split("\n")
procname = ''
if result != '':
output = []
for element in result:
if element != '':
# Get process name
procname = PSCheck.get_serviceprocess(element)
# Get process status
parstatus = PSCheck.getstatus(element)
if memcpu and parstatus == 1:
usage = get_memcpu(str(procname), str(element))
output += usage
# Generate module with name and status
parent = service_module(str(element), parstatus)
output += parent
if option:
children = PSCheck.getchildren(element, memcpu)
if isinstance(children, list) and len(children) > 1:
for child in children:
output += child
else:
output += children
else:
next
if output and element and procname:
return ({"name" : element, "process" : procname, "modules": output})
modules_default = []
modules_percentage=[]
## take all services
services=psutil.win_service_iter()
for service in services:
if service.name() in servicelist:
serv=service.as_dict()
if serv['status']=='running':
value=1
else:
return (None)
value=0
@staticmethod
def getchildren(servicename, memcpu=False):
"""Gets Dependent services of a given Windows service"""
pschild = Popen(["powershell", "Get-Service", "-Name '" + str(servicename) +
"' -DS", "|", "Select-Object", "-ExpandProperty", "Name"],
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
children = pschild.communicate()[0].strip()
kids = []
for child in (children.split("\n") if children != "" else []):
status = PSCheck.getstatus(child)
kids += service_module(str(child), status, "Service " + str(servicename) + " - Status")
if status:
if memcpu:
kidsusage = get_memcpu(str(child))
for usage in kidsusage:
kids += usage
## create module for each service
parent = build_module("Service " + str(serv['name']) + " - Status", value,"generic_proc")
modules_default +=parent
# memory and cpu percentage
if memcpu:
## process
srv_pid = service.pid()
process = psutil.Process(srv_pid)
proc_name = process.name()
##cpu
value_cpu=process.cpu_percent(interval=0.5)
parent = build_module("Service " + str(proc_name) + " - CPU usage", value_cpu,"generic_data")
parent[0].update([("unit","%"),("module_parent",str(serv['name']))])
modules_percentage +=parent
##mem
value_mem=process.memory_percent()
parent = build_module("Service " + str(proc_name) + " - Memory usage", value_mem,"generic_data")
parent[0].update([("unit","%"),("module_parent",str(serv['name']))])
modules_percentage +=parent
for module in modules_default:
print_module(module, 1)
if memcpu:
for module in modules_percentage:
print_module(module, 1)
def lnx_service(services_list, memcpu=False):
"""Creates modules for Linux servers"""
modules = []
sysctl = getstatusoutput("command -v systemctl")[0]
servic = getstatusoutput("command -v service")[0]
for srvc in services_list:
status = None
if sysctl == 0:
### Systemd available
syscall = Popen(["systemctl", "show", "-pLoadState", "-pActiveState", srvc], stdout=PIPE,
stdin=DEVNULL, universal_newlines=True)
result = syscall.communicate()
srvstatus = result[0].strip().lower().split("\n")
if srvstatus[0] == "loadstate=not-found":
next
else:
if srvstatus[1] == "activestate=active":
modules += build_module("Service " + srvc + " - Status", 1, "generic_proc")
status = 1
elif srvstatus[1] == "activestate=inactive":
modules += build_module("Service " +srvc+ " - Status", 0, "generic_proc")
status = 0
elif sysctl != 0 and servic == 0:
### Systemd not available, switch to service command
syscall = Popen(["service", srvc, "status"], stdout=PIPE,
stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
result = syscall.communicate()[0].lower()
if "is running" in result:
modules += build_module("Service " + srvc + " - Status", 1, "generic_proc")
status = 1
elif "is stopped" in result:
modules += build_module("Service " +srvc+ " - Status", 0, "generic_proc")
status = 0
else:
next
return kids
@staticmethod
def getstatus(servicename):
"""Gets the status of a given Windows service"""
running = Popen(["powershell", "Get-Service", "-Name '" + str(servicename) +
"' |", "Select-Object", "-ExpandProperty", "Status"],
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
status = running.communicate()[0].strip()
return int(status == "Running")
@staticmethod
def get_serviceprocess(servicename):
"""Gets name of the process of the service"""
service = psutil.win_service_get(servicename)
srv_pid = service.pid()
process = psutil.Process(srv_pid)
proc_name = process.name()
return proc_name
else:
print("No systemd or service commands available. Exiting...", file=stderr)
exit()
if status:
module_list.append(srvc)
if memcpu:
modules += get_memcpu(srvc, None)
for m in modules:
print_module(m, 1)
#########################################################################################
# Services creation
#########################################################################################
def service_module(name, value, parent=None):
def build_module(name, value, module_type, parent=None):
#print ("service_module BEGIN "+str(now(0,1)))
module = [{
"name" : "Service "+ name + " - Status",
"type" : "generic_proc",
"name" : name ,
"type" : module_type,
"value" : value,
"module_parent" : parent,
}]
@ -167,74 +169,6 @@ def proc_percentbyname(procname): ############# 03/03/2020
next
#print ("proc_percentbyname END "+str(now(0,1)))
return [sum(memory),sum(cpu)]
def win_service(servicelist, option=False, memcpu=False):
"""Creates modules for Windows servers."""
modules = []
for srvc in servicelist:
if srvc and len(srvc) > 2:
output = PSCheck.check_service(srvc, option, memcpu)
if output is not None and output["modules"]:
modules += PSCheck.check_service(srvc.strip(), option, memcpu)["modules"]
module_list.append(srvc)
#winprocess = output["name"]
#if memcpu == True:
# modules += get_memcpu(winprocess) ## Only available for parent service ATM.
else:
next
else:
next
for module in modules:
print_module(module, 1)
def lnx_service(services_list, memcpu=False):
"""Creates modules for Linux servers"""
modules = []
sysctl = getstatusoutput("command -v systemctl")[0]
servic = getstatusoutput("command -v service")[0]
for srvc in services_list:
status = None
if sysctl == 0:
### Systemd available
syscall = Popen(["systemctl", "show", "-pLoadState", "-pActiveState", srvc], stdout=PIPE,
stdin=DEVNULL, universal_newlines=True)
result = syscall.communicate()
srvstatus = result[0].strip().lower().split("\n")
if srvstatus[0] == "loadstate=not-found":
next
else:
if srvstatus[1] == "activestate=active":
modules += service_module(srvc, 1)
status = 1
elif srvstatus[1] == "activestate=inactive":
modules += service_module(srvc, 0)
status = 0
elif sysctl != 0 and servic == 0:
### Systemd not available, switch to service command
syscall = Popen(["service", srvc, "status"], stdout=PIPE,
stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
result = syscall.communicate()[0].lower()
if "is running" in result:
modules += service_module(srvc, 1)
status = 1
elif "is stopped" in result:
modules += service_module(srvc, 0)
status = 0
else:
next
else:
print("No systemd or service commands available. Exiting...", file=stderr)
exit()
if status:
module_list.append(srvc)
if memcpu:
modules += get_memcpu(srvc, None)
for m in modules:
print_module(m, 1)
#########################################################################################
# print_module function
#########################################################################################
@ -356,6 +290,7 @@ def main():
service_list = ["MySQL", "postgresql", "pgsql", "oracle", "MSSQL", "IISADMIN",
"apache", "nginx", "W3svc", "NTDS", "Netlogon", "DNS", "MSExchangeADTopology",
"MSExchangeServiceHost", "MSExchangeSA", "MSExchangeTransport"]
discover(OS, service_list)
elif psutil.LINUX:
OS = "Linux"

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230313}
{230323}
ViewReadme
{Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -240,7 +240,28 @@ function pandora_files_repo_operation()
}
// Header.
ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader);
ui_print_standard_header(
__('Files repository'),
'images/extensions.png',
false,
'',
false,
$onheader,
[
[
'link' => '',
'label' => __('Admin tools'),
],
[
'link' => '',
'label' => __('Extension manager'),
],
[
'link' => '',
'label' => __('Files repository'),
],
]
);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';

View File

@ -140,25 +140,26 @@ function quickShell()
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
$wiz->printForm(
[
'form' => [
'form' => [
'method' => 'POST',
'action' => '#',
],
'inputs' => [
[
'class' => 'w100p',
'arguments' => [
'name' => 'submit',
'label' => __('Retry'),
'type' => 'submit',
'attributes' => ['icon' => 'next'],
'return' => true,
],
],
'id' => 'retry_form',
],
]
);
html_print_action_buttons(
html_print_submit_button(
__('Retry'),
'submit',
false,
[
'icon' => 'next',
'form' => 'retry_form',
],
true
)
);
return;
}
@ -168,6 +169,7 @@ function quickShell()
'action' => '#',
'class' => 'wizard',
'method' => 'post',
'id' => 'connect_form',
],
'inputs' => [
[
@ -198,19 +200,24 @@ function quickShell()
'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);",
],
],
[
'arguments' => [
'type' => 'submit',
'label' => __('Connect'),
'attributes' => ['icon' => 'cog'],
],
],
],
],
false,
true
);
html_print_action_buttons(
html_print_submit_button(
__('Connect'),
'submit',
false,
[
'icon' => 'cog',
'form' => 'connect_form',
],
true
)
);
return;
}
@ -434,84 +441,95 @@ function quickShellSettings()
}
// Form. Using old style.
echo '<fieldset>';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Quickshell').'</legend>';
$t = new StdClass();
$t->data = [];
$t->width = '100%';
$t->class = 'databox filters';
$t->class = 'filter-table-adv';
$t->data = [];
$t->style = [];
$t->style[0] = 'font-weight: bold; width: 40%;';
$t->style[0] = 'width: 50%;';
$t->data[0][0] = __('Gotty path');
$t->data[0][1] = html_print_input_text(
'gotty',
$config['gotty'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Gotty path'),
html_print_input_text(
'gotty',
$config['gotty'],
'',
30,
100,
true
)
);
$t->data[1][0] = __('Gotty host');
$t->data[1][1] = html_print_input_text(
'gotty_host',
$config['gotty_host'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Gotty host'),
html_print_input_text(
'gotty_host',
$config['gotty_host'],
'',
30,
100,
true
)
);
$t->data[2][0] = __('Gotty ssh port');
$t->data[2][1] = html_print_input_text(
'gotty_ssh_port',
$config['gotty_ssh_port'],
'',
30,
100,
true
$t->data[1][] = html_print_label_input_block(
__('Gotty ssh port'),
html_print_input_text(
'gotty_ssh_port',
$config['gotty_ssh_port'],
'',
30,
100,
true
)
);
$t->data[3][0] = __('Gotty telnet port');
$t->data[3][1] = html_print_input_text(
'gotty_telnet_port',
$config['gotty_telnet_port'],
'',
30,
100,
true
$t->data[1][] = html_print_label_input_block(
__('Gotty telnet port'),
html_print_input_text(
'gotty_telnet_port',
$config['gotty_telnet_port'],
'',
30,
100,
true
)
);
$hidden = new StdClass();
$hidden = new stdClass();
$hidden->data = [];
$hidden->width = '100%';
$hidden->class = 'databox filters';
$hidden->class = 'filter-table-adv';
$hidden->data = [];
$hidden->style[0] = 'font-weight: bold;width: 40%;';
$hidden->style[0] = 'width: 50%;';
$hidden->data[0][0] = __('Gotty user');
$hidden->data[0][1] = html_print_input_text(
'gotty_user',
$config['gotty_user'],
'',
30,
100,
true
$hidden->data[0][] = html_print_label_input_block(
__('Gotty user'),
html_print_input_text(
'gotty_user',
$config['gotty_user'],
'',
30,
100,
true
)
);
$hidden->data[1][0] = __('Gotty password');
$hidden->data[1][1] = html_print_input_password(
'gotty_pass',
io_output_password($config['gotty_pass']),
'',
30,
100,
true
$hidden->data[0][] = html_print_label_input_block(
__('Gotty password'),
html_print_input_password(
'gotty_pass',
io_output_password($config['gotty_pass']),
'',
30,
100,
true
)
);
$hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true);
html_print_table($t);

View File

@ -1,5 +1,14 @@
START TRANSACTION;
ALTER TABLE `tdatabase` ADD COLUMN `ssh_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `db_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `replication_status` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `replication_delay` BIGINT DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `master` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `utimestamp` BIGINT DEFAULT 0;
ALTER TABLE `tdatabase` ADD COLUMN `mysql_version` VARCHAR(10) DEFAULT '';
ALTER TABLE `tdatabase` ADD COLUMN `pandora_version` VARCHAR(10) DEFAULT '';
UPDATE tconfig_os SET `icon_name` = 'linux@os.svg' WHERE `id_os` = 1;
UPDATE tconfig_os SET `icon_name` = 'solaris@os.svg' WHERE `id_os` = 2;
UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3;
@ -155,4 +164,17 @@ INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`, `filename`, `path`) VALUES
(20, 'zoom_en_graficas.png', 'images/tips/'),
(22, 'politica_de_pass.png', 'images/tips/');
ALTER TABLE `tusuario` ADD COLUMN `show_tips_startup` TINYINT UNSIGNED NOT NULL DEFAULT 1;
CREATE TABLE IF NOT EXISTS `tfavmenu_user` (
`id` INT NOT NULL AUTO_INCREMENT,
`id_user` VARCHAR(255) NOT NULL,
`id_element` TEXT,
`url` TEXT NOT NULL,
`label` VARCHAR(255) NOT NULL,
`section` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`));
INSERT INTO `tconfig` (`token`, `value`) VALUES ('legacy_database_ha', 1);
COMMIT;

View File

@ -407,7 +407,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
// User.
// $headerUserImage = (is_user_admin($config['id_user']) === true) ? 'images/header_user_admin_green.png' : 'images/header_user_green.png';
$headerUser = [];
$headerUser[] = html_print_image(
'images/edit_user@header.svg',

View File

@ -27,10 +27,27 @@ require_once __DIR__.'/../include/functions_ui.php';
require_once __DIR__.'/../include/functions.php';
require_once __DIR__.'/../include/functions_html.php';
echo '<style>
:root {';
if ($config['style'] === 'pandora') {
echo '--login-background-color: rgba(255, 255, 255, 0.2);';
echo '--login-label-color: #545454;';
echo '--login-text-color: #000;';
$style_theme = 'white-theme';
} else {
echo '--login-background-color: rgba(0, 0, 0, 0.8);';
echo '--login-label-color: #c5c5c5;';
echo '--login-text-color: #fff;';
$style_theme = '';
}
echo '}
</style>';
if ($config['visual_animation']) {
// form#login_form, div.login_data {
echo '<style>
div.container_login {
div.container_login {
animation: container_login 3s ease;
}
@ -120,7 +137,13 @@ if (empty($config['background_opacity']) === false) {
$opacity = 30;
}
$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba(0,0,0,.'.$opacity.'), rgba(0,0,0,.'.$opacity.")), url('".$background_url."');\"";
if ($config['style'] === 'pandora') {
$opacity_color = '255, 255, 255, .';
} else {
$opacity_color = '0, 0, 0, .';
}
$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba('.$opacity_color.$opacity.'), rgba('.$opacity_color.$opacity.")), url('".$background_url."');\"";
// Get alternative custom in case of db fail.
$custom_fields = [
@ -147,7 +170,7 @@ foreach ($custom_fields as $field) {
$docs_logo = ui_get_docs_logo();
$support_logo = ui_get_support_logo();
echo '<div id="login_body" '.$login_body_style.'>';
echo '<div id="header_login">';
echo '<div id="header_login" class="'.$style_theme.'">';
echo '<div id="list_icon_docs_support"><ul>';
@ -185,7 +208,7 @@ echo '</div>';
echo '<div class="container_login">';
echo '<div class="login_page">';
echo '<form method="post" action="'.ui_get_full_url('index.php'.$url).'" ><div class="login_logo_icon">';
echo '<form method="post" id="login_form" action="'.ui_get_full_url('index.php'.$url).'" ><div class="login_logo_icon">';
echo '<a href="'.$logo_link.'">';
if (is_metaconsole() === true) {
if (!isset($config['custom_logo_login'])) {
@ -297,7 +320,7 @@ switch ($login_screen) {
);
echo '</div>';
} else {
echo '<div class="login_nick">';
echo '<div class="login_nick '.$style_theme.'">';
html_print_input_text_extended(
'nick',
'',
@ -307,10 +330,11 @@ switch ($login_screen) {
'',
false,
'',
'autocomplete="off" placeholder="'.__('User').'"'
'autocomplete="off" class="input" placeholder=" "'
);
echo '<label for="nick" class="placeholder">'.__('User').'</label>';
echo '</div>';
echo '<div class="login_pass">';
echo '<div class="login_pass '.$style_theme.'">';
html_print_input_text_extended(
'pass',
'',
@ -320,20 +344,18 @@ switch ($login_screen) {
'',
false,
'',
'autocomplete="off" placeholder="'.__('Password').'"',
'autocomplete="off" class="input " placeholder=" " style="background-image: url(images/enable.svg);"',
false,
true
);
echo '<label for="pass" class="placeholder">'.__('Password').'</label>';
echo '</div>';
echo '<div class="login_button">';
html_print_submit_button(
__('Login'),
__('Let&#39;s go'),
'login_button',
false,
[
'fixed_id' => 'submit-login_button',
'icon' => 'signin',
]
['fixed_id' => 'submit-login_button']
);
echo '</div>';
}
@ -346,15 +368,36 @@ switch ($login_screen) {
}
}
echo '<div class="login_nick">';
echo '<div class="login_nick '.$style_theme.'">';
echo '<div>';
echo '</div>';
html_print_input_text_extended('auth_code', '', 'auth_code', '', '', '', false, '', 'class="login login_password" placeholder="'.__('Authentication code').'"', false, true);
html_print_input_text_extended(
'auth_code',
'',
'auth_code',
'',
'',
'',
false,
'',
'class="login login_password input" placeholder=" "',
false,
true
);
echo '<label for="pass" class="placeholder">'.__('Authentication code').'</label>';
echo '</div>';
echo '<div class="login_button">';
// html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, 'class="next_login"');
html_print_submit_button(__('Check code').'&nbsp;&nbsp;>', 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']);
html_print_submit_button(
__('Check code'),
'login_button',
false,
[
'fixed_id' => 'submit-login_button',
'class' => 'next_login',
]
);
echo '</div>';
break;
@ -425,39 +468,15 @@ html_print_csrf_hidden();
echo '</form></div>';
echo '<div class="login_data">';
echo '<div class ="text_banner_login">';
echo '<div><span class="span1">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title1_login']) {
echo io_safe_output($config['custom_title1_login']);
} else {
echo __('WELCOME TO %s', get_product_name());
}
} else {
echo __('WELCOME TO %s', get_product_name());
}
echo '</span></div>';
echo '<div><span class="span2">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title2_login']) {
echo io_safe_output($config['custom_title2_login']);
} else {
echo __('NEXT GENERATION');
}
} else {
echo __('NEXT GENERATION');
}
echo '</span></div>';
echo '</div>';
echo '<div class ="img_banner_login">';
echo '<div class ="img_banner_login">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if (empty($config['custom_splash_login']) === false && $config['custom_splash_login'] !== 'default') {
html_print_image(
'enterprise/images/custom_splash_login/'.$config['custom_splash_login'],
false,
[
'class' => 'splash-logo',
'alt' => 'splash',
'border' => 0,
],
@ -466,37 +485,60 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
);
} else {
echo '
<div class="loginimg-container">
<div class="lineone"></div>
<div class="linetwo"></div>
<div class="linethree"></div>
<div style="display:flex;">
<div class="towerone"></div>
<div class="towertwo"></div>
<div class="towerthree"></div>
<div class="towerfour"></div>
<div class="loginimg-container">
<div class="lineone"></div>
<div class="linetwo"></div>
<div class="linethree"></div>
<div style="display:flex;">
<div class="towerone"></div>
<div class="towertwo"></div>
<div class="towerthree"></div>
<div class="towerfour"></div>
</div>
</div>
</div>
';
';
}
} else {
echo '
<div class="loginimg-container">
<div class="lineone"></div>
<div class="linetwo"></div>
<div class="linethree"></div>
<div style="display:flex;">
<div class="towerone"></div>
<div class="towertwo"></div>
<div class="towerthree"></div>
<div class="towerfour"></div>
<div class="loginimg-container">
<div class="lineone"></div>
<div class="linetwo"></div>
<div class="linethree"></div>
<div style="display:flex;">
<div class="towerone"></div>
<div class="towertwo"></div>
<div class="towerthree"></div>
<div class="towerfour"></div>
</div>
</div>
</div>
';
';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div class ="text_banner_login">';
echo '<div><span class="span1">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title1_login']) {
echo io_safe_output($config['custom_title1_login']);
} else {
echo __('ONE TOOL TO RULE THEM ALL');
}
} else {
echo __('ONE TOOL TO RULE THEM ALL');
}
echo '</span></div>';
echo '<div><span class="span2">';
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
if ($config['custom_title2_login']) {
echo io_safe_output($config['custom_title2_login']);
}
}
echo '</span></div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';

View File

@ -184,7 +184,7 @@ if (!$double_auth_enabled
background: "black"
},
width: 500,
height: 400,
height: 'auto',
close: function (event, ui) {
// Abort the ajax request
if (typeof request != 'undefined'){

View File

@ -61,79 +61,110 @@ ui_print_warning_message(
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filter-table-adv mrgn_top_15px pdd_t_0px_important';
$table->data = [];
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->head[0] = __('Agent position');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align:center';
$table->style[0] = 'font-weight: bold; ';
$table->style[2] = 'font-weight: bold; ';
$table->size[0] = '50%';
$table->size[2] = '50%';
$table->data[1][0] = __('Latitude: ');
$table->data[1][1] = html_print_input_text_extended(
'latitude',
$agentData['stored_latitude'],
'text-latitude',
'',
20,
20,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
$table->data[1][0] = html_print_label_input_block(
__('Latitude: '),
html_print_input_text_extended(
'latitude',
$agentData['stored_latitude'],
'text-latitude',
'',
20,
20,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
)
);
$table->data[1][2] = __('Longitude: ');
$table->data[1][3] = html_print_input_text_extended(
'longitude',
$agentData['stored_longitude'],
'text-longitude',
'',
20,
20,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
$table->data[1][1] = html_print_label_input_block(
__('Longitude: '),
html_print_input_text_extended(
'longitude',
$agentData['stored_longitude'],
'text-longitude',
'',
20,
20,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
)
);
$table->data[2][0] = __('Altitude: ');
$table->data[2][1] = html_print_input_text_extended(
'altitude',
$agentData['stored_altitude'],
'text-altitude',
'',
10,
10,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
$table->data[2][0] = html_print_label_input_block(
__('Altitude: '),
html_print_input_text_extended(
'altitude',
$agentData['stored_altitude'],
'text-altitude',
'',
10,
10,
false,
'',
[
'onchange' => 'setIgnoreGISDataEnabled()',
'onkeyup' => 'setIgnoreGISDataEnabled()',
],
true
)
);
$table->data[2][2] = __('Ignore new GIS data:');
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
$table->data[2][1] = html_print_label_input_block(
__('Ignore new GIS data: '),
'<div class="flex mrgn_top_5px">'.__('Yes').' '.html_print_radio_button_extended(
'update_gis_data',
0,
'',
$updateGisData,
false,
'',
'class="mrgn_right_40px"',
true
).__('No').' '.html_print_radio_button_extended(
'update_gis_data',
1,
'',
$updateGisData,
false,
'',
'class="mrgn_right_40px"',
true
).'</div>'
);
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente;
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();'>";
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();' class='max_floating_element_size'>";
html_print_input_hidden('update_gis', 1);
html_print_table($table);
echo '<div class="action-buttons float-left" style="width: '.$table->width.';">';
html_print_submit_button(__('Update'), '', false, 'class="sub upd"');
echo '</div>';
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'',
false,
['icon' => 'wand'],
true
)
);
echo '</form>';
?>
<script type="text/javascript">

View File

@ -487,21 +487,18 @@ if (isset($groups[$grupo]) === true || $new_agent === true) {
$tableAgent->data['primary_group'][0] .= html_print_input_hidden('grupo', $grupo, true);
}
$tableAgent->data['primary_group'][0] .= html_print_div(
[
'content' => ui_print_group_icon(
$grupo,
true,
'',
($id_agente === 0) ? 'display: none;' : '',
true,
false,
false,
'after_input_icon'
),
],
true
$tableAgent->data['primary_group'][0] .= '<span id="group_preview">';
$tableAgent->data['primary_group'][0] .= ui_print_group_icon(
$grupo,
true,
'',
($id_agente === 0) ? 'display: none;' : '',
true,
false,
false,
'after_input_icon'
);
$tableAgent->data['primary_group'][0] .= '</span>';
$tableAgent->data['caption_interval'][0] = __('Interval');
// $tableAgent->rowstyle['interval'] = 'width: 260px';
@ -974,7 +971,7 @@ foreach ($fields as $field) {
$data_field[1] .= html_print_textarea(
'customvalue_'.$field['id_field'].'[]',
2,
65,
1000,
$link_text,
'class="min-height-30px w100p"',
true
@ -985,7 +982,7 @@ foreach ($fields as $field) {
$data_field[1] .= html_print_textarea(
'customvalue_'.$field['id_field'].'[]',
2,
65,
1000,
$link_url,
'class="min-height-30px w100p"',
true
@ -994,7 +991,7 @@ foreach ($fields as $field) {
$customContent = html_print_textarea(
'customvalue_'.$field['id_field'],
2,
65,
1000,
$custom_value,
'class="min-height-30px w100p"',
true
@ -1039,7 +1036,7 @@ if (empty($fields) === false) {
'',
true,
false,
'white_box white_box_opened white_table_graph_fixed',
'white_box white_box_opened white_table_graph_fixed no_border',
'no-border custom_fields_elements'
);
}

View File

@ -196,29 +196,52 @@ foreach ($nps as $row) {
$filterTable = new stdClass();
$filterTable->width = '100%';
$filterTable->class = 'fixed_filter_bar';
$filterTable->class = 'filter-table-adv';
$filterTable->size[0] = '100%';
$filterTable->data = [];
$filterTable->data[0][0] = __('Module templates');
$filterTable->data[1][0] = html_print_select($select, 'template_id', '', '', '', 0, true, false, true, '', false, 'max-width: 200px !important');
$filterTable->data[1][1] = html_print_div(
$filterTable->data[0][0] = html_print_label_input_block(
__('Module templates'),
html_print_select(
$select,
'template_id',
'',
'',
'',
0,
true,
false,
true,
'',
false,
'width: 250px '
)
);
$filterTable->data[1][0] = html_print_submit_button(
__('Assign'),
'crt',
false,
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Assign'),
'crt',
false,
[
'icon' => 'wand',
'mode' => 'secondary mini',
],
true
),
'class' => 'float-right',
'icon' => 'wand',
'mode' => 'mini',
],
true
);
$outputFilterTable = '<form style="border:0" class="fixed_filter_bar" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
$outputFilterTable .= html_print_table($filterTable, true);
$outputFilterTable = '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
$outputFilterTable .= ui_toggle(
html_print_table($filterTable, true),
'<span class="subsection_header_title">'.__('Assign').'</span>',
__('Assign'),
'assign',
true,
true,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
$outputFilterTable .= '</form>';
echo $outputFilterTable;

View File

@ -808,7 +808,7 @@ if ($id_agente) {
$pure = (int) get_parameter('pure');
if ($pure === 0) {
ui_print_standard_header(
__('Agent setup view'),
__('Agent setup view').' ( '.strtolower(agents_get_alias($id_agente)).' )',
'images/agent.png',
false,
$helper,

View File

@ -180,14 +180,26 @@ if ($load_inventory_module) {
$form_buttons = '';
if ($load_inventory_module) {
$form_buttons .= html_print_input_hidden('id_agent_module_inventory', $id_agent_module_inventory, true);
$form_buttons .= html_print_submit_button(__('Update'), 'update_inventory_module', false, 'class="sub next"', true);
$form_buttons .= html_print_submit_button(
__('Update'),
'update_inventory_module',
false,
['icon' => 'wand'],
true
);
} else {
$form_buttons .= html_print_submit_button(__('Add'), 'add_inventory_module', false, 'class="sub next"', true);
$form_buttons .= html_print_submit_button(
__('Add'),
'add_inventory_module',
false,
['icon' => 'wand'],
true
);
}
echo ui_get_inventory_module_add_form(
'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente,
$form_buttons,
html_print_action_buttons($form_buttons, [], true),
$load_inventory_module,
$id_os,
$target,
@ -213,10 +225,10 @@ if (db_get_num_rows($sql) == 0) {
} else {
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox info_table max_floating_element_size';
$table->data = [];
$table->head = [];
$table->styleTable = 'margin-top: 20px;';
$table->styleTable = '';
$table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>';
$table->head[1] = __('Name');
$table->head[2] = __('Description');

View File

@ -302,93 +302,122 @@ foreach ($pre_fields as $key => $value) {
// Filter table.
$filterTable = new stdClass();
$filterTable->class = 'fixed_filter_bar';
$filterTable->class = 'filter-table-adv w100p';
$filterTable->size[0] = '20%';
$filterTable->size[1] = '20%';
$filterTable->size[2] = '20%';
$filterTable->size[3] = '20%';
$filterTable->size[4] = '20%';
$filterTable->data = [];
$filterTable->cellstyle[0][0] = 'width:0';
$filterTable->cellstyle[0][1] = 'width:0';
$filterTable->cellstyle[0][2] = 'width:0';
$filterTable->cellstyle[0][3] = 'width:0';
$filterTable->data[0][0] = __('Group');
$filterTable->data[1][0] = html_print_select_groups(
false,
'AR',
$return_all_group,
'ag_group',
$ag_group,
'this.form.submit();',
'',
0,
true,
false,
true,
'',
false
$filterTable->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'AR',
$return_all_group,
'ag_group',
$ag_group,
'this.form.submit();',
'',
0,
true,
false,
true,
'',
false
)
);
$filterTable->data[0][1] = __('Recursion');
$filterTable->data[1][1] = html_print_checkbox_switch(
'recursion',
1,
$recursion,
true,
false,
'this.form.submit()'
$filterTable->data[0][1] = html_print_label_input_block(
__('Recursion'),
'<div class="mrgn_top_10px">'.html_print_checkbox_switch(
'recursion',
1,
$recursion,
true,
false,
'this.form.submit()'
).'</div>'
);
$filterTable->data[0][2] = __('Show agents');
$filterTable->data[1][2] = html_print_select(
$showAgentFields,
'disabled',
$disabled,
'this.form.submit()',
'',
0,
true
$filterTable->data[0][2] = html_print_label_input_block(
__('Show agents'),
html_print_select(
$showAgentFields,
'disabled',
$disabled,
'this.form.submit()',
'',
0,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
);
$filterTable->data[0][3] = __('Operating System');
$filterTable->data[1][3] = html_print_select(
$fields,
'os',
$os,
'this.form.submit()',
'All',
0,
true
$filterTable->data[0][3] = html_print_label_input_block(
__('Operating System'),
html_print_select(
$fields,
'os',
$os,
'this.form.submit()',
'All',
0,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
);
$filterTable->data[0][4] = __('Free search');
$filterTable->data[0][4] .= ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'),
true
);
$filterTable->data[1][4] = html_print_input_text(
'search',
$search,
'',
12,
255,
true
$filterTable->data[0][4] = html_print_label_input_block(
__('Free search').ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'),
true
),
html_print_input_text(
'search',
$search,
'',
12,
255,
true
)
);
$filterTable->cellstyle[1][5] = 'vertical-align: bottom';
$filterTable->data[1][5] = html_print_submit_button(
$filterTable->colspan[1][0] = 5;
$filterTable->data[1][0] = html_print_submit_button(
__('Filter'),
'srcbutton',
false,
[
'icon' => 'search',
'class' => 'float-right',
'mode' => 'secondary mini',
'class' => 'float-right mrgn_right_10px',
'mode' => 'mini',
],
true
);
// Print filter table.
echo '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
html_print_table($filterTable);
echo '</form>';
$form = '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
ui_toggle(
$form.html_print_table($filterTable, true).'</form>',
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'filter',
true,
false,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
// Data table.
$selected = true;
@ -765,7 +794,7 @@ if ($agents !== false) {
// Agent name column (1). Agent name.
$agentNameColumn = html_print_anchor(
[
'href' => ui_get_full_url($agentNameUrl),
'href' => ui_get_full_url($agentViewUrl),
'title' => $agent['nombre'],
'content' => ui_print_truncate_text($agent['alias'], 'agent_medium').implode('', $additionalDataAgentName),
],
@ -837,7 +866,6 @@ if ($agents !== false) {
// Operating System icon column.
$osIconColumn = html_print_div(
[
'class' => 'main_menu_icon invert_filter',
'content' => ui_print_os_icon($agent['id_os'], false, true),
],
true
@ -856,7 +884,6 @@ if ($agents !== false) {
// Group icon and name column.
$agentGroupIconColumn = html_print_div(
[
'class' => 'main_menu_icon invert_filter',
'content' => ui_print_group_icon($agent['id_grupo'], true),
],
true
@ -878,12 +905,12 @@ if ($agents !== false) {
$agentDisableEnableTitle = __('Enable agent');
$agentDisableEnableAction = 'enable_agent';
$agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-pause.svg';
$agentDisableEnableIcon = 'change-active.svg';
} else {
$agentDisableEnableTitle = __('Disable agent');
$agentDisableEnableAction = 'disable_agent';
$agentDisableEnableCaption = __('You are going to disable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-active.svg';
$agentDisableEnableIcon = 'change-pause.svg';
}
$agentActionButtons[] = html_print_menu_button(

View File

@ -1071,30 +1071,53 @@ if ((bool) check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === tr
echo '</form>';
}
$modalCreateModule = '<form name="create_module_form" method="post">';
$input_type = html_print_input_hidden('edit_module', 1, true);
$input_type .= html_print_select(
policies_type_modules_availables($sec2),
'moduletype',
'',
'',
'',
'',
true,
false,
false,
'',
false,
'max-width:300px;'
// Form table for Module creation.
$createModuleTable = new stdClass();
$createModuleTable->id = 'module_creation_modal';
$createModuleTable->class = 'filter-table-adv';
$createModuleTable->data = [];
$createModuleTable->data[0][] = html_print_label_input_block(
__('Select module type'),
html_print_select(
policies_type_modules_availables($sec2),
'moduletype',
'',
'',
'',
'',
true,
false,
false,
'',
false,
'max-width:300px;'
)
);
$modalCreateModule .= $input_type;
$createModuleTable->data[1][] = html_print_label_input_block(
'',
html_print_anchor(
[
'href' => 'https://pandorafms.com/Library/Library/',
'class' => 'color-black-grey invert_filter',
'content' => __('Get more modules on Monitoring Library'),
],
true
)
);
$createModuleFormTable = html_print_input_hidden('edit_module', 1, true);
$createModuleFormTable .= html_print_table($createModuleTable, true);
// Form definition.
$modalCreateModule = '<form name="create_module_form" method="post">';
$modalCreateModule .= $createModuleFormTable;
$modalCreateModule .= html_print_div(
[
'class' => 'action-buttons',
'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button(
__('Create'),
'create_module',
'modal_button_create',
false,
[
'icon' => 'next',
@ -1119,7 +1142,6 @@ html_print_div(
<script type="text/javascript">
function create_module_dialog(){
console.log('Entra');
$('#modal').dialog({
title: '<?php echo __('Create Module'); ?>',
resizable: true,

View File

@ -444,79 +444,76 @@ $tableBasicThresholds->data = [];
$tableBasicThresholds->rowclass['caption_warning_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['warning_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_warning_threshold'][0] .= __('Warning threshold').'&nbsp;';
if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'min_warning',
$min_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text(
'max_warning',
$max_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
],
[ 'class' => 'margin-top-10' ],
true
);
}
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_minmax_warning">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'min_warning',
$min_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['warning_threshold'][1] .= html_print_input_text(
'max_warning',
$max_warning,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === true,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
$basicThresholdsIntervalWarning = [];
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
'warning_inverse_string',
1,
$warning_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('warning_thresholds_checks', 'normal_warning', __('Normal'), ($percentage_warning && $warning_inverse) === false, false, '', '', true, false, '', 'radius-normal_warning'),
html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), $warning_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'),
html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), $percentage_warning, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'),
],
[ 'class' => 'margin-top-10' ],
true
);
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalWarning),
],
true
);
$basicThresholdsIntervalWarning = [];
$basicThresholdsIntervalWarning[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalWarning[] = html_print_checkbox_switch(
'warning_inverse_string',
1,
$warning_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'str_warning',
str_replace('"', '', $str_warning),
'',
10,
1024,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
}
$tableBasicThresholds->rowclass['caption_switch_warning_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalWarning),
],
true
);
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'str_warning',
str_replace('"', '', $str_warning),
'',
10,
1024,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
@ -531,87 +528,84 @@ $tableBasicThresholds->data['switch_warning_threshold'][0] .= html_print_div(
$tableBasicThresholds->rowclass['caption_critical_threshold'] = 'field_half_width pdd_t_10px';
$tableBasicThresholds->rowclass['critical_threshold'] = 'field_half_width';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= __('Critical threshold').'&nbsp;';
if ($edit_module === false && (isset($stringTypeModule) === false || $stringTypeModule === false)) {
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'min_critical',
$min_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_minmax_critical">('.__('Min / Max').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'min_critical',
$min_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
);
$tableBasicThresholds->data['critical_threshold'][1] .= html_print_input_text(
'max_critical',
$max_critical,
'',
10,
255,
true,
$disabledBecauseInPolicy || $edit === false,
false,
'',
$classdisabledBecauseInPolicy
).'</span>';
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'),
html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'),
html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
],
[ 'class' => 'margin-top-10' ],
true
);
}
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch_radio_button(
[
html_print_radio_button_extended('critical_thresholds_checks', 'normal_critical', __('Normal'), ($percentage_critical && $critical_inverse) === false, false, '', '', true, false, '', 'radius-normal_critical'),
html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), $critical_inverse, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'),
html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), $percentage_critical, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'),
],
[ 'class' => 'margin-top-10' ],
true
);
if ($edit_module === false && isset($stringTypeModule) === true && $stringTypeModule === true) {
$basicThresholdsIntervalCritical = [];
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
'critical_inverse_string',
1,
$critical_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalCritical),
],
true
);
$basicThresholdsIntervalCritical = [];
$basicThresholdsIntervalCritical[] = '<span>'.__('Inverse interval').'</span>';
$basicThresholdsIntervalCritical[] = html_print_checkbox_switch(
'critical_inverse_string',
1,
$critical_inverse,
true,
$disabledBecauseInPolicy
);
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
[
'id' => 'percentage_critical',
'content' => $divPercentageContent,
],
true
);
$tableBasicThresholds->rowclass['caption_switch_critical_inverse_string'] = 'field_half_width';
$tableBasicThresholds->data['caption_switch_critical_inverse_string'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $basicThresholdsIntervalCritical),
],
true
);
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'str_critical',
str_replace('"', '', $str_critical),
'',
10,
1024,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
}
$tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
[
'id' => 'percentage_critical',
'content' => $divPercentageContent,
],
true
);
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'str_critical',
str_replace('"', '', $str_critical),
'',
10,
1024,
true,
$disabledBecauseInPolicy,
false,
'',
$classdisabledBecauseInPolicy
);
$table_simple->rowstyle['thresholds_table'] = 'margin-top: 15px;height: 340px;width: 100%';
$table_simple->cellclass['thresholds_table'][0] = 'table_section half_section_left';
@ -1622,6 +1616,11 @@ ui_require_jquery_file('json');
/* <![CDATA[ */
$(document).ready (function () {
var disabledBecauseInPolicy = <?php echo '\''.((empty($disabledBecauseInPolicy) === true) ? '0' : '1').'\''; ?>;
var idModuleType = '<?php echo $type_names_hash[$id_module_type]; ?>';
if (idModuleType != '') {
setModuleType(idModuleType);
}
$("#right").click (function () {
jQuery.each($("select[name='id_tag_available[]'] option:selected"), function (key, value) {
tag_name = $(value).html();
@ -1906,77 +1905,50 @@ $(document).ready (function () {
$('.switch_radio_button label').on('click', function(){
var thisLabel = $(this).attr('for');
$('#'+thisLabel).attr('checked', 'checked');
$('#'+thisLabel).siblings().attr('checked', false);
$('#'+thisLabel).prop('checked', true);
$('#'+thisLabel).siblings().prop('checked', false);
if ($('#radius-warning_inverse').prop('checked') === true) {
//$('#percentage_warning').hide();
$("#svg_dinamic").show();
}
if ($('#radius-critical_inverse').prop('checked') === true) {
//$('#percentage_critical').hide();
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
$("#svg_dinamic").hide();
} else {
paint_graph_values();
$("#svg_dinamic").show();
}
if ($('#radius-percentage_warning').prop('checked') === true) {
//$('#warning_inverse').hide();
$("#svg_dinamic").hide();
$('#radius-warning_inverse').hide();
$('#label-radius-warning_inverse').hide();
}
if ($('#radius-warning_inverse').prop('checked') === true) {
$('#radius-percentage_warning').hide();
$('#label-radius-percentage_warning').hide();
}
if ($('#radius-normal_warning').prop('checked') === true) {
$('#radius-warning_inverse').show();
$('#label-radius-warning_inverse').show();
$('#radius-percentage_warning').show();
$('#label-radius-percentage_warning').show();
}
if ($('#radius-percentage_critical').prop('checked') === true) {
//$('#critical_inverse').hide();
$("#svg_dinamic").hide();
$('#radius-critical_inverse').hide();
$('#label-radius-critical_inverse').hide();
}
$('#radius-warning_inverse').change (function() {
paint_graph_values();
if ($('#radius-warning_inverse').prop('checked') === true){
$('#radius-percentage_warning').prop('checked', false);
$('#percentage_warning').attr('onClick', 'return false;');
$('#percentage_warning>em').addClass('color_666');
} else {
$('#percentage_warning').removeAttr('onClick');
$('#percentage_warning>em').removeClass('color_666');
}
});
if ($('#radius-critical_inverse').prop('checked') === true) {
$('#radius-percentage_critical').hide();
$('#label-radius-percentage_critical').hide();
}
$('#radius-critical_inverse').change (function() {
paint_graph_values();
if ($('#radius-critical_inverse').prop('checked') === true){
$('#radius-percentage_critical').prop('checked', false);
$('#percentage_critical').attr('onClick', 'return false;');
$('#percentage_critical>em').addClass('color_666');
} else {
$('#percentage_critical').removeAttr('onClick');
$('#percentage_critical>em').removeClass('color_666');
}
});
$('#radius-percentage_warning').change (function() {
paint_graph_values();
if ($('#radius-percentage_warning').prop('checked') === true){
$('#radius-warning_inverse').prop('checked', false);
$('#warning_inverse').attr('onClick', 'return false;');
$('#warning_inverse>em').addClass('color_666');
} else {
$('#warning_inverse').removeAttr('onClick');
$('#warning_inverse>em').removeClass('color_666');
}
});
$('#radius-percentage_critical').change (function() {
paint_graph_values();
if ($('#radius-percentage_critical').prop('checked') === true){
$('#radius-critical_inverse').prop('checked', false);
$('#critical_inverse').attr('onClick', 'return false;');
$('#critical_inverse>em').addClass('color_666');
} else {
$('#critical_inverse').removeAttr('onClick');
$('#critical_inverse>em').removeClass('color_666');
}
});
if ($('#radius-normal_critical').prop('checked') === true) {
$('#radius-critical_inverse').show();
$('#label-radius-critical_inverse').show();
$('#radius-percentage_critical').show();
$('#label-radius-percentage_critical').show();
}
});
@ -2235,91 +2207,66 @@ function validate_post_process() {
}
}
//function paint graph
//function paint graph.
function paint_graph_values(){
//Parse integrer
var min_w = parseFloat($('#text-min_warning').val());
if(min_w == '0.00'){ min_w = 0; }
var max_w = parseFloat($('#text-max_warning').val());
if(max_w == '0.00'){ max_w = 0; }
var min_c = parseFloat($('#text-min_critical').val());
if(min_c =='0.00'){ min_c = 0; }
var max_c = parseFloat($('#text-max_critical').val());
if(max_c =='0.00'){ max_c = 0; }
var inverse_w = $('input:radio[name=warning_inverse]:checked').val();
if(!inverse_w){ inverse_w = 0; }
var inverse_c = $('input:radio[name=critical_inverse]:checked').val();
if(!inverse_c){ inverse_c = 0; }
if(min_w == '0.00' || isNaN(min_w)){ min_w = 0; }
//inicialiced error
var max_w = parseFloat($('#text-max_warning').val());
if(max_w == '0.00' || isNaN(max_w)){ max_w = 0; }
var min_c = parseFloat($('#text-min_critical').val());
if(min_c =='0.00' || isNaN(min_c)){ min_c = 0; }
var max_c = parseFloat($('#text-max_critical').val());
if(max_c =='0.00' || isNaN(max_c)){ max_c = 0; }
var inverse_w = $('input:radio[value=warning_inverse]:checked').val();
if(!inverse_w){ inverse_w = 0; }
var inverse_c = $('input:radio[value=critical_inverse]:checked').val();
if(!inverse_c){ inverse_c = 0; }
//inicialiced error.
var error_w = 0;
var error_c = 0;
//messages legend
//messages legend.
var legend_normal = '<?php echo __('Normal Status'); ?>';
var legend_warning = '<?php echo __('Warning Status'); ?>';
var legend_critical = '<?php echo __('Critical Status'); ?>';
//messages error
//messages error.
var message_error_warning = '<?php echo __('Please introduce a maximum warning higher than the minimun warning'); ?>';
var message_error_critical = '<?php echo __('Please introduce a maximum critical higher than the minimun critical'); ?>';
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
//Percentage selector
var percentage_w = $('#checkbox-percentage_warning').prop('checked');
var percentage_c = $('#checkbox-percentage_critical').prop('checked');
if(percentage_w == true || percentage_c == true) {
d3.select("#svg_dinamic rect").remove();
//create svg
var svg = d3.select("#svg_dinamic");
svg.selectAll("g").remove();
if (percentage_w === true) {
if(max_w < 0 || min_w < 0) {
paint_graph_status(0,0,0,0,0,0,1,0,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage);
} else {
$("#text-max_warning").removeClass("input_error");
$("#text-min_warning").removeClass("input_error");
}
}
if(percentage_c === true) {
if(max_c < 0 || min_c < 0) {
paint_graph_status(0,0,0,0,0,0,0,1,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage);
} else {
$("#text-min-critical").removeClass("input_error");
$("#text-max_critical").removeClass("input_error");
}
}
return;
} else {
$('#svg_dinamic').show();
}
//if haven't error
if(max_w == 0 || max_w > min_w){
if(max_c == 0 || max_c > min_c){
paint_graph_status(min_w, max_w, min_c, max_c, inverse_w,
inverse_c, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
paint_graph_status(
min_w, max_w, min_c, max_c, inverse_w,
inverse_c, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
} else {
error_c = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
paint_graph_status(
0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
}
} else {
error_w = 1;
paint_graph_status(0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical);
paint_graph_status(
0,0,0,0,0,0, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
}
}
/* End of relationship javascript */
/* ]]> */
</script>

View File

@ -123,7 +123,7 @@ $table->data[1][0] = html_print_label_input_block(
'w100p',
false,
'width: 100%;'
).'<span id="advanced_action" class="advanced_actions invisible"><br>'.__('Number of alerts match from').' '.html_print_input_text('fires_min', '', '', 4, 10, true).' '.__('to').' '.html_print_input_text('fires_max', '', '', 4, 10, true).'</span>'.$create_action
).'<span id="advanced_action" class="advanced_actions invisible"><br>'.__('Number of alerts match from').' '.html_print_input_text('fires_min', '', '', 4, 10, true).' '.__('to').' '.html_print_input_text('fires_max', '', '', 4, 10, true).'</span><div class="flex_justify_end">'.$create_action.'</div>'
);
$own_info = get_user_info($config['id_user']);
@ -162,7 +162,7 @@ $table->data[1][1] = html_print_label_input_block(
'w100p',
false,
'width: 100%;'
).' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a>'.$create_template
).' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a><div class="flex_justify_end">'.$create_template.'</div>'
);
$table->data[2][0] = html_print_label_input_block(

View File

@ -672,14 +672,14 @@ foreach ($simple_alerts as $alert) {
'[&hellip;]',
''
);
$data[2] .= ' <a class="template_details patatas"
$data[2] .= ' <a class="template_details"
href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">';
$data[2] .= html_print_image(
'images/zoom.png',
'images/details.svg',
true,
[
'id' => 'template-details-'.$alert['id_alert_template'],
'class' => 'img_help action_button_img invert_filter',
'class' => 'img_help main_menu_icon invert_filter',
]
);
$data[2] .= '</a> ';
@ -753,11 +753,11 @@ foreach ($simple_alerts as $alert) {
'delete',
'images/delete.svg',
1,
'padding:0px; margin-left:5px; margin-right:5px;',
'padding:0px; margin-left:5px; margin-right:5px; width: 22px;',
true,
[
'title' => __('Delete action'),
'class' => 'action_button_img invert_filter',
'class' => 'main_menu_icon invert_filter',
]
);
$data[3] .= html_print_input_hidden('delete_action', 1, true);
@ -772,7 +772,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'title' => __('Update action'),
'class' => 'action_button_img invert_filter',
'class' => 'main_menu_icon invert_filter',
'onclick' => 'show_display_update_action(\''.$action['id'].'\',\''.$alert['id'].'\',\''.$alert['id_agent_module'].'\',\''.$action_id.'\',\''.$alert['id_agent_module'].'\')',
]
);
@ -913,7 +913,7 @@ foreach ($simple_alerts as $alert) {
'enable',
'images/lightbulb_off.png',
1,
'padding:0px',
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'filter_none main_menu_icon']
);
@ -923,7 +923,7 @@ foreach ($simple_alerts as $alert) {
'disable',
'images/lightbulb.png',
1,
'padding:0px;',
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'main_menu_icon']
);
@ -941,7 +941,7 @@ foreach ($simple_alerts as $alert) {
'standby_off',
'images/bell.png',
1,
'padding:0px;',
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'invert_filter main_menu_icon']
);
@ -951,7 +951,7 @@ foreach ($simple_alerts as $alert) {
'standby_on',
'images/bell_pause.png',
1,
'padding:0px;',
'padding:0px; width: 22px; height: 22px;',
true,
['class' => 'invert_filter main_menu_icon']
);

View File

@ -484,7 +484,7 @@ if (is_metaconsole() === false) {
$buttons = [
'list' => [
'active' => false,
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/load@svg.svg', true, ['title' => __('List alerts'), 'class' => 'main_menu_icon invert_filter']).'</a>',
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('List alerts'), 'class' => 'main_menu_icon invert_filter']).'</a>',
],
'builder' => [
'active' => false,
@ -497,44 +497,46 @@ if (is_metaconsole() === false) {
$buttons = '';
}
if ($tab === 'list') {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
if ($tab !== 'alert') {
if ($tab === 'list') {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('List'),
],
]
);
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
'link' => '',
'label' => __('List'),
],
]
);
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
$buttons,
[
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Create'),
],
]
);
[
'link' => '',
'label' => __('Manage alerts'),
],
[
'link' => '',
'label' => __('Create'),
],
]
);
}
}
} else {
alerts_meta_print_header();

View File

@ -122,24 +122,24 @@ $sec = (is_metaconsole() === true) ? 'advanced' : 'galertas';
// case delete_templete action is performed.
if (!$delete_template) {
// Header.
if (is_metaconsole() === true) {
alerts_meta_print_header();
} else {
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
[],
ui_print_standard_header(
__('Alerts'),
'images/gm_alerts.png',
false,
'',
true,
[],
[
[
[
'link' => '',
'label' => __('Alert templates'),
],
]
);
}
'link' => '',
'label' => __('Alerts'),
],
[
'link' => '',
'label' => __('Alert templates'),
],
]
);
}
if ($update_template) {

View File

@ -61,13 +61,19 @@ if ($default_action != 0) {
}
// Header.
ui_print_page_header(
ui_print_standard_header(
__('Alert details'),
'images/op_alerts.png',
false,
'',
false,
''
[],
[
[
'link' => '',
'label' => __('Alerts'),
],
]
);
// TABLE DETAILS.

View File

@ -262,10 +262,7 @@ if ($is_management_allowed === true) {
[ 'icon' => 'next' ],
true
),
[
'type' => 'form_action',
'right_content' => $tablePagination,
]
[ 'right_content' => $tablePagination ]
);
echo '</form>';

View File

@ -132,7 +132,8 @@ $table->data[1][1] = '<a href="javascript:">'.html_print_image(
[
'id' => 'right',
'title' => __('Add fields to select'),
'style' => 'rotate: 180deg; width: 40px',
'style' => 'rotate: 180deg;',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
@ -141,7 +142,7 @@ $table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
[
'id' => 'left',
'title' => __('Delete fields to select'),
'style' => 'width: 40px',
'style' => '',
]
).'</a>';
@ -169,6 +170,7 @@ $table->data[1][2] .= '<a href="javascript:">'.html_print_image(
[
'onclick' => 'sortUpDown(\'up\');',
'title' => __('Move up selected fields'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$table->data[1][2] .= '<a href="javascript:">'.html_print_image(
@ -177,6 +179,7 @@ $table->data[1][2] .= '<a href="javascript:">'.html_print_image(
[
'onclick' => 'sortUpDown(\'down\');',
'title' => __('Move down selected fields'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$table->data[1][2] .= '</div></div>';

View File

@ -59,6 +59,14 @@ if ($delete) {
}
if ($result !== false) {
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_filter,
'section' => 'Events',
'id_user' => $config['id_user'],
]
);
$result = true;
} else {
$result = false;

View File

@ -714,6 +714,14 @@ if ($is_management_allowed === true
);
if ($result && (!$usedGroup['return'])) {
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_group,
'section' => 'Groups',
'id_user' => $config['id_user'],
]
);
ui_print_success_message(__('Group successfully deleted'));
} else {
ui_print_error_message(
@ -898,7 +906,6 @@ if ($tab == 'tree') {
foreach ($groups as $key => $group) {
$url_edit = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'];
$url_tactical = 'index.php?sec=gagente&sec2=godmode/groups/tactical&id_group='.$group['id_grupo'];
if (is_metaconsole()) {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups';
} else {
@ -907,7 +914,7 @@ if ($tab == 'tree') {
$table->data[$key][0] = $group['id_grupo'];
if ($is_management_allowed === true) {
$table->data[$key][1] = '<a href="'.$url_tactical.'">'.$group['nombre'].'</a>';
$table->data[$key][1] = '<a href="'.$url_edit.'">'.$group['nombre'].'</a>';
} else {
$table->data[$key][1] = $group['nombre'];
}
@ -918,7 +925,7 @@ if ($tab == 'tree') {
true,
[
'style' => '',
'class' => 'bot',
'class' => 'bot main_menu_icon invert_filter',
'alt' => io_safe_input($group['nombre']),
'title' => io_safe_input($group['nombre']),
],

View File

@ -72,8 +72,14 @@ if (is_metaconsole() === false) {
],
[
'link' => '',
'label' => __('Tactic group'),
'label' => __('Tactical group view'),
],
],
[
'id_element' => $id_group,
'url' => 'gagent&sec2=godmode/groups/tactical&id_group='.$id_group,
'label' => groups_get_name($id_group),
'section' => 'Groups',
]
);
}
@ -181,7 +187,7 @@ try {
[
'id' => 'list_agents_tactical',
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'columns' => $columns,
'column_names' => $columnNames,
'return' => true,
@ -190,6 +196,7 @@ try {
'method' => 'getAgentsByGroup',
'id_group' => $id_group,
],
'dom_elements' => 'lpfti',
'no_sortable_columns' => [-1],
'order' => [
'field' => 'alias',

View File

@ -306,21 +306,37 @@ $onheader['snmp'] = $snmptab;
$onheader['satellite'] = $satellitetab;
$onheader['services'] = $servicestab;
// Header.
if (is_metaconsole() === false) {
ui_print_page_header(
__('Bulk operations').' &raquo; '.$options[$option],
'images/gm_massive_operations.png',
false,
$help_header,
true,
$onheader,
false,
'massivemodal'
);
} else {
massive_meta_print_header();
}
ui_print_standard_header(
__('Bulk operations').' - '.$options[$option],
'images/gm_massive_operations.png',
false,
$help_header,
false,
[
$agentstab,
$modulestab,
$pluginstab,
$userstab,
$alertstab,
$policiestab,
$snmptab,
$satellitetab,
$servicestab,
],
[
[
'link' => '',
'label' => __('Configuration'),
],
[
'link' => '',
'label' => __('Bulk operations'),
],
]
);
// Checks if the PHP configuration is correctly.
if ((get_cfg_var('max_execution_time') != 0)

View File

@ -1,16 +1,31 @@
<?php
/**
* Netflow Filter view
*
* @category Netflow
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
require_once $config['homedir'].'/include/functions_ui.php';
@ -30,35 +45,29 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
$pure = get_parameter('pure', 0);
// Header
if (! defined('METACONSOLE')) {
ui_print_page_header(
__('Manage Netflow Filter'),
'images/gm_netflow.png',
false,
'',
true
);
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
if ($is_windows) {
ui_print_error_message(__('Not supported in Windows systems'));
}
} else {
$nav_bar = [
// Header.
ui_print_standard_header(
__('Manage Filters'),
'images/gm_netflow.png',
false,
'',
true,
[],
[
[
'link' => 'index.php?sec=main',
'text' => __('Main'),
'link' => '',
'label' => __('Resources'),
],
[
'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit',
'text' => __('Netflow filters'),
'link' => '',
'label' => __('Netflow filters'),
],
];
]
);
ui_meta_print_page_header($nav_bar);
ui_meta_print_header(__('Netflow filters'));
$is_windows = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
if ($is_windows === true) {
ui_print_error_message(__('Not supported in Windows systems'));
}
$delete = (bool) get_parameter('delete');
@ -190,30 +199,36 @@ foreach ($filters as $filter) {
if (check_acl_restricted_all($config['id_user'], $filter['id_group'], 'AW')) {
$table->cellclass[][3] = 'table_action_buttons';
$data[3] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'
href='".$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&delete=1&id='.$filter['id_sg']."&offset=0&pure=$pure'>".html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
$data[3] = '<a onclick="if(confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&delete=1&id='.$filter['id_sg'].'&offset=0&pure='.$pure.'">';
$data[3] .= html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']);
$data[3] .= '</a>';
}
array_push($table->data, $data);
}
if (isset($data)) {
echo "<form method='post' action='".$config['homeurl']."index.php?sec=netf&sec2=godmode/netflow/nf_edit&pure=$pure'>";
$buttons = html_print_submit_button(
__('Create filter'),
'crt',
false,
['icon' => 'wand'],
true
);
if (empty($filters) === false) {
echo '<form id="multiple_delete" method="POST" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&pure='.$pure.'">';
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
echo "<div class='right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>';
echo '</form>';
$buttons .= html_print_submit_button(__('Delete'), 'delete_btn', false, ['icon' => 'delete', 'mode' => 'secondary', 'form' => 'multiple_delete'], true);
} else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined filters') ]);
}
echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">';
echo "<div class='mrgn_right_5px right'>";
html_print_submit_button(__('Create filter'), 'crt', false, 'class="sub wand"');
echo '</div>';
html_print_action_buttons(
$buttons
);
echo '</form>';
?>
@ -221,27 +236,14 @@ echo '</form>';
<script type="text/javascript">
$( document ).ready(function() {
$('[id^=checkbox-delete_multiple]').change(function(){
if($(this).parent().parent().hasClass('checkselected')){
$(this).parent().parent().removeClass('checkselected');
$('[id^=checkbox-all_delete]').change(function() {
if ($("input[name=all_delete]").prop("checked")) {
$(".custom_checkbox_input").prop("checked", true);
}
else{
$(this).parent().parent().addClass('checkselected');
else {
$(".custom_checkbox_input").prop("checked", false);
}
});
$('[id^=checkbox-all_delete]').change(function(){
if ($("#checkbox-all_delete").prop("checked")) {
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
$(".check_delete").prop("checked", true);
}
else{
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
$(".check_delete").prop("checked", false);
}
});
});

View File

@ -1,16 +1,31 @@
<?php
/**
* Netflow Filter Editor.
*
* @category Netflow
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
require_once $config['homedir'].'/include/functions_ui.php';
@ -46,40 +61,28 @@ if ($id) {
}
}
// Header
if (! defined('METACONSOLE')) {
$buttons['edit']['text'] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit">'.html_print_image('images/list.png', true, ['title' => __('Filter list')]).'</a>';
// Header Buttons.
$buttons = [];
$buttons[] = ['text' => '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Filter list')]).'</a>'];
$buttons[] = ['text' => '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit_form">'.html_print_image('images/plus@svg.svg', true, ['title' => __('Add filter')]).'</a>'];
// Header Caption.
$headerTitle = ($id) ? __('Update filter') : __('Create filter');
$buttons['add']['text'] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit_form">'.html_print_image('images/add_mc.png', true, ['title' => __('Add filter')]).'</a>';
ui_print_page_header(
__('Netflow Filter'),
'images/gm_netflow.png',
false,
'',
true,
$buttons
);
} else {
$nav_bar = [
// Header.
ui_print_standard_header(
$headerTitle,
'images/gm_netflow.png',
false,
'',
true,
$buttons,
[
[
'link' => 'index.php?sec=main',
'text' => __('Main'),
'link' => '',
'label' => __('Netflow'),
],
[
'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit',
'text' => __('Netflow filters'),
],
[
'link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form',
'text' => __('Add filter'),
],
];
ui_meta_print_page_header($nav_bar);
ui_meta_print_header(__('Netflow filters'));
}
],
);
if ($id) {
$filter = netflow_filter_get_filter($id);
@ -127,7 +130,7 @@ if ($update) {
'advanced_filter' => $advanced_filter,
];
// Save filter args
// Save filter args.
$values['filter_args'] = netflow_get_filter_arguments($values, true);
$result = db_process_sql_update('tnetflow_filter', $values, ['id_sg' => $id]);
@ -172,83 +175,8 @@ if ($create) {
}
}
$table = new stdClass();
$table->id = 'table1';
$table->width = '100%';
$table->border = 0;
$table->cellspacing = 0;
$table->cellpadding = 0;
$table->class = 'databox filters';
$table->style[0] = 'font-weight: bold';
if (defined('METACONSOLE')) {
if ($id) {
$table->head[0] = __('Update filter');
} else {
$table->head[0] = __('Create filter');
}
$table->head_colspan[0] = 5;
$table->headstyle[0] = 'text-align: center';
}
$table->data = [];
$table->data[0][0] = '<b>'.__('Name').'</b>';
$table->data[0][1] = html_print_input_text('name', $name, false, 20, 80, true);
$own_info = get_user_info($config['id_user']);
$table->data[1][0] = '<b>'.__('Group').'</b>';
// Fix: Netflow filters have to check RW ACL
$table->data[1][1] = html_print_select_groups(
$config['id_user'],
'RW',
$own_info['is_admin'],
'assign_group',
$assign_group,
'',
'',
-1,
true,
false,
false,
'',
false,
false,
false,
false,
'id_grupo',
false,
false,
false,
'250px'
);
if ($advanced_filter != '') {
$filter_type = 1;
} else {
$filter_type = 0;
}
$table->data[2][0] = '<b>'.__('Filter:').'</b>';
$table->data[2][1] = __('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'class="mrgn_right_40px"', true);
$table->data[2][1] .= __('Advanced').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'class="mrgn_right_40px"', true);
$table->data[3][0] = __('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true);
$table->data[3][1] = html_print_input_text('ip_dst', $ip_dst, false, 40, 80, true);
$table->data[4][0] = __('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true);
$table->data[4][1] = html_print_input_text('ip_src', $ip_src, false, 40, 80, true);
$table->data[5][0] = __('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true);
$table->data[5][1] = html_print_input_text('dst_port', $dst_port, false, 40, 80, true);
$table->data[6][0] = __('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true);
$table->data[6][1] = html_print_input_text('src_port', $src_port, false, 40, 80, true);
$table->data[7][1] = html_print_textarea('advanced_filter', 4, 40, $advanced_filter, '', true);
$table->data[8][0] = '<b>'.__('Aggregate by').'</b>';
$filter_type = (empty($advanced_filter) === false) ? 1 : 0;
$aggregate_list = [
'srcip' => __('Src Ip Address'),
'dstip' => __('Dst Ip Address'),
@ -256,27 +184,194 @@ $aggregate_list = [
'dstport' => __('Dst Port'),
];
$table->data[8][1] = html_print_select($aggregate_list, 'aggregate', $aggregate, '', '', 0, true, false, true, '', false);
echo '<form method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
$table = new stdClass();
$table->id = 'table1';
$table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$table->data['first_line'][] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$name,
false,
20,
80,
true
)
);
$table->data['first_line'][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
$config['id_user'],
'RW',
$own_info['is_admin'],
'assign_group',
$assign_group,
'',
'',
-1,
true,
false,
false,
'',
false,
false,
false,
false,
'id_grupo',
false,
false,
false,
'250px'
)
);
$table->data['filter_line'][] = html_print_label_input_block(
__('Filter'),
html_print_div(
[
'class' => 'flex',
'content' => html_print_div(
[
'class' => 'flex-row-end',
'content' => __('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'class="mrgn_right_40px"', true),
],
true
).html_print_div(
[
'class' => 'flex-row-end',
'content' => __('Advanced').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'class="mrgn_right_40px"', true),
],
true
),
],
true
),
);
$table->data['filter_line'][] = html_print_label_input_block(
__('Aggregate by'),
html_print_select(
$aggregate_list,
'aggregate',
$aggregate,
'',
'',
0,
true,
false,
true,
'',
false
)
);
$table->data['ip_line'][] = html_print_label_input_block(
__('Dst Ip'),
html_print_input_text(
'ip_dst',
$ip_dst,
false,
40,
80,
true
).ui_print_input_placeholder(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true)
);
$table->data['ip_line'][] = html_print_label_input_block(
__('Src Ip'),
html_print_input_text(
'ip_src',
$ip_src,
false,
40,
80,
true
).ui_print_input_placeholder(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip:<br>25.46.157.214,160.253.135.249'), true)
);
$table->data['ports_line'][] = html_print_label_input_block(
__('Dst Port'),
html_print_input_text(
'dst_port',
$dst_port,
false,
40,
80,
true
).ui_print_input_placeholder(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true)
);
$table->data['ports_line'][] = html_print_label_input_block(
__('Src Port'),
html_print_input_text(
'src_port',
$src_port,
false,
40,
80,
true
).ui_print_input_placeholder(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22:<br>80,22'), true)
);
$table->colspan['advanced_filters'][] = 2;
$table->data['advanced_filters'][] = html_print_label_input_block(
__('Advanced filters'),
html_print_textarea('advanced_filter', 4, 40, $advanced_filter, '', true, 'w50p')
);
$hiddens = '';
if ($id) {
html_print_input_hidden('update', 1);
html_print_input_hidden('id', $id);
html_print_submit_button(__('Update'), 'crt', false, 'class="sub upd"');
$buttonTitle = __('Update');
$hiddens .= html_print_input_hidden('update', 1, true);
$hiddens .= html_print_input_hidden('id', $id, true);
} else {
html_print_input_hidden('create', 1);
html_print_submit_button(__('Create'), 'crt', false, 'class="sub wand"');
$buttonTitle = __('Create');
$hiddens .= html_print_input_hidden('create', 1, true);
}
echo '</div>';
echo '<form class="max_floating_element_size" id="nf_edit_form" method="post" action="'.$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit_form&pure='.$pure.'">';
echo $hiddens;
html_print_table($table);
echo '</form>';
html_print_action_buttons(
html_print_submit_button(
$buttonTitle,
'crt',
false,
[
'icon' => 'upd',
'form' => 'nf_edit_form',
],
true
)
);
?>
<script type="text/javascript">
$(document).ready(function(){
var filter_type = <?php echo $filter_type; ?>;
if (filter_type == 0) {
displayNormalFilter ();
}
else {
displayAdvancedFilter ();
}
});
function displayAdvancedFilter () {
console.log('papapa advanced filter');
// Erase the normal filter
document.getElementById("text-ip_dst").value = '';
document.getElementById("text-ip_src").value = '';
@ -284,34 +379,32 @@ echo '</form>';
document.getElementById("text-src_port").value = '';
// Hide the normal filter
document.getElementById("table1-3").style.display = 'none';
document.getElementById("table1-4").style.display = 'none';
document.getElementById("table1-5").style.display = 'none';
document.getElementById("table1-6").style.display = 'none';
//document.getElementById("table1-3").style.display = 'none';
//document.getElementById("table1-4").style.display = 'none';
//document.getElementById("table1-5").style.display = 'none';
//document.getElementById("table1-6").style.display = 'none';
$("#table1-ip_line").css("display", "none");
$("#table1-ports_line").css("display", "none");
// Show the advanced filter
document.getElementById("table1-7").style.display = '';
$("#table1-advanced_filters").css("display", "table-row");
//document.getElementById("table1-7").style.display = '';
};
function displayNormalFilter () {
console.log('papapa normal filter');
// Erase the advanced filter
document.getElementById("textarea_advanced_filter").value = '';
// Hide the advanced filter
document.getElementById("table1-7").style.display = 'none';
//document.getElementById("table1-7").style.display = 'none';
$("#table1-advanced_filters").css("display", "none");
// Show the normal filter
$("#table1-ip_line").css("display", "table-row");
$("#table1-ports_line").css("display", "table-row");
/*
document.getElementById("table1-3").style.display = '';
document.getElementById("table1-4").style.display = '';
document.getElementById("table1-5").style.display = '';
document.getElementById("table1-6").style.display = '';
*/
};
var filter_type = <?php echo $filter_type; ?>;
if (filter_type == 0) {
displayNormalFilter ();
}
else {
displayAdvancedFilter ();
}
</script>

View File

@ -189,6 +189,14 @@ if ($delete_layout || $copy_layout) {
'tlayout',
['id' => $id_layout]
);
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_layout,
'section' => 'Visual_Console',
'id_user' => $config['id_user'],
]
);
$auditMessage = ((bool) $result === true) ? 'Delete visual console' : 'Fail try to delete visual console';
db_pandora_audit(

View File

@ -115,6 +115,7 @@ $exception_condition_value = 10;
$modulegroup = 0;
$period = SECONDS_1DAY;
$search = '';
$full_text = 0;
$log_number = 1000;
// Added support for projection graphs.
$period_pg = SECONDS_5DAY;
@ -316,6 +317,7 @@ switch ($action) {
$source = $es['source'];
$search = $es['search'];
$log_number = empty($es['log_number']) ? $log_number : $es['log_number'];
$full_text = empty($es['full_text']) ? 0 : $es['full_text'];
break;
case 'simple_graph':
@ -1047,17 +1049,6 @@ $class = 'databox filters';
?>
<table id="table_item_edit_reporting" class="<?php echo $class; ?>" id="" border="0" cellpadding="4" cellspacing="4" width="100%">
<?php
if (defined('METACONSOLE')) {
echo '<thead>
<tr>
<th align=center colspan=5>
'.__('Item Editor').'
</th>
</tr>
</thead>';
}
?>
<tbody>
<tr id="row_type" class="datos">
<td class="bolder w220px">
@ -1324,6 +1315,14 @@ $class = 'databox filters';
<td >
<?php
html_print_input_text('search', $search, '', 40, 100);
html_print_checkbox(
'full_text',
1,
$full_text,
false,
false
);
ui_print_help_tip(__('Full context'), false);
?>
</td>
</tr>

View File

@ -201,139 +201,86 @@ if (($agentFilter == 0) && ($moduleFilter == 0) && ($typeFilter == 0)) {
$urlFilter = '&agent_filter='.$agentFilter.'&module_filter='.$moduleFilter.'&type_filter='.$typeFilter;
if (!defined('METACONSOLE')) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[1] = '33%';
$table->data[0][0] = html_print_label_input_block(
__('Agents'),
html_print_select(
$agents,
'agent_filter',
$agentFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Modules'),
html_print_select(
$modules,
'module_filter',
$moduleFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][2] = html_print_label_input_block(
__('Type'),
html_print_select(
$types,
'type_filter',
$typeFilter,
'',
__('All'),
0,
true,
false,
true,
'',
false,
'width:100%'
)
);
$form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">';
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'filter',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'filter', true);
$form .= '</form>';
ui_toggle($form, __('Filters'), '', '', false);
} else {
$table = new stdClass();
$table->width = '96%';
$table->class = 'databox_filters';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->data[0][0] = __('Agents');
$table->data[0][1] = html_print_select(
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '33%';
$table->size[1] = '33%';
$table->size[1] = '33%';
$table->data[0][0] = html_print_label_input_block(
__('Agents'),
html_print_select(
$agents,
'agent_filter',
$agentFilter,
'',
__('All'),
0,
true
);
$table->data[0][2] = __('Modules');
$table->data[0][3] = html_print_select(
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Modules'),
html_print_select(
$modules,
'module_filter',
$moduleFilter,
'',
__('All'),
0,
true
);
$table->data[0][4] = __('Type');
$table->data[0][5] = html_print_select(
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[0][2] = html_print_label_input_block(
__('Type'),
html_print_select(
$types,
'type_filter',
$typeFilter,
'',
__('All'),
0,
true
);
$table->style[6] = 'text-align:right;';
$table->data[0][6] = html_print_submit_button(
__('Filter'),
'filter',
true,
false,
'class="sub upd"',
true
).html_print_input_hidden('action', 'filter', true);
true,
'',
false,
'width:100%'
)
);
$form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">';
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'filter',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'filter', true);
$form .= '</form>';
$filters = '<form class="filters_form" method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=
list_items&action=filter&id_report='.$idReport.'">';
$filters .= html_print_table($table, true);
$filters .= '</form>';
ui_toggle($filters, __('Show Options'));
}
ui_toggle($form, __('Filters'), '', '', false);
$where = '1=1';
if ($typeFilter != '0') {
@ -412,16 +359,9 @@ $table->style[0] = 'text-align: right;';
if ($items) {
$table->width = '100%';
if (defined('METACONSOLE')) {
$table->width = '100%';
$table->class = 'databox data';
$arrow_up = 'images/sort_up.png';
$arrow_down = 'images/sort_down.png';
} else {
$table->class = 'info_table';
$arrow_up = 'images/sort_up_black.png';
$arrow_down = 'images/sort_down_black.png';
}
$table->class = 'info_table';
$arrow_up = 'images/sort_up_black.png';
$arrow_down = 'images/sort_down_black.png';
$table->size = [];
$table->size[0] = '5px';
@ -717,90 +657,65 @@ foreach ($items as $item) {
}
}
if (defined('METACONSOLE')) {
if ($items != false) {
ui_pagination($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter);
html_print_table($table);
ui_pagination($countItems, 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo "<div class='right w100p'>";
if ($items != false) {
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
html_print_table($table);
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
if (check_acl($config['id_user'], 0, 'RM')) {
html_print_input_hidden('ids_items_to_delete', '');
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete right mrgn_btn_15px"');
}
echo "<form id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo '</div>';
echo '</form>';
}
} else {
if ($items != false) {
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
html_print_table($table);
ui_pagination(
$countItems,
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
);
echo "<form id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
echo '<div class="action-buttons w100p">';
html_print_input_hidden('ids_items_to_delete', '');
$ActionButtons[] = html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'class' => 'sub ok',
'icon' => 'next',
],
true
);
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
echo '</div>';
echo '</form>';
}
echo '<div class="action-buttons w100p">';
html_print_input_hidden('ids_items_to_delete', '');
$ActionButtons[] = html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'class' => 'sub ok',
'icon' => 'next',
],
true
);
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
echo '</div>';
echo '</form>';
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
if (defined('METACONSOLE')) {
$table->colspan[0][0] = 3;
$table->size = [];
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
$table->class = 'databox data';
$table->head[0] = __('Sort items');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->data[1][0] = __('Sort selected items from position: ');
$table->data[1][1] = html_print_select_style(
$table->data[1][0] = html_print_label_input_block(
__('Sort selected items from position: '),
html_print_select_style(
[
'before' => __('Move before to'),
'after' => __('Move after to'),
],
'move_to',
'',
'',
'width:100%',
'',
'',
0,
true
);
$table->data[1][2] = html_print_input_text_extended(
true,
)
);
$table->data[1][2] = html_print_label_input_block(
__('Position'),
html_print_input_text_extended(
'position_to_sort',
1,
'text-position_to_sort',
@ -811,93 +726,42 @@ if (defined('METACONSOLE')) {
"only_numbers('position_to_sort');",
'',
true
);
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
).html_print_input_hidden('ids_items_to_sort', '', true)
);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."'
method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
html_print_table($table);
echo '</form>';
} else {
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data[1][0] = html_print_label_input_block(
__('Sort selected items from position: '),
html_print_select_style(
[
'before' => __('Move before to'),
'after' => __('Move after to'),
],
'move_to',
'',
'width:100%',
'',
'',
0,
true,
)
);
$table->data[1][2] = html_print_label_input_block(
__('Position'),
html_print_input_text_extended(
'position_to_sort',
1,
'text-position_to_sort',
'',
3,
10,
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Sort'),
'sort_submit',
false,
"only_numbers('position_to_sort');",
'',
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
).html_print_input_hidden('ids_items_to_sort', '', true)
);
),
],
true
);
$form .= html_print_input_hidden('action', 'sort_items', true);
$form .= '</form>';
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Sort'),
'sort_submit',
false,
[
'class' => 'mini',
'icon' => 'search',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= html_print_input_hidden('action', 'filter', true);
$form .= '</form>';
ui_toggle($form, __('Sort items'), '', '', false);
}
ui_toggle($form, __('Sort items'), '', '', false);
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
if (defined('METACONSOLE')) {
$table->colspan[0][0] = 3;
$table->size = [];
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
$table->class = 'databox data';
$table->head[0] = __('Delete items');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->data[1][0] = __('Delete selected items from position: ');
$table->data[1][1] = html_print_select_style(
$table->data[0][0] = html_print_label_input_block(
__('Delete selected items from position: '),
html_print_select_style(
[
'above' => __('Delete above to'),
'below' => __('Delete below to'),
@ -909,8 +773,11 @@ if (defined('METACONSOLE')) {
'',
0,
true
);
$table->data[1][2] = html_print_input_text_extended(
)
);
$table->data[0][1] = html_print_label_input_block(
__('Poisition'),
html_print_input_text_extended(
'position_to_delete',
1,
'text-position_to_delete',
@ -921,75 +788,33 @@ if (defined('METACONSOLE')) {
"only_numbers('position_to_delete');",
'',
true
);
$table->data[1][2] .= html_print_input_hidden('ids_items_to_delete', '', true);
$table->data[1][3] = html_print_submit_button(__('Delete'), 'delete_submit', false, 'class="sub upd"', true);
)
);
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
html_print_table($table);
echo '</form>';
} else {
$table->class = 'filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data[0][0] = html_print_label_input_block(
__('Delete selected items from position: '),
html_print_select_style(
[
'above' => __('Delete above to'),
'below' => __('Delete below to'),
],
'delete_m',
'',
'',
'',
'',
0,
true
)
);
$table->data[0][1] = html_print_label_input_block(
__('Poisition'),
html_print_input_text_extended(
'position_to_delete',
1,
'text-position_to_delete',
'',
3,
10,
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
$form .= html_print_input_hidden('ids_items_to_delete', '', true);
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Delete'),
'delete_submit',
false,
"only_numbers('position_to_delete');",
'',
[
'class' => 'mini',
'icon' => 'delete',
'mode' => 'secondary',
],
true
)
);
),
],
true
);
$form .= '</form>';
ui_toggle($form, __('Delete items'), '', '', false);
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
method='post'>";
$form .= html_print_input_hidden('ids_items_to_delete', '', true);
$form .= html_print_table($table, true);
$form .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Delete'),
'delete_submit',
false,
[
'class' => 'mini',
'icon' => 'delete',
'mode' => 'secondary',
],
true
),
],
true
);
$form .= '</form>';
ui_toggle($form, __('Delete items'), '', '', false);
}
?>
<script type="text/javascript">

View File

@ -70,21 +70,13 @@ $table->head = [];
$table->data = [];
$table->size = [];
if (is_metaconsole() === true) {
$table->class = 'databox filters';
$table->head[0] = __('Main data');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
$table->size[0] = '15%';
$table->size[1] = '90%';
$table->style[0] = 'font-weight: bold; vertical-align: top;';
} else {
$table->class = 'filter-table-adv databox';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->size[2] = '50%';
$table->size[3] = '50%';
}
$table->class = 'filter-table-adv databox';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->size[2] = '50%';
$table->size[3] = '50%';
$write_groups = users_get_groups_for_select(
false,
@ -95,35 +87,20 @@ $write_groups = users_get_groups_for_select(
'id_grupo'
);
if (is_metaconsole() === true) {
$table->data['name'][0] = __('Name');
$table->data['name'][1] = html_print_input_text(
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$reportName,
__('Name'),
80,
false,
100,
true,
false,
true
);
)
);
$table->data['group'][0] = __('Group');
} else {
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$reportName,
__('Name'),
false,
100,
true,
false,
true
)
);
}
// If the report group is not among the
// RW groups (special permission) we add it.
@ -137,9 +114,10 @@ if (users_can_manage_group_all('RW') === true) {
$return_all_group = true;
}
if (is_metaconsole() === true) {
$table->data['group'][1] = '<div class="w290px inline">';
$table->data['group'][1] .= html_print_input(
$table->data[0][1] = html_print_label_input_block(
__('Group'),
html_print_input(
[
'type' => 'select_groups',
'id_user' => $config['id_user'],
@ -153,28 +131,23 @@ if (is_metaconsole() === true) {
'return' => true,
'required' => true,
]
);
$table->data['group'][1] .= '</div>';
} else {
$table->data[0][1] = html_print_label_input_block(
__('Group'),
html_print_input(
[
'type' => 'select_groups',
'id_user' => $config['id_user'],
'privilege' => 'AR',
'returnAllGroup' => $return_all_group,
'name' => 'id_group',
'selected' => $idGroupReport,
'script' => '',
'nothing' => '',
'nothing_value' => '',
'return' => true,
'required' => true,
]
)
);
}
)
);
$table->colspan[1][0] = 2;
$table->data[1][0] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
if ($report_id_user == $config['id_user']
|| is_user_admin($config['id_user'])
@ -185,13 +158,12 @@ if ($report_id_user == $config['id_user']
'group_edit' => __('The next group can edit the report'),
'user_edit' => __('Only the user and admin user can edit the report'),
];
if (is_metaconsole() === true) {
$table->data['access'][0] = __('Write Access');
$table->data['access'][0] .= ui_print_help_tip(
$table->data[2][0] = html_print_label_input_block(
__('Write Access').ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
true
);
$table->data['access'][1] = html_print_select(
),
html_print_select(
$type_access,
'type_access',
$type_access_selected,
@ -199,16 +171,18 @@ if ($report_id_user == $config['id_user']
'',
0,
true
);
)
);
$class = ' invisible_important ';
if ($type_access_selected == 'group_edit') {
$class = '';
}
$options['div_class'] = 'invisible_important';
$options['div_id'] = 'group_edit';
if ($type_access_selected == 'group_edit') {
$options['div_class'] = '';
}
$table->data['access'][1] .= '<span class="access_subform'.$class.'" id="group_edit">';
$table->data['access'][1] .= '<div class="w290px inline">';
$table->data['access'][1] .= html_print_select_groups(
$table->data[2][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'RW',
false,
@ -218,48 +192,9 @@ if ($report_id_user == $config['id_user']
'',
'',
true
);
$table->data['access'][1] .= '</div>';
$table->data['access'][1] .= '</span>';
} else {
$table->data[1][0] = html_print_label_input_block(
__('Write Access').ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
true
),
html_print_select(
$type_access,
'type_access',
$type_access_selected,
'change_type_access(this)',
'',
0,
true
)
);
$options['div_class'] = 'invisible_important';
$options['div_id'] = 'group_edit';
if ($type_access_selected == 'group_edit') {
$options['div_class'] = '';
}
$table->data[1][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'RW',
false,
'id_group_edit',
$id_group_edit,
false,
'',
'',
true
),
$options
);
}
),
$options
);
}
if ($enterpriseEnable) {
@ -268,91 +203,41 @@ if ($enterpriseEnable) {
$non_interactive_check = $non_interactive;
}
if (is_metaconsole() === true) {
$table->data['interactive_report'][0] = __('Non interactive report');
$table->data['interactive_report'][1] .= html_print_checkbox_switch(
$table->data[2][1] = html_print_label_input_block(
__('Non interactive report'),
html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
true
);
} else {
$table->data[2][0] = html_print_label_input_block(
__('Non interactive report'),
html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
true
)
);
}
}
if (is_metaconsole() === true) {
$table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
'description',
2,
80,
$description,
'',
true
);
} else {
$table->data[2][1] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
}
if (enterprise_installed() === true) {
if (is_metaconsole() === true) {
$table->data['cover'][0] = __('Generate cover page in PDF render');
$table->data['cover'][1] = html_print_checkbox_switch(
$table->data[3][0] = html_print_label_input_block(
__('Generate cover page in PDF render'),
html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
);
)
);
$table->data['index'][0] = __('Generate index in PDF render');
$table->data['index'][1] = html_print_checkbox_switch(
$table->data[3][1] = html_print_label_input_block(
__('Generate index in PDF render'),
html_print_checkbox_switch(
'index_render',
1,
$index_render,
true
);
} else {
$table->data[3][0] = html_print_label_input_block(
__('Generate cover page in PDF render'),
html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
)
);
$table->data[3][1] = html_print_label_input_block(
__('Generate index in PDF render'),
html_print_checkbox_switch(
'index_render',
1,
$index_render,
true
)
);
}
)
);
}
echo '<form class="" method="post">';
html_print_table($table);

View File

@ -713,13 +713,14 @@ switch ($action) {
$table_aux = new stdClass();
$table_aux->width = '100%';
if (is_metaconsole()) {
$table_aux->class = 'databox filters';
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '30%';
$table_aux->size[1] = '30%';
$table_aux->size[2] = '30%';
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
$table_aux->data[0][1] = html_print_select_groups(
$table_aux->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
$access,
true,
@ -737,116 +738,56 @@ switch ($action) {
false,
false,
'id_grupo'
).'<br>';
)
);
$table_aux->data[0][2] = '<b>'.__('Free text for search: ');
$table_aux->data[0][2] .= ui_print_help_tip(
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
);
$table_aux->data[0][2] .= '</b>';
$table_aux->data[0][3] = html_print_input_text(
),
html_print_input_text(
__('search'),
$search,
'',
30,
'',
true
);
} else {
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '30%';
$table_aux->size[1] = '30%';
$table_aux->size[2] = '30%';
$table_aux->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
$access,
true,
'id_group',
$id_group,
'',
'',
'',
true,
false,
true,
'',
false,
'',
false,
false,
'id_grupo'
)
);
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
),
html_print_input_text(
__('search'),
$search,
'',
30,
'',
true
)
);
}
if (is_metaconsole()) {
$table_aux->data[0][6] = html_print_submit_button(
__('Search'),
'search_submit',
false,
'class="sub upd"',
true
);
}
)
);
$url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
if (is_metaconsole()) {
$filter = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$filter .= html_print_table($table_aux, true);
$filter .= '</form>';
ui_toggle($filter, __('Show Option'));
} else {
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$searchForm .= html_print_table($table_aux, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$searchForm .= html_print_table($table_aux, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
false,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
}
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
false,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('ajaxqueue');
@ -1656,11 +1597,13 @@ switch ($action) {
$agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', '');
$search = get_parameter('search', '');
$full_text = (integer) get_parameter('full_text', 0);
$log_number = get_parameter('log_number', '');
$es['source'] = $source;
$es['id_agents'] = $agents_to_report;
$es['search'] = $search;
$es['full_text'] = $full_text;
$es['log_number'] = $log_number;
$values['external_source'] = json_encode($es);
@ -2601,11 +2544,13 @@ switch ($action) {
$agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', '');
$search = get_parameter('search', '');
$full_text = (integer) get_parameter('full_text', 0);
$log_number = get_parameter('log_number', '');
$es['source'] = $source;
$es['id_agents'] = $agents_to_report;
$es['search'] = $search;
$es['full_text'] = $full_text;
$es['log_number'] = $log_number;
$values['external_source'] = json_encode($es);

View File

@ -389,7 +389,7 @@ if (empty($create) === false || empty($view) === false) {
$disabled = ($locked === true) ? 'readonly="readonly"' : '';
if (empty($create) === true) {
$formAction = 'index.php?sec=gservers&sec2=godmode/servers/plugin&tab=$tab&update_plugin=$plugin_id&pure='.$config['pure'];
$formAction = 'index.php?sec=gservers&sec2=godmode/servers/plugin&tab=$tab&update_plugin='.$plugin_id.'&pure='.$config['pure'];
} else {
$formAction = 'index.php?sec=gservers&sec2=godmode/servers/plugin&tab=$tab&create_plugin=1&pure='.$config['pure'];
}
@ -403,69 +403,61 @@ if (empty($create) === false || empty($view) === false) {
$table = new stdClass();
$table->id = 'table-form';
$table->class = 'floating_form';
$table->class = 'filter-table-adv';
$table->style = [];
$table->data['plugin_name_captions'] = $data;
$table->style[0] = 'vertical-align: top';
$table->style[1] = 'vertical-align: top';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
// General title.
$generalTitleContent = [];
$generalTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true);
$generalTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('General')], true);
$data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $generalTitleContent) ], true);
$data[0] = html_print_div([ 'class' => 'section_table_title', 'content' => __('General')], true);
$table->data['general_title'] = $data;
$data = [];
$data[0] = __('Name');
$data[0] = html_print_label_input_block(
__('Name'),
html_print_input_text('form_name', $form_name, '', 100, 255, true, false, false, '')
);
$table->data['plugin_name_captions'] = $data;
$data = [];
$data[0] = html_print_input_text('form_name', $form_name, '', 100, 255, true, false, false, '', 'w100p');
$table->data['plugin_name_inputs'] = $data;
$table->colspan['plugin_name_inputs'][0] = 3;
$data[0] = html_print_label_input_block(
__('Plugin type'),
html_print_select($formPluginType, 'form_plugin_type', $form_plugin_type, '', '', 0, true, false, true, '', false, 'width: 100%')
);
$data = [];
$data[0] = __('Plugin type');
$data[1] = __('Max. timeout');
$table->data['plugin_type_timeout_captions'] = $data;
// $table->colspan['plugin_type'][1] = 3;
$data = [];
$data[0] = html_print_select($formPluginType, 'form_plugin_type', $form_plugin_type, '', '', 0, true);
$timeoutContent = [];
$timeoutContent[] = '<div>'.html_print_extended_select_for_time('form_max_timeout', $form_max_timeout, '', '', '0', false, true).'</div>';
$timeoutContent[] = ui_print_input_placeholder(__('This value only will be applied if is minor than the server general configuration plugin timeout').'<br>'.__('If you set a 0 seconds timeout, the server plugin timeout will be used'), true);
$data[1] = html_print_div(
[
'class' => 'flex flex_column',
'content' => implode('', $timeoutContent),
],
true
$data[1] = html_print_label_input_block(
__('Max. timeout'),
html_print_div(
[
'class' => 'flex flex_column',
'content' => implode('', $timeoutContent),
],
true
)
);
$table->data['plugin_type_timeout_inputs'] = $data;
$table->data['plugin_type_timeout'] = $data;
$data = [];
$data[0] = __('Description');
$table->data['plugin_desc_captions'] = $data;
$data[0] = html_print_label_input_block(
__('Description'),
html_print_textarea('form_description', 4, 50, $form_description, '', true)
);
$data = [];
$data[0] = html_print_textarea('form_description', 4, 50, $form_description, '', true, 'w100p');
$table->colspan['plugin_desc_inputs'][0] = 3;
$table->colspan['plugin_desc_inputs'][0] = 2;
$table->data['plugin_desc_inputs'] = $data;
// Command title.
$commandTitleContent = [];
$commandTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true);
$commandTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Command')], true);
$data = [];
$data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $commandTitleContent) ], true);
$table->data['command_title'] = $data;
// Command title.
$data = [];
$data[0] = __('Plugin command').ui_print_help_tip(__('Specify interpreter and plugin path. The server needs permissions to run it.'), true);
$table->data['plugin_command_caption'] = $data;
$data[0] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Command')], true);
$table->data['command_title'] = $data;
$data = [];
$formExecuteContent = [];
@ -480,45 +472,53 @@ if (empty($create) === false || empty($view) === false) {
true
);
$data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $formExecuteContent)], true);
$data[0] = html_print_label_input_block(
__('Plugin command'),
html_print_div(['class' => 'flex-row-center', 'content' => implode('', $formExecuteContent)], true).ui_print_input_placeholder(
__('Specify interpreter and plugin path. The server needs permissions to run it.'),
true
)
);
// $data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $formExecuteContent)], true);
$table->data['plugin_command_inputs'] = $data;
$table->colspan['plugin_command_inputs'][0] = 2;
$data = [];
$data[0] = __('Plug-in parameters');
$table->data['plugin_parameters_caption'] = $data;
$data = [];
$data[0] = html_print_input_text(
'form_parameters',
$parameters,
'',
100,
255,
true,
false,
false,
'',
'command_component command_advanced_conf text_input w100p'
$data[0] = html_print_label_input_block(
__('Plug-in parameters'),
html_print_input_text(
'form_parameters',
$parameters,
'',
100,
255,
true,
false,
false,
'',
'command_component command_advanced_conf text_input'
)
);
$table->data['plugin_parameters_inputs'] = $data;
$table->colspan['plugin_parameters_inputs'][0] = 2;
$data = [];
$data[0] = __('Command preview');
$table->data['plugin_preview_captions'] = $data;
$data = [];
$data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true);
// $data[0] = __('Command preview');
// $table->data['plugin_preview_captions'] = $data;
// $data = [];
// $data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true);
$data[0] = html_print_label_input_block(
__('Command preview'),
html_print_div(['id' => 'command_preview', 'class' => 'mono'], true)
);
$table->data['plugin_preview_inputs'] = $data;
$table->colspan['plugin_preview_inputs'][0] = 2;
// Parameters macros title.
$macrosTitleContent = [];
$macrosTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true);
$macrosTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Parameters macros')], true);
$data = [];
$data[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $macrosTitleContent) ], true);
$data[0] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Parameters macros')], true);
$table->data['parameters_macros_title'] = $data;
$macros = json_decode($macros, true);
@ -563,53 +563,59 @@ if (empty($create) === false || empty($view) === false) {
}
$datam = [];
$datam[0] = __('Description')."<span class='normal_weight'> ($macro_name)</span>";
$datam[0] = html_print_label_input_block(
__('Description').'<span class="normal_weight">('.$macro_name.')</span>',
html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, false, '', "class='command_macro text_input'", true)
);
$datam[0] .= html_print_input_hidden($macro_name_name, $macro_name, true);
$datam[1] = html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, false, '', "class='command_macro text_input'", true);
$datam[2] = __('Default value')."<span class='normal_weight'> ($macro_name)</span>";
$datam[3] = html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, false, '', "class='command_component command_macro text_input'", true);
$datam[1] = html_print_label_input_block(
__('Default value').'<span class="normal_weight">('.$macro_name.')</span>',
html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, false, '', "class='command_component command_macro text_input'", true)
);
$table->data['plugin_'.$next_name_number] = $datam;
$next_name_number++;
$table->colspan['plugin_'.$next_name_number][1] = 3;
$table->colspan['plugin_'.$next_name_number][1] = 2;
$datam = [];
$datam[0] = __('Hide value').ui_print_help_tip(
__('This field will show up as dots like a password'),
true
);
$datam[1] = html_print_checkbox_extended(
$macro_hide_value_name,
1,
$macro_hide_value_value,
0,
'',
['class' => 'command_macro'],
true,
'checkbox-'.$macro_hide_value_name
$datam = html_print_label_input_block(
__('Hide value'),
html_print_checkbox_switch(
$macro_hide_value_name,
1,
$macro_hide_value_value,
0,
'',
['class' => 'command_macro'],
true,
'checkbox-'.$macro_hide_value_name
).ui_print_input_placeholder(
__('This field will show up as dots like a password'),
true
)
);
$table->data['plugin_'.$next_name_number] = $datam;
$next_name_number++;
$table->colspan['plugin_'.$next_name_number][1] = 3;
// $table->colspan['plugin_'.$next_name_number][1] = 3;
$datam = [];
$datam[0] = __('Help')."<span class='normal_weight'> ($macro_name)</span><br><br><br>";
$datam[1] = html_print_textarea(
$macro_help_name,
6,
100,
$macro_help_value,
'class="command_macro" class="w97p"',
true
$datam[0] = html_print_label_input_block(
__('Help').'<span class="normal_weight"> ('.$macro_name.')</span>',
html_print_textarea(
$macro_help_name,
6,
100,
$macro_help_value,
'class="command_macro" class="w97p"',
true
)
);
$datam[1] .= '<br><br><br>';
$table->colspan['plugin_'.$next_name_number][0] = 2;
$table->data['plugin_'.$next_name_number] = $datam;
$next_name_number++;
$i++;
@ -617,7 +623,7 @@ if (empty($create) === false || empty($view) === false) {
// Add/Delete buttons
$datam = [];
$buttons = '';
if (!$locked) {
$datam[0] = '<a id="add_macro_btn" href="javascript:;">'.'<span class="bolder">'.__('Add macro').'</span>'.'&nbsp;'.html_print_image(
'images/add.png',
@ -627,20 +633,55 @@ if (empty($create) === false || empty($view) === false) {
$datam[0] .= '<div id="next_macro" class="invisible">'.$i.'</div>';
$datam[0] .= '<div id="next_row" class="invisible">'.$next_name_number.'</div>';
$buttons = html_print_anchor(
[
'id' => 'add_macro_btn',
'href' => 'javascript:;',
'content' => html_print_image(
'images/plus@svg.svg',
true,
['class' => 'invert_filter']
),
],
true
);
$buttons .= html_print_div(['id' => 'next_macro', 'class' => 'invisible', 'content' => $i], true);
$buttons .= html_print_div(['id' => 'next_row', 'class' => 'invisible', 'content' => $next_name_number], true);
$delete_macro_style = '';
if ($i <= 2) {
$delete_macro_style = 'display:none;';
}
$datam[2] = '<div id="delete_macro_button" style="'.$delete_macro_style.'">'.'<a href="javascript:;">'.'<span class="bolder">'.__('Delete macro').'</span>'.'&nbsp;'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>'.'</div>';
// $datam[1] = '<div id="delete_macro_button" style="'.$delete_macro_style.'">'.'<a href="javascript:;">'.'<span class="bolder">'.__('Delete macro').'</span>'.'&nbsp;'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>'.'</div>';
$buttons .= html_print_anchor(
[
'id' => 'delete_macro_button',
'style' => $delete_macro_style,
'href' => 'javascript:;',
'content' => html_print_image(
'images/delete.svg',
true,
['class' => 'main_menu_icon invert_filter']
),
],
true
);
$datam[0] = html_print_div(
[
'style' => 'flex-direction: row-reverse;justify-content: flex-start;',
'content' => $buttons,
],
true
);
$table->colspan['plugin_action'][0] = 2;
$table->colspan['plugin_action'][2] = 2;
} else {
$table->colspan['plugin_action'][0] = 4;
// $table->colspan['plugin_action'][0] = 4;
}
$table->rowstyle['plugin_action'] = 'text-align:center';
// $table->rowstyle['plugin_action'] = 'text-align:center';
$table->data['plugin_action'] = $datam;

View File

@ -55,7 +55,7 @@ $iconData[] = html_print_select(
$iconData[] = html_print_div(
[
'id' => 'icon_image',
'class' => 'inverse_filter main_menu_icon',
'class' => 'invert_filter main_menu_icon',
'style' => 'margin-left: 10px',
'content' => ui_print_os_icon($idOS, false, true),
],

View File

@ -69,7 +69,6 @@ if ($is_management_allowed === true) {
$table->head[4] = '';
}
$table->align[1] = 'center';
if ($is_management_allowed === true) {
$table->align[4] = 'center';
}
@ -100,7 +99,7 @@ $table->data = [];
foreach ($osList as $os) {
$data = [];
$data[] = $os['id_os'];
$data[] = html_print_div(['class' => 'invert_filter main_menu_icon', 'content' => ui_print_os_icon($os['id_os'], false, true)], true);
$data[] = ui_print_os_icon($os['id_os'], false, true);
if ($is_management_allowed === true) {
if (is_metaconsole() === true) {
$osNameUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=builder&id_os='.$os['id_os'];
@ -133,7 +132,7 @@ foreach ($osList as $os) {
$data[] = html_print_anchor(
[
'href' => $hrefDelete,
'class' => 'inverse_filter main_menu_icon',
'class' => 'invert_filter main_menu_icon',
'content' => html_print_image('images/delete.svg', true),
],
true

View File

@ -254,188 +254,187 @@ if ($config['history_db_enabled'] == 1) {
$table = new StdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'filter-table-adv';
$table->data = [];
$table->style[0] = 'font-weight: bold';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->size[0] = '70%';
$table->size[1] = '30%';
$table->data[1][0] = __('Max. days before delete events');
$table->data[1][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['event_purge']->max,
'name' => 'event_purge',
'value' => $config['event_purge'],
'return' => true,
'min' => $performance_variables_control['event_purge']->min,
'style' => 'width:43px',
]
$table->data[0][0] = html_print_label_input_block(
__('Max. days before delete events'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['event_purge']->max,
'name' => 'event_purge',
'value' => $config['event_purge'],
'return' => true,
'min' => $performance_variables_control['event_purge']->min,
]
)
);
$table->data[2][0] = __('Max. days before delete traps');
$table->data[2][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['trap_purge']->max,
'name' => 'trap_purge',
'value' => $config['trap_purge'],
'return' => true,
'min' => $performance_variables_control['trap_purge']->min,
'style' => 'width:43px',
]
$table->data[0][1] = html_print_label_input_block(
__('Max. days before delete traps'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['trap_purge']->max,
'name' => 'trap_purge',
'value' => $config['trap_purge'],
'return' => true,
'min' => $performance_variables_control['trap_purge']->min,
]
)
);
$table->data[3][0] = __('Max. days before delete audit events');
$table->data[3][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['audit_purge']->max,
'name' => 'audit_purge',
'value' => $config['audit_purge'],
'return' => true,
'min' => $performance_variables_control['audit_purge']->min,
'style' => 'width:43px',
]
$table->data[1][0] = html_print_label_input_block(
__('Max. days before delete audit events'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['audit_purge']->max,
'name' => 'audit_purge',
'value' => $config['audit_purge'],
'return' => true,
'min' => $performance_variables_control['audit_purge']->min,
]
)
);
$table->data[4][0] = __('Max. days before delete string data');
$table->data[4][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['string_purge']->max,
'name' => 'string_purge',
'value' => $config['string_purge'],
'return' => true,
'min' => $performance_variables_control['string_purge']->min,
'style' => 'width:43px',
]
$table->data[1][1] = html_print_label_input_block(
__('Max. days before delete string data'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['string_purge']->max,
'name' => 'string_purge',
'value' => $config['string_purge'],
'return' => true,
'min' => $performance_variables_control['string_purge']->min,
]
)
);
$table->data[5][0] = __('Max. days before delete GIS data');
$table->data[5][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['gis_purge']->max,
'name' => 'gis_purge',
'value' => $config['gis_purge'],
'return' => true,
'min' => $performance_variables_control['gis_purge']->min,
'style' => 'width:43px',
]
$table->data[2][0] = html_print_label_input_block(
__('Max. days before delete GIS data'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['gis_purge']->max,
'name' => 'gis_purge',
'value' => $config['gis_purge'],
'return' => true,
'min' => $performance_variables_control['gis_purge']->min,
]
)
);
$table->data[6][0] = __('Max. days before purge');
$table->data[6][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_purge']->max,
'name' => 'days_purge',
'value' => $config['days_purge'],
'return' => true,
'min' => $performance_variables_control['days_purge']->min,
'style' => 'width:43px',
]
$table->data[2][1] = html_print_label_input_block(
__('Max. days before purge'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_purge']->max,
'name' => 'days_purge',
'value' => $config['days_purge'],
'return' => true,
'min' => $performance_variables_control['days_purge']->min,
]
)
);
$table->data[7][0] = __('Max. days before compact data');
$table->data[7][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_compact']->max,
'name' => 'days_compact',
'value' => $config['days_compact'],
'return' => true,
'min' => $performance_variables_control['days_compact']->min,
'style' => 'width:43px',
]
$table->data[3][0] = html_print_label_input_block(
__('Max. days before compact data'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_compact']->max,
'name' => 'days_compact',
'value' => $config['days_compact'],
'return' => true,
'min' => $performance_variables_control['days_compact']->min,
]
)
);
$table->data[8][0] = __('Max. days before delete unknown modules');
$table->data[8][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_delete_unknown']->max,
'name' => 'days_delete_unknown',
'value' => $config['days_delete_unknown'],
'return' => true,
'min' => $performance_variables_control['days_delete_unknown']->min,
'style' => 'width:43px',
]
$table->data[3][1] = html_print_label_input_block(
__('Max. days before delete unknown modules'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_delete_unknown']->max,
'name' => 'days_delete_unknown',
'value' => $config['days_delete_unknown'],
'return' => true,
'min' => $performance_variables_control['days_delete_unknown']->min,
]
)
);
$table->data[9][0] = __('Max. days before delete not initialized modules');
$table->data[9][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_delete_not_initialized']->max,
'name' => 'days_delete_not_initialized',
'value' => $config['days_delete_not_initialized'],
'return' => true,
'min' => $performance_variables_control['days_delete_not_initialized']->min,
'style' => 'width:43px',
]
$table->data[4][0] = html_print_label_input_block(
__('Max. days before delete not initialized modules'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_delete_not_initialized']->max,
'name' => 'days_delete_not_initialized',
'value' => $config['days_delete_not_initialized'],
'return' => true,
'min' => $performance_variables_control['days_delete_not_initialized']->min,
]
)
);
$table->data[10][0] = __('Max. days before delete autodisabled agents');
$table->data[10][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_autodisable_deletion']->max,
'name' => 'days_autodisable_deletion',
'value' => $config['days_autodisable_deletion'],
'return' => true,
'min' => $performance_variables_control['days_autodisable_deletion']->min,
'style' => 'width:43px',
]
$table->data[4][1] = html_print_label_input_block(
__('Max. days before delete autodisabled agents'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['days_autodisable_deletion']->max,
'name' => 'days_autodisable_deletion',
'value' => $config['days_autodisable_deletion'],
'return' => true,
'min' => $performance_variables_control['days_autodisable_deletion']->min,
]
)
);
$table->data[11][0] = __('Retention period of past special days');
$table->data[11][1] = html_print_input_text(
'num_past_special_days',
$config['num_past_special_days'],
'',
5,
5,
true
);
$table->data[12][0] = __('Max. macro data fields');
$table->data[12][1] = html_print_input_text(
'max_macro_fields',
$config['max_macro_fields'],
'',
5,
5,
true,
false,
false,
'onChange="change_macro_fields()"'
);
if (enterprise_installed()) {
$table->data[13][0] = __('Max. days before delete inventory data');
$table->data[13][1] = html_print_input_text(
'inventory_purge',
$config['inventory_purge'],
$table->data[5][0] = html_print_label_input_block(
__('Retention period of past special days'),
html_print_input_text(
'num_past_special_days',
$config['num_past_special_days'],
'',
5,
false,
5,
true
);
}
)
);
$table->data[5][1] = html_print_label_input_block(
__('Max. macro data fields'),
html_print_input_text(
'max_macro_fields',
$config['max_macro_fields'],
'',
false,
5,
true,
false,
false,
'onChange="change_macro_fields()"'
)
);
if ($config['history_db_enabled'] == 1) {
if (! isset($config['history_db_connection'])
@ -459,86 +458,94 @@ if ($config['history_db_enabled'] == 1) {
$table_historical = new StdClass();
$table_historical->width = '100%';
$table_historical->class = 'databox filters';
$table_historical->class = 'filter-table-adv';
$table_historical->data = [];
$table_historical->style[0] = 'font-weight: bold';
$table_historical->size[0] = '70%';
$table_historical->size[1] = '30%';
$table_historical->size[0] = '50%';
$table_historical->size[1] = '50%';
enterprise_hook('enterprise_warnings_history_days');
$table_historical->data[0][0] = __('Max. days before purge');
$table_historical->data[0][1] = html_print_input_text(
'historical_days_purge',
$config_history['days_purge'],
'',
5,
5,
true
$table_historical->data[0][0] = html_print_label_input_block(
__('Max. days before purge'),
html_print_input_text(
'historical_days_purge',
$config_history['days_purge'],
'',
false,
5,
true
)
);
$table_historical->data[1][0] = __('Max. days before compact data');
$table_historical->data[1][1] = html_print_input_text(
'historical_days_compact',
$config_history['days_compact'],
'',
5,
5,
true
$table_historical->data[0][1] = html_print_label_input_block(
__('Max. days before compact data'),
html_print_input_text(
'historical_days_compact',
$config_history['days_compact'],
'',
false,
5,
true
)
);
$table_historical->data[2][0] = __('Compact interpolation in hours (1 Fine-20 bad)');
$table_historical->data[2][1] = html_print_input_text(
'historical_step_compact',
$config_history['step_compact'],
'',
5,
5,
true
$table_historical->data[1][0] = html_print_label_input_block(
__('Compact interpolation in hours (1 Fine-20 bad)'),
html_print_input_text(
'historical_step_compact',
$config_history['step_compact'],
'',
false,
5,
true
)
);
$table_historical->data[3][0] = __('Max. days before delete events');
$table_historical->data[3][1] = html_print_input_text(
'historical_event_purge',
$config_history['event_purge'],
'',
5,
5,
true
$table_historical->data[1][1] = html_print_label_input_block(
__('Max. days before delete events'),
html_print_input_text(
'historical_event_purge',
$config_history['event_purge'],
'',
false,
5,
true
)
);
$table_historical->data[4][0] = __('Max. days before delete string data');
$table_historical->data[4][1] = html_print_input_text(
'historical_string_purge',
$config_history['string_purge'],
'',
5,
5,
true
$table_historical->data[2][0] = html_print_label_input_block(
__('Max. days before delete string data'),
html_print_input_text(
'historical_string_purge',
$config_history['string_purge'],
'',
5,
5,
true
)
);
$table_historical->data[4][1] .= html_print_input_hidden(
$table_historical->data[2][0] .= html_print_input_hidden(
'historical_history_db_enabled',
0,
true
);
}
$table->data[] = [
$table->data[6][0] = html_print_label_input_block(
__('Max. days before delete old messages'),
html_print_input_text(
'delete_old_messages',
$config['delete_old_messages'],
'',
5,
false,
5,
true
),
];
)
);
$table->data[] = [
$table->data[6][1] = html_print_label_input_block(
__('Max. days before delete old network matrix data'),
html_print_input(
[
@ -549,55 +556,71 @@ $table->data[] = [
'value' => $config['delete_old_network_matrix'],
'return' => true,
'min' => $performance_variables_control['delete_old_network_matrix']->min,
'style' => 'width:43px',
]
),
];
)
);
if (enterprise_installed()) {
$table->data[7][0] = html_print_label_input_block(
__('Max. days before delete inventory data'),
html_print_input_text(
'inventory_purge',
$config['inventory_purge'],
'',
false,
5,
true
)
);
}
$table_other = new stdClass();
$table_other->width = '100%';
$table_other->class = 'databox filters';
$table_other->class = 'filter-table-adv';
$table_other->data = [];
$table_other->style[0] = 'font-weight: bold';
$table_other->size[0] = '70%';
$table_other->size[1] = '30%';
$i = 0;
$table_other->data[$i][0] = __('Item limit for realtime reports');
$table_other->data[$i++][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['report_limit']->max,
'name' => 'report_limit',
'value' => $config['report_limit'],
'return' => true,
'min' => $performance_variables_control['report_limit']->min,
'style' => 'width:43px',
]
$table_other->size[0] = '50%';
$table_other->size[1] = '50%';
$table_other->data[0][0] = html_print_label_input_block(
__('Item limit for realtime reports'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['report_limit']->max,
'name' => 'report_limit',
'value' => $config['report_limit'],
'return' => true,
'min' => $performance_variables_control['report_limit']->min,
]
)
);
$table_other->data[$i][0] = __('Limit of events per query');
$table_other->data[$i++][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => 10000,
'name' => 'events_per_query',
'value' => $config['events_per_query'],
'return' => true,
'style' => 'width:50px',
]
$table_other->data[0][1] = html_print_label_input_block(
__('Limit of events per query'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => 10000,
'name' => 'events_per_query',
'value' => $config['events_per_query'],
'return' => true,
]
)
);
$table_other->data[$i][0] = __('Compact interpolation in hours (1 Fine-20 bad)');
$table_other->data[$i++][1] = html_print_input_text(
'step_compact',
$config['step_compact'],
'',
5,
5,
true
$table_other->data[1][0] = html_print_label_input_block(
__('Compact interpolation in hours (1 Fine-20 bad)'),
html_print_input_text(
'step_compact',
$config['step_compact'],
'',
false,
5,
true
)
);
$intervals = [];
@ -610,140 +633,172 @@ $intervals[SECONDS_1WEEK] = __('Last week');
$intervals[SECONDS_2WEEK] = __('2 weeks');
$intervals[SECONDS_1MONTH] = __('Last month');
$table_other->data[$i][0] = __('Default hours for event view');
$table_other->data[$i++][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['event_view_hr']->max,
'name' => 'event_view_hr',
'value' => $config['event_view_hr'],
'return' => true,
'min' => $performance_variables_control['event_view_hr']->min,
'style' => 'width:43px',
]
$table_other->data[1][1] = html_print_label_input_block(
__('Default hours for event view'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['event_view_hr']->max,
'name' => 'event_view_hr',
'value' => $config['event_view_hr'],
'return' => true,
'min' => $performance_variables_control['event_view_hr']->min,
]
)
);
$table_other->data[$i][0] = __('Use realtime statistics');
$table_other->data[$i++][1] = html_print_checkbox_switch(
'realtimestats',
1,
$config['realtimestats'],
true
$table_other->data[2][0] = html_print_label_input_block(
__('Use realtime statistics'),
html_print_checkbox_switch(
'realtimestats',
1,
$config['realtimestats'],
true
)
);
$table_other->data[$i][0] = __('Batch statistics period (secs)');
$table_other->data[$i++][1] = html_print_input_text(
'stats_interval',
$config['stats_interval'],
'',
5,
5,
true
$table_other->data[2][1] = html_print_label_input_block(
__('Batch statistics period (secs)'),
html_print_input_text(
'stats_interval',
$config['stats_interval'],
'',
false,
5,
true
)
);
$table_other->data[$i][0] = __('Use agent access graph');
$table_other->data[$i++][1] = html_print_checkbox_switch('agentaccess', 1, $config['agentaccess'], true, $disable_agentaccess);
$table_other->data[$i][0] = __('Max. recommended number of files in attachment directory');
$table_other->data[$i++][1] = html_print_input_text(
'num_files_attachment',
$config['num_files_attachment'],
'',
5,
5,
true
$table_other->data[3][0] = html_print_label_input_block(
__('Use agent access graph'),
html_print_checkbox_switch(
'agentaccess',
1,
$config['agentaccess'],
true,
$disable_agentaccess
)
);
$table_other->data[$i][0] = __('Delete not init modules');
$table_other->data[$i++][1] = html_print_checkbox_switch('delete_notinit', 1, $config['delete_notinit'], true);
$table_other->data[$i][0] = __('Big Operation Step to purge old data');
$table_other->data[$i++][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['big_operation_step_datos_purge']->max,
'name' => 'big_operation_step_datos_purge',
'value' => $config['big_operation_step_datos_purge'],
'return' => true,
'min' => $performance_variables_control['big_operation_step_datos_purge']->min,
'style' => 'width:50px',
]
$table_other->data[3][1] = html_print_label_input_block(
__('Max. recommended number of files in attachment directory'),
html_print_input_text(
'num_files_attachment',
$config['num_files_attachment'],
'',
false,
5,
true
)
);
$table_other->data[$i][0] = __('Small Operation Step to purge old data');
$table_other->data[$i++][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['small_operation_step_datos_purge']->max,
'name' => 'small_operation_step_datos_purge',
'value' => $config['small_operation_step_datos_purge'],
'return' => true,
'min' => $performance_variables_control['small_operation_step_datos_purge']->min,
'style' => 'width:50px',
]
$table_other->data[4][0] = html_print_label_input_block(
__('Delete not init modules'),
html_print_checkbox_switch(
'delete_notinit',
1,
$config['delete_notinit'],
true
)
);
$table_other->data[$i][0] = __('Graph container - Max. Items');
$table_other->data[$i++][1] = html_print_input_text(
'max_graph_container',
$config['max_graph_container'],
'',
5,
5,
true
$table_other->data[4][1] = html_print_label_input_block(
__('Big Operation Step to purge old data'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['big_operation_step_datos_purge']->max,
'name' => 'big_operation_step_datos_purge',
'value' => $config['big_operation_step_datos_purge'],
'return' => true,
'min' => $performance_variables_control['big_operation_step_datos_purge']->min,
]
)
);
$table_other->data[$i][0] = __('Events response max. execution');
$table_other->data[$i++][1] = html_print_input_text(
'max_execution_event_response',
$config['max_execution_event_response'],
'',
5,
5,
true
$table_other->data[5][0] = html_print_label_input_block(
__('Small Operation Step to purge old data'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['small_operation_step_datos_purge']->max,
'name' => 'small_operation_step_datos_purge',
'value' => $config['small_operation_step_datos_purge'],
'return' => true,
'min' => $performance_variables_control['small_operation_step_datos_purge']->min,
]
)
);
$table_other->data[$i][0] = __('Row limit in csv log');
$table_other->data[$i++][1] = html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['row_limit_csv']->max,
'name' => 'row_limit_csv',
'value' => $config['row_limit_csv'],
'return' => true,
'min' => $performance_variables_control['row_limit_csv']->min,
'style' => 'width:63px',
]
$table_other->data[5][1] = html_print_label_input_block(
__('Graph container - Max. Items'),
html_print_input_text(
'max_graph_container',
$config['max_graph_container'],
'',
false,
5,
true
)
);
$table_other->data[$i][0] = __('SNMP walk binary');
$table_other->data[$i++][1] = html_print_input_text(
'snmpwalk',
$config['snmpwalk'],
'',
50,
10,
true
$table_other->data[6][0] = html_print_label_input_block(
__('Events response max. execution'),
html_print_input_text(
'max_execution_event_response',
$config['max_execution_event_response'],
'',
false,
5,
true
)
);
$table_other->data[6][1] = html_print_label_input_block(
__('Row limit in csv log'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['row_limit_csv']->max,
'name' => 'row_limit_csv',
'value' => $config['row_limit_csv'],
'return' => true,
'min' => $performance_variables_control['row_limit_csv']->min,
]
)
);
$table_other->data[7][0] = html_print_label_input_block(
__('SNMP walk binary'),
html_print_input_text(
'snmpwalk',
$config['snmpwalk'],
'',
false,
10,
true
)
);
$tip = ui_print_help_tip(
__('SNMP bulk walk is not able to request V1 SNMP, this option will be used instead (by default snmpwalk, slower).'),
true
);
$table_other->data[$i][0] = __('SNMP walk binary (fallback)').$tip;
$table_other->data[$i++][1] = html_print_input_text(
'snmpwalk_fallback',
$config['snmpwalk_fallback'],
'',
50,
10,
true
$table_other->data[7][1] = html_print_label_input_block(
__('SNMP walk binary (fallback)').$tip,
html_print_input_text(
'snmpwalk_fallback',
$config['snmpwalk_fallback'],
'',
false,
10,
true
)
);
$tip = ui_print_help_tip(
@ -754,41 +809,45 @@ $tip = ui_print_help_tip(
true
);
$table_other->data[$i][0] = __('WMI binary');
$table_other->data[$i++][1] = html_print_input_text(
'wmiBinary',
$config['wmiBinary'],
'',
50,
50,
true
$table_other->data[8][0] = html_print_label_input_block(
__('WMI binary'),
html_print_input_text(
'wmiBinary',
$config['wmiBinary'],
'',
false,
50,
true
)
);
// Agent Wizard defaults.
$defaultAgentWizardOptions = json_decode(io_safe_output($config['agent_wizard_defaults']));
$tableSnmpWizard = new stdClass();
$tableSnmpWizard->width = '100%';
$tableSnmpWizard->class = 'databox filters';
$tableSnmpWizard->class = 'filter-table-adv';
$tableSnmpWizard->data = [];
$tableSnmpWizard->style[0] = 'font-weight: bold';
$tableSnmpWizard->style[2] = 'font-weight: bold';
$tableSnmpWizard->size[0] = '30%';
$tableSnmpWizard->size[2] = '30%';
$tableSnmpWizard->size[0] = '50%';
$tableSnmpWizard->size[1] = '50%';
$i = 0;
$j = 0;
foreach ($defaultAgentWizardOptions as $key => $value) {
$tableSnmpWizard->data[$i][$j++] = $key;
$tableSnmpWizard->data[$i][$j++] = html_print_checkbox_switch('agent_wizard_defaults_'.$key, 1, $value, true);
if ($j >= 3) {
$j = 0;
$i++;
if ($i > 1) {
$i = 0;
$j++;
}
$tableSnmpWizard->data[$j][$i] = html_print_label_input_block(
$key,
html_print_checkbox_switch('agent_wizard_defaults_'.$key, 1, $value, true)
);
$i++;
}
echo '<form id="form_setup" method="post">';
echo '<form id="form_setup" method="post" class="max_floating_element_size">';
echo '<fieldset class="full-column">';
echo '<fieldset>';
echo '<legend>'.__('Database maintenance status').' '.ui_print_help_icon('database_maintenance_status_tab', true).'</legend>';
html_print_table($table_status);
echo '</fieldset>';
@ -817,18 +876,14 @@ echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('update_config', 1);
html_print_div(
[
'class' => 'action-buttons w100p',
'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
),
]
$actionButtons = html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
);
html_print_action_buttons($actionButtons, ['type' => 'form_action']);
echo '</form>';
?>

View File

@ -251,69 +251,69 @@ if (enterprise_installed()) {
switch ($section) {
case 'general':
$buttons['general']['active'] = true;
$subpage = ' &raquo '.__('General');
$subpage = __('General');
$help_header = 'setup_general_tab';
break;
case 'auth':
$buttons['auth']['active'] = true;
$subpage = ' &raquo '.__('Authentication');
$subpage = __('Authentication');
break;
case 'perf':
$buttons['perf']['active'] = true;
$subpage = ' &raquo '.__('Performance');
$subpage = __('Performance');
$help_header = '';
break;
case 'vis':
$buttons['vis']['active'] = true;
$subpage = ' &raquo '.__('Visual styles');
$subpage = __('Visual styles');
break;
case 'net':
$buttons['net']['active'] = true;
$subpage = ' &raquo '.__('Netflow');
$subpage = __('Netflow');
$help_header = 'setup_netflow_tab';
break;
case 'ehorus':
$buttons['ehorus']['active'] = true;
$subpage = ' &raquo '.__('eHorus');
$subpage = __('eHorus');
$help_header = 'setup_ehorus_tab';
break;
case 'integria':
$buttons['integria']['active'] = true;
$subpage = ' &raquo '.__('Integria IMS');
$subpage = __('Integria IMS');
$help_header = 'setup_integria_tab';
break;
case 'module_library':
$buttons['module_library']['active'] = true;
$subpage = ' &raquo '.__('Module Library');
$subpage = __('Module Library');
$help_header = 'setup_module_library_tab';
break;
case 'gis':
$buttons['gis']['active'] = true;
$subpage = ' &raquo '.__('Map conections GIS');
$subpage = __('Map conections GIS');
break;
case 'notifications':
$buttons['notifications']['active'] = true;
$subpage = ' &raquo '.__('Notifications');
$subpage = __('Notifications');
break;
case 'websocket_engine':
$buttons['websocket_engine']['active'] = true;
$subpage = ' &raquo '.__('Pandora Websocket Engine');
$subpage = __('Pandora Websocket Engine');
$help_header = 'quickshell_settings';
break;
case 'external_tools':
$buttons['external_tools']['active'] = true;
$subpage = ' &raquo '.__('External Tools');
$subpage = __('External Tools');
$help_header = '';
break;
@ -327,39 +327,49 @@ switch ($section) {
}
$buttons['welcome_tips']['active'] = true;
$subpage = ' &raquo '.$title;
$subpage = $title;
$help_header = '';
break;
case 'enterprise':
$buttons['enterprise']['active'] = true;
$subpage = ' &raquo '.__('Enterprise');
$subpage = __('Enterprise');
$help_header = 'setup_enterprise_tab';
break;
case 'hist_db':
$buttons['hist_db']['active'] = true;
$subpage = __('Historical database');
$help_header = '';
break;
case 'pass':
$buttons['pass']['active'] = true;
$subpage = __('Password policies');
$help_header = '';
break;
default:
$subpage = 'seccion: '.$section;
// Default.
break;
}
// Put header inside div for special sizing.(No right margin).
echo '<div id="header_configuration" style="width: calc(100%);">';
// Header.
ui_print_page_header(
__('Configuration').$subpage,
ui_print_standard_header(
$subpage,
'',
false,
$help_header,
true,
$buttons,
false,
'',
GENERIC_SIZE_TEXT,
'',
'',
true
[
[
'link' => '',
'label' => __('Setup'),
],
]
);
echo '</div>';
if (isset($config['error_config_update_config'])) {
if ($config['error_config_update_config']['correct'] == false) {

View File

@ -43,7 +43,7 @@ if (is_ajax() === true) {
$table = new StdClass();
$table->data = [];
$table->width = '100%';
$table->class = 'databox filters table_result_auth';
$table->class = 'databox filters table_result_auth filter-table-adv';
$table->size['name'] = '30%';
$table->style['name'] = 'font-weight: bold';
@ -94,7 +94,11 @@ if (is_ajax() === true) {
'',
30,
100,
true
true,
false,
false,
'',
'w400px'
);
$table->data['ldap_server'] = $row;
@ -107,7 +111,11 @@ if (is_ajax() === true) {
'',
10,
100,
true
true,
false,
false,
'',
'w400px'
);
$table->data['ldap_port'] = $row;
@ -126,7 +134,10 @@ if (is_ajax() === true) {
'',
'',
0,
true
true,
false,
true,
'w400px'
);
$table->data['ldap_version'] = $row;
@ -189,12 +200,12 @@ if (is_ajax() === true) {
$alt = '',
60,
100,
true
);
$row['control'] .= ui_print_reveal_password(
'ldap_admin_pass',
true
true,
false,
false,
'w400px-important'
);
$table->data['ldap_admin_pass'] = $row;
// Ldapsearch timeout.
@ -208,7 +219,11 @@ if (is_ajax() === true) {
'',
10,
10,
true
true,
false,
false,
'',
'w400px'
);
$table->data['ldap_search_timeout'] = $row;
@ -239,7 +254,11 @@ if (is_ajax() === true) {
'',
30,
100,
true
true,
false,
false,
'',
'w400px'
);
$table->data['ldap_server_secondary'] = $row;
@ -252,7 +271,11 @@ if (is_ajax() === true) {
'',
10,
100,
true
true,
false,
false,
'',
'w400px'
);
$table->data['ldap_port_secondary'] = $row;
@ -271,7 +294,10 @@ if (is_ajax() === true) {
'',
'',
0,
true
true,
false,
true,
'w400px'
);
$table->data['ldap_version_secondary'] = $row;
@ -334,11 +360,10 @@ if (is_ajax() === true) {
$alt = '',
60,
100,
true
);
$row['control'] .= ui_print_reveal_password(
'ldap_admin_pass_secondary',
true
true,
false,
false,
'w400px-important'
);
$table->data['ldap_admin_pass_secondary'] = $row;
break;
@ -407,7 +432,11 @@ if (is_ajax() === true) {
'',
10,
10,
true
true,
false,
false,
'',
'w400px'
);
$table->data['session_timeout'] = $row;
@ -421,7 +450,7 @@ require_once $config['homedir'].'/include/functions_profile.php';
$table = new StdClass();
$table->data = [];
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filters filter-table-adv';
$table->size['name'] = '30%';
$table->style['name'] = 'font-weight: bold';
@ -459,12 +488,15 @@ $row['control'] = html_print_select(
'',
'',
0,
true
true,
false,
true,
'w400px'
);
$table->data['auth'] = $row;
// Form.
echo '<form id="form_setup" method="post">';
echo '<form id="form_setup" class="max_floating_element_size" method="post">';
if (is_metaconsole() === false) {
html_print_input_hidden('update_config', 1);
@ -478,17 +510,14 @@ html_print_csrf_hidden();
html_print_table($table);
html_print_div([ 'id' => 'table_auth_result' ]);
html_print_div(
[
'class' => 'action-buttons w100p',
'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
),
]
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
)
);
echo '</form>';

View File

@ -74,82 +74,98 @@ $table_remote->data = [];
$table_remote->width = '100%';
$table_remote->styleTable = 'margin-bottom: 10px;';
$table_remote->id = 'ehorus-remote-setup';
$table_remote->class = 'databox filters';
$table_remote->size['name'] = '30%';
$table_remote->style['name'] = 'font-weight: bold';
$table_remote->style['control'] = 'display: flex;align-items: center;';
$table_remote->class = 'databox filters filter-table-adv';
$table_remote->size['ehorus_hostname'] = '50%';
$table_remote->size['ehorus_port'] = '50%';
// Enable eHorus user configuration.
$row = [];
$row['name'] = ('eHorus configuration at user level');
$row['control'] = html_print_checkbox_switch('ehorus_user_level_conf', 1, $config['ehorus_user_level_conf'], true);
$row['ehorus_user_level_conf'] = html_print_label_input_block(
__('eHorus configuration at user level'),
html_print_checkbox_switch(
'ehorus_user_level_conf',
1,
$config['ehorus_user_level_conf'],
true
)
);
$table_remote->data['ehorus_user_level_conf'] = $row;
// User.
$row = [];
$row['name'] = __('User');
$row['control'] = html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true);
$table_remote->data['ehorus_user'] = $row;
$row['ehorus_user'] = html_print_label_input_block(
__('User'),
html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true),
['div_class' => 'ehorus-remote-setup-ehorus_user']
);
// Pass.
$row = [];
$row['name'] = __('Password');
$row['control'] = html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true);
$row['control'] .= ui_print_reveal_password('ehorus_pass', true);
$row['ehorus_pass'] = html_print_label_input_block(
__('Password'),
html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true),
['div_class' => 'ehorus-remote-setup-ehorus_user']
);
$table_remote->data['ehorus_pass'] = $row;
// Directory hostname.
$row = [];
$row['name'] = __('API Hostname');
$row['control'] = html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true);
$table_remote->data['ehorus_hostname'] = $row;
$row['ehorus_hostname'] = html_print_label_input_block(
__('API Hostname'),
html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true)
);
// Directory port.
$row = [];
$row['name'] = __('API Port');
$row['control'] = html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true);
$row['ehorus_port'] = html_print_label_input_block(
__('API Port'),
html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true)
);
$table_remote->data['ehorus_port'] = $row;
// Request timeout.
$row = [];
$row['name'] = __('Request timeout');
$row['control'] = html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true);
$row['ehorus_req_timeout'] = html_print_label_input_block(
__('Request timeout'),
html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true)
);
$table_remote->data['ehorus_req_timeout'] = $row;
// Test.
$row = [];
$row['name'] = __('Test');
$row['control'] = html_print_button(
__('Start'),
'test-ehorus',
false,
'',
[
'icon' => 'cog',
'mode' => 'secondary mini',
],
true
$test_start = '<span id="test-ehorus-spinner" class="invisible">&nbsp;'.html_print_image('images/spinner.gif', true).'</span>';
$test_start .= '<span id="test-ehorus-success" class="invisible">&nbsp;'.html_print_image('images/status_sets/default/severity_normal.png', true).'</span>';
$test_start .= '<span id="test-ehorus-failure" class="invisible">&nbsp;'.html_print_image('images/status_sets/default/severity_critical.png', true).'</span>';
$test_start .= '&nbsp;<span id="test-ehorus-message" class="invisible"></span>';
$row['ehorus_test'] = html_print_label_input_block(
__('Test'),
html_print_button(
__('Start'),
'test-ehorus',
false,
'',
[
'icon' => 'cog',
'mode' => 'secondary mini',
'style' => 'width: 115px;',
],
true
).$test_start
);
$row['control'] .= '<span id="test-ehorus-spinner" class="invisible">&nbsp;'.html_print_image('images/spinner.gif', true).'</span>';
$row['control'] .= '<span id="test-ehorus-success" class="invisible">&nbsp;'.html_print_image('images/status_sets/default/severity_normal.png', true).'</span>';
$row['control'] .= '<span id="test-ehorus-failure" class="invisible">&nbsp;'.html_print_image('images/status_sets/default/severity_critical.png', true).'</span>';
$row['control'] .= '&nbsp;<span id="test-ehorus-message" class="invisible"></span>';
$table_remote->data['ehorus_test'] = $row;
// Print.
echo '<div class="center pdd_b_20px mrgn_top_20px">';
echo '<div class="center pdd_b_10px mrgn_btn_20px white_box max_floating_element_size">';
echo '<a target="_blank" rel="noopener noreferrer" href="http://ehorus.com">';
if ($config['style'] === 'pandora_black' && is_metaconsole() === true) {
html_print_image(
'include/ehorus/images/ehorus-logo.png',
false,
['class' => 'w400px']
['class' => 'w400px mrgn_top_15px']
);
} else {
html_print_image(
'include/ehorus/images/ehorus-logo-grey.png',
false,
['class' => 'w400px']
['class' => 'w400px mrgn_top_15px']
);
}
@ -179,7 +195,7 @@ if ($config['ehorus_enabled'] && !$custom_field_exists) {
ui_print_error_message($error_message);
}
echo "<form method='post'>";
echo "<form method='post' class='max_floating_element_size'>";
// Form enable.
echo '<div id="form_enable">';
html_print_input_hidden('update_config', 1);
@ -195,17 +211,14 @@ echo '</div>';
echo '</fieldset>';
echo '</div>';
html_print_div(
[
'class' => 'action-buttons w100p',
'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
['icon' => 'update'],
true
),
]
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'update_button',
false,
['icon' => 'update'],
true
)
);
echo '</form>';
@ -220,8 +233,8 @@ if(!$('input:checkbox[name="ehorus_enabled"]').is(':checked'))
if($('input:checkbox[name="ehorus_user_level_conf"]').is(':checked'))
{
$('#ehorus-remote-setup-ehorus_user').hide();
$('#ehorus-remote-setup-ehorus_pass').hide()
$('.ehorus-remote-setup-ehorus_user').hide();
$('.ehorus-remote-setup-ehorus_pass').hide()
}
@ -234,13 +247,13 @@ if($('input:checkbox[name="ehorus_user_level_conf"]').is(':checked'))
}
var hideUserPass = function () {
$('#ehorus-remote-setup-ehorus_user').hide();
$('#ehorus-remote-setup-ehorus_pass').hide();
$('.ehorus-remote-setup-ehorus_user').hide();
$('.ehorus-remote-setup-ehorus_pass').hide();
}
var showUserPass = function () {
$('#ehorus-remote-setup-ehorus_user').show();
$('#ehorus-remote-setup-ehorus_pass').show();
$('.ehorus-remote-setup-ehorus_user').show();
$('.ehorus-remote-setup-ehorus_pass').show();
}
var handleEnable = function (event) {

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License

File diff suppressed because it is too large Load Diff

View File

@ -269,52 +269,102 @@ $table_remote->data = [];
$table_remote->width = '100%';
$table_remote->styleTable = 'margin-bottom: 10px;';
$table_remote->id = 'integria-remote-setup';
$table_remote->class = 'databox filters';
$table_remote->size['name'] = '30%';
$table_remote->style['name'] = 'font-weight: bold';
$table_remote->style['control'] = 'display: flex;align-items: center;';
$table_remote->class = 'databox filters filter-table-adv';
$table_remote->size['hostname'] = '50%';
$table_remote->size['api_pass'] = '50%';
// Enable eHorus user configuration.
// Enable Integria user configuration.
$row = [];
$row['name'] = ('Integria configuration at user level');
$row['control'] = html_print_checkbox_switch('integria_user_level_conf', 1, $config['integria_user_level_conf'], true);
$row['user_level'] = html_print_label_input_block(
__('Integria configuration at user level'),
html_print_checkbox_switch(
'integria_user_level_conf',
1,
$config['integria_user_level_conf'],
true
)
);
$table_remote->data['integria_user_level_conf'] = $row;
// Integria user.
$row = [];
$row['name'] = __('User');
$row['control'] = html_print_input_text('integria_user', $config['integria_user'], '', 30, 100, true);
$table_remote->data['integria_user'] = $row;
$row['user'] = html_print_label_input_block(
__('User'),
html_print_input_text(
'integria_user',
$config['integria_user'],
'',
30,
100,
true
),
['div_class' => 'integria-remote-setup-integria_user']
);
// Integria password.
$row = [];
$row['name'] = __('Password');
$row['control'] = html_print_input_password('integria_pass', io_output_password($config['integria_pass']), '', 30, 100, true);
$row['control'] .= ui_print_reveal_password('integria_pass', true);
$row['password'] = html_print_label_input_block(
__('Password'),
html_print_input_password(
'integria_pass',
io_output_password($config['integria_pass']),
'',
30,
100,
true
),
['div_class' => 'integria-remote-setup-integria_pass']
);
$table_remote->data['integria_pass'] = $row;
// Integria hostname.
$row = [];
$row['name'] = __('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true);
$row['control'] = html_print_input_text('integria_hostname', $config['integria_hostname'], '', 30, 100, true);
$table_remote->data['integria_hostname'] = $row;
$row['hostname'] = html_print_label_input_block(
__('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true),
html_print_input_text(
'integria_hostname',
$config['integria_hostname'],
'',
30,
100,
true
),
['div_class' => 'integria-remote-setup-integria_hostname']
);
// API password.
$row = [];
$row['name'] = __('API Password');
$row['control'] = html_print_input_password('integria_api_pass', io_output_password($config['integria_api_pass']), '', 30, 100, true);
$row['control'] .= ui_print_reveal_password('integria_api_pass', true);
$row['api_pass'] = html_print_label_input_block(
__('API Password'),
html_print_input_password(
'integria_api_pass',
io_output_password($config['integria_api_pass']),
'',
30,
100,
true
),
['div_class' => 'integria-remote-setup-integria_api_pass']
);
$table_remote->data['integria_api_pass'] = $row;
// Request timeout.
$row = [];
$row['name'] = __('Request timeout');
$row['control'] = html_print_input_text('integria_req_timeout', $config['integria_req_timeout'], '', 3, 10, true);
$row['req_timeout'] = html_print_label_input_block(
__('Request timeout'),
html_print_input_text(
'integria_req_timeout',
$config['integria_req_timeout'],
'',
3,
10,
true
),
['div_class' => 'integria-remote-setup-integria_req_timeout']
);
$table_remote->data['integria_req_timeout'] = $row;
$row = [];
$row['name'] = __('Inventory');
$row['control'] = html_print_button(
$row['control'] = __('Inventory');
$row['control'] .= html_print_button(
__('Sync inventory'),
'sync-inventory',
false,
@ -575,8 +625,8 @@ $table_cr_settings->data['custom_response_incident_status'] = $row;
// Test.
$row = [];
$row['name'] = __('Test');
$row['control'] = html_print_button(
$row['control'] = __('Test');
$row['control'] .= html_print_button(
__('Start'),
'test-integria',
false,
@ -594,12 +644,12 @@ $row['control'] .= '&nbsp;<span id="test-integria-message" class="invisible"></s
$table_remote->data['integria_test'] = $row;
// Print.
echo '<div class="center pdd_b_20px mrgn_top_20px">';
echo '<div class="center pdd_b_10px mrgn_btn_20px white_box max_floating_element_size">';
echo '<a target="_blank" rel="noopener noreferrer" href="http://integriaims.com">';
html_print_image(
'images/integria_logo.svg',
false,
['class' => 'w400px' ]
['class' => 'w400px mrgn_top_15px']
);
echo '</a>';
echo '<br />';
@ -611,7 +661,7 @@ echo 'https://integriaims.com';
echo '</a>';
echo '</div>';
echo "<form method='post'>";
echo "<form method='post' class='max_floating_element_size'>";
html_print_input_hidden('update_config', 1);
// Form enable.
@ -650,33 +700,24 @@ if ($has_connection != false) {
echo '</fieldset>';
echo '</div>';
html_print_div(
[
'class' => 'action-buttons w100p',
'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
['icon' => 'update'],
true
),
]
$update_button = html_print_submit_button(
__('Update'),
'update_button',
false,
['icon' => 'update'],
true
);
} else {
html_print_div(
[
'class' => 'action-buttons w100p',
'content' => html_print_submit_button(
__('Update and continue'),
'update_button',
false,
['icon' => 'update'],
true
),
]
$update_button = html_print_submit_button(
__('Update and continue'),
'update_button',
false,
['icon' => 'update'],
true
);
}
html_print_action_buttons($update_button);
echo '</form>';
@ -686,8 +727,8 @@ echo '</form>';
if($('input:checkbox[name="integria_user_level_conf"]').is(':checked'))
{
$('#integria-remote-setup-integria_user').hide();
$('#integria-remote-setup-integria_pass').hide()
$('.integria-remote-setup-integria_user').hide();
$('.integria-remote-setup-integria_pass').hide()
}
var handleUserLevel = function(event) {
@ -726,13 +767,13 @@ echo '</form>';
}
var hideUserPass = function () {
$('#integria-remote-setup-integria_user').hide();
$('#integria-remote-setup-integria_pass').hide();
$('.integria-remote-setup-integria_user').hide();
$('.integria-remote-setup-integria_pass').hide();
}
var showUserPass = function () {
$('#integria-remote-setup-integria_user').show();
$('#integria-remote-setup-integria_pass').show();
$('.integria-remote-setup-integria_user').show();
$('.integria-remote-setup-integria_pass').show();
}
var handleEnable = function (event) {

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -37,46 +37,66 @@ $update = (bool) get_parameter('update');
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->border = 0;
$table->cellspacing = 3;
$table->cellpadding = 5;
$table->class = 'databox filters';
$table->data = [];
$table->data[0][0] = '<b>'.__('Data storage path').'</b>';
$table->data[0][1] = html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true);
$table->data[0][] = html_print_label_input_block(
__('Data storage path'),
html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true)
);
$table->data[1][0] = '<b>'.__('Daemon interval').'</b>';
$table->data[1][1] = html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true);
$table->data[0][] = html_print_label_input_block(
__('Daemon interval'),
html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true)
);
$table->data[2][0] = '<b>'.__('Daemon binary path').'</b>';
$table->data[2][1] = html_print_input_text('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true);
$table->data[1][] = html_print_label_input_block(
__('Daemon binary path'),
html_print_input_text('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true)
);
$table->data[3][0] = '<b>'.__('Nfdump binary path').'</b>';
$table->data[3][1] = html_print_input_text('netflow_nfdump', $config['netflow_nfdump'], false, 50, 200, true);
$table->data[1][] = html_print_label_input_block(
__('Nfdump binary path'),
html_print_input_text('netflow_nfdump', $config['netflow_nfdump'], false, 50, 200, true)
);
$table->data[4][0] = '<b>'.__('Nfexpire binary path').'</b>';
$table->data[4][1] = html_print_input_text('netflow_nfexpire', $config['netflow_nfexpire'], false, 50, 200, true);
$table->data[2][] = html_print_label_input_block(
__('Nfexpire binary path'),
html_print_input_text('netflow_nfexpire', $config['netflow_nfexpire'], false, 50, 200, true)
);
$table->data[5][0] = '<b>'.__('Maximum chart resolution').'</b>';
$table->data[5][1] = html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true);
$table->data[2][] = html_print_label_input_block(
__('Maximum chart resolution'),
html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true)
);
$table->data[6][0] = '<b>'.__('Disable custom live view filters').'</b>';
$table->data[6][1] = html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true);
$table->data[7][0] = '<b>'.__('Netflow max lifetime').'</b>';
$table->data[7][1] = html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true);
$table->data[3][] = html_print_label_input_block(
__('Disable custom live view filters'),
html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true)
);
$table->data[3][] = html_print_label_input_block(
__('Netflow max lifetime'),
html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true)
);
$table->data[8][0] = '<b>'.__('Name resolution for IP address').'</b>';
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$table->data[8][1] = html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true);
echo '<form id="netflow_setup" method="post">';
$table->data[4][] = html_print_label_input_block(
__('Name resolution for IP address'),
html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true)
);
echo '<form class="max_floating_element_size" id="netflow_setup" method="post">';
html_print_table($table);
// Update button.
echo '<div class="action-buttons w100p">';
html_print_input_hidden('update_config', 1);
html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"');
echo '</div></form>';
html_print_input_hidden('update_config', 1);
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'upd_button',
false,
['icon' => 'update'],
true
)
);
echo '</form>';

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -32,68 +32,70 @@ $url = ui_get_full_url(
'index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=websocket_engine&amp;pure='.$config['pure']
);
echo '<form id="form_setup" method="post" action="'.$url.'">';
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="'.$url.'">';
echo '<fieldset>';
echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('WebSocket settings').'</legend>';
$t = new StdClass();
$t->data = [];
$t->width = '100%';
$t->class = 'databox filters';
$t->class = 'databox filter-table-adv';
$t->data = [];
$t->style[0] = 'font-weight: bold';
$t->data[0][0] = __('Bind address');
$t->data[0][1] = html_print_input_text(
'ws_bind_address',
$config['ws_bind_address'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Bind address'),
html_print_input_text(
'ws_bind_address',
$config['ws_bind_address'],
'',
30,
100,
true
)
);
$t->data[1][0] = __('Bind port');
$t->data[1][2] = html_print_input_text(
'ws_port',
$config['ws_port'],
'',
30,
100,
true
$t->data[0][] = html_print_label_input_block(
__('Bind port'),
html_print_input_text(
'ws_port',
$config['ws_port'],
'',
30,
100,
true
)
);
$t->data[2][0] = __('WebSocket proxy url');
$t->data[2][2] = html_print_input_text(
'ws_proxy_url',
$config['ws_proxy_url'],
'',
30,
100,
true
$t->data[1][] = html_print_label_input_block(
__('WebSocket proxy url'),
html_print_input_text(
'ws_proxy_url',
$config['ws_proxy_url'],
'',
30,
100,
true
)
);
html_print_input_hidden('update_config', 1);
html_print_table($t);
echo '</fieldset>';
if (function_exists('quickShellSettings') === true) {
quickShellSettings();
}
html_print_div(
[
'class' => 'action-buttons w100p',
'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
),
]
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
)
);
echo '</form>';

View File

@ -1885,7 +1885,7 @@ if ($create_alert || $update_alert) {
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->width = '100%';
$table->class = 'databox data';
$table->class = 'info_table';
$table->align = [];
$table->head[0] = '<span title="'.__('Position').'">'.__('P.').'</span>';
@ -1983,7 +1983,7 @@ if ($create_alert || $update_alert) {
[
'alt' => __('Duplicate'),
'title' => __('Duplicate'),
'class' => 'main_menu_icon invert_filter',
'class' => 'main_menu_icon',
]
),
],
@ -2001,7 +2001,7 @@ if ($create_alert || $update_alert) {
[
'alt' => __('Update'),
'border' => 0,
'class' => 'main_menu_icon invert_filter',
'class' => 'main_menu_icon',
]
),
],
@ -2031,6 +2031,7 @@ if ($create_alert || $update_alert) {
true,
[
'title' => __('Delete action'),
'class' => 'main_menu_icon',
]
),
'onClick' => 'delete_snmp_alert('.$row['id_as'].')',

View File

@ -1,5 +1,4 @@
<?php
/**
* User creation / update.
*
@ -60,7 +59,7 @@ if ($enterprise_include === true) {
$id = get_parameter('id', get_parameter('id_user', ''));
// Check if we are the same user for edit or we have a proper profile for edit users.
if ($id !== $config['id_user']) {
if ((is_centralized() === true) || (bool) check_acl($config['id_user'], 0, 'UM') === false) {
if ((bool) check_acl($config['id_user'], 0, 'UM') === false) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access User Management'
@ -393,6 +392,7 @@ if ($create_user === true) {
$values['timezone'] = (string) get_parameter('timezone');
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
$values['time_autorefresh'] = (int) get_parameter('time_autorefresh', 0);
$dashboard = get_parameter('dashboard', '');
$visual_console = get_parameter('visual_console', '');
@ -654,6 +654,7 @@ if ($update_user) {
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
$values['show_tips_startup'] = (int) get_parameter_switch('show_tips_startup');
$values['time_autorefresh'] = (int) get_parameter('time_autorefresh');
// API Token information.
$apiTokenRenewed = (bool) get_parameter('renewAPIToken');
$values['api_token'] = ($apiTokenRenewed === true) ? api_token_generate() : users_get_API_token($values['id_user']);
@ -996,28 +997,19 @@ if (!users_is_admin() && $config['id_user'] !== $id && $new_user === false) {
}
}
if (is_metaconsole() === true) {
html_print_div(
[
'class' => 'user_form_title',
'content' => ((bool) $id === true) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
]
);
}
if (!$new_user) {
$user_id = '<div class="label_select_simple"><p class="edit_user_labels">'.__('User ID').': </p>';
$user_id .= '<span>'.$id.'</span>';
$user_id .= html_print_input_hidden('id_user', $id, true);
$user_id .= '</div>';
$apiTokenContentElements[] = '<span style="height: 15px;font-size: 14px;">'.__('API Token').'</span>';
$apiTokenContentElements[] = '<span style="line-height: 15px; height: 15px;font-size: 14px;">'.__('API Token').'</span>';
$apiTokenContentElements[] = html_print_button(
__('Renew'),
'renew_api_token',
false,
sprintf(
'javascript:renewAPIToken(\'%s\', \'%s\', \'%s\')',
'javascript:renewAPIToken("%s", "%s", "%s")',
__('Warning'),
__('The API token will be renewed. After this action, the last token you were using will not work. Are you sure?'),
'user_profile_form',
@ -1033,7 +1025,7 @@ if (!$new_user) {
'show_api_token',
false,
sprintf(
'javascript:showAPIToken(\'%s\', \'%s\')',
'javascript:showAPIToken("%s", "%s")',
__('API Token'),
base64_encode(__('Your API Token is:').'&nbsp;<br><span class="font_12pt bolder">'.users_get_API_token($id).'</span><br>&nbsp;'.__('Please, avoid share this string with others.')),
),
@ -1284,8 +1276,9 @@ if (is_metaconsole() === false) {
if (is_metaconsole() === true) {
$array_filters = get_filters_custom_fields_view(0, true);
$search_custom_fields_view = '<div class="label_select"><p class="edit_user_labels">'.__('Search custom field view').' '.ui_print_help_tip(__('Load by default the selected view in custom field view'), true).'</p>';
$search_custom_fields_view .= html_print_select(
$searchCustomFieldView = [];
$searchCustomFieldView[] = __('Search custom field view');
$searchCustomFieldView[] = html_print_select(
$array_filters,
'default_custom_view',
$user_info['default_custom_view'],
@ -1297,7 +1290,10 @@ if (is_metaconsole() === true) {
true,
'',
false
).'</div>';
).ui_print_input_placeholder(
__('Load by default the selected view in custom field view'),
true
);
}
$values = [
@ -1379,6 +1375,8 @@ $home_screen .= html_print_input_text(
false
);
$home_screen = '';
$size_pagination = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Block size for pagination').'</p>';
$size_pagination .= html_print_input_text(
'block_size',
@ -1397,19 +1395,20 @@ if ($id === $config['id_user']) {
);
}
if (enterprise_installed() && is_metaconsole() === true) {
if (enterprise_installed() === true && is_metaconsole() === true) {
$user_info_metaconsole_access = 'only_console';
if (isset($user_info['metaconsole_access'])) {
$user_info_metaconsole_access = $user_info['metaconsole_access'];
}
// TODO review help tips on meta.
$meta_access = '<div class="label_select"><p class="edit_user_labels">'.__('Metaconsole access').' './* ui_print_help_icon('meta_access', true). */ '</p>';
$metaconsole_accesses = [
'basic' => __('Basic'),
'advanced' => __('Advanced'),
];
$meta_access .= html_print_select(
$outputMetaAccess = [];
$outputMetaAccess[] = __('Metaconsole access');
$outputMetaAccess[] = html_print_select(
$metaconsole_accesses,
'metaconsole_access',
$user_info_metaconsole_access,
@ -1419,51 +1418,9 @@ if (enterprise_installed() && is_metaconsole() === true) {
true,
false,
false
).'</div>';
);
}
/*
$not_login = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Not Login').'</p>';
$not_login .= ui_print_help_tip(
__('The user with not login set only can access to API.'),
true
);
$not_login .= html_print_checkbox_switch(
'not_login',
1,
$user_info['not_login'],
true
).'</div>';
$local_user = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Local user').'</p>';
$local_user .= ui_print_help_tip(
__('The user with local authentication enabled will always use local authentication.'),
true
);
$local_user .= html_print_checkbox_switch(
'local_user',
1,
$user_info['local_user'],
true
).'</div>';
$session_time = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Session Time');
$session_time .= ui_print_help_tip(
__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'),
true
).'</p>';
$session_time .= html_print_input_text(
'session_time',
$user_info['session_time'],
'',
5,
5,
true.false,
false,
'',
'class="input_line_small"'
).'</div>';
*/
$user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group))));
if (empty($user_groups) === false) {
@ -1584,31 +1541,6 @@ if (empty($doubleAuthElementsContent) === false) {
$doubleAuthentication = '';
}
/*
if (isset($double_authentication)) {
$double_authentication .= '</div>';
}*/
$autorefresh_list_out = [];
if (is_metaconsole() === false || is_centralized() === true) {
$autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail';
@ -1634,8 +1566,8 @@ $autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console'
$autorefresh_list_out['operation/events/events'] = 'Events';
if (isset($autorefresh_list) === false) {
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '".$config['id_user']."'");
if (isset($autorefresh_list) === false || empty($autorefresh_list) === true || empty($autorefresh_list[0]) === true) {
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '".$id."'");
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
if ($autorefresh_list === null) {
$autorefresh_list[0] = __('None');
@ -1667,31 +1599,32 @@ if (isset($autorefresh_list) === false) {
}
}
if (is_metaconsole() === true) {
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 .= html_print_checkbox_switch(
$metaconsoleAgentManager = [];
$metaconsoleAgentManager[] = __('Enable agents managment');
$metaconsoleAgentManager[] = html_print_checkbox_switch(
'metaconsole_agents_manager',
1,
$user_info['metaconsole_agents_manager'],
true
).'</div>';
);
$metaconsole_access_node = '<div class="label_select_simple" id="metaconsole_access_node_div"><p class="edit_user_labels">'.__('Enable node access').ui_print_help_tip(__('With this option enabled, the user will can access to nodes console'), true).'</p>';
$metaconsole_access_node .= html_print_checkbox(
$metaconsoleAgentManager[] = __('Enable node access').ui_print_help_tip(
__('With this option enabled, the user will can access to nodes console'),
true
);
$metaconsoleAgentManager[] = html_print_checkbox_switch(
'metaconsole_access_node',
1,
$access_node,
true
).'</div>';
);
}
echo '<div class="max_floating_element_size">';
echo '<form id="user_profile_form" name="user_profile_form" method="post" autocomplete="off" action="#">';
@ -1703,137 +1636,8 @@ if (!$id) {
$user_id_create = $user_id;
}
if (is_metaconsole() === true) {
$access_or_pagination = $meta_access;
if ($id != '' && !$is_err) {
$div_user_info = '<div class="edit_user_info_left">'.$avatar.$user_id_create.'</div>
<div class="edit_user_info_right">'.$user_id_update_view.$full_name.$new_pass.$new_pass_confirm.$own_pass_confirm.$global_profile.'</div>';
} else {
$div_user_info = '<div class="edit_user_info_left">'.$avatar.'</div>
<div class="edit_user_info_right">'.$user_id_create.$user_id_update_view.$full_name.$new_pass.$new_pass_confirm.$global_profile.'</div>';
}
echo '<div id="user_form">
<div class="user_edit_first_row">
<div class="edit_user_info white_box">'.$div_user_info.'</div>
<div class="edit_user_autorefresh white_box"><p class="bolder">Extra info</p>'.$email.$phone.$not_login.$local_user.$session_time.'</div>
</div>
<div class="user_edit_second_row white_box">
<div class="edit_user_options">'.$language.$access_or_pagination.$skin.$default_event_filter.$double_authentication.'</div>
<div class="edit_user_timezone">'.$timezone;
echo $search_custom_fields_view.$metaconsole_agents_manager.$metaconsole_access_node;
$autorefresh_show = '<p class="edit_user_labels">'._('Autorefresh').ui_print_help_tip(
__('This will activate autorefresh in selected pages'),
true
).'</p>';
$select_out = html_print_select(
$autorefresh_list_out,
'autorefresh_list_out[]',
'',
'',
'',
'',
true,
true,
true,
'',
false,
'width:100%'
);
$arrows = ' ';
$select_in = html_print_select(
$autorefresh_list,
'autorefresh_list[]',
'',
'',
'',
'',
true,
true,
true,
'',
false,
'width:100%'
);
$table_ichanges = '<div class="autorefresh_select">
<div class="autorefresh_select_list_out">
<p class="autorefresh_select_text">'.__('Full list of pages').': </p>
<div>'.$select_out.'</div>
</div>
<div class="autorefresh_select_arrows" style="display:grid">
<a href="javascript:">'.html_print_image(
'images/darrowright_green.png',
true,
[
'id' => 'right_autorefreshlist',
'alt' => __('Push selected pages into autorefresh list'),
'title' => __('Push selected pages into autorefresh list'),
]
).'</a>
<a href="javascript:">'.html_print_image(
'images/darrowleft_green.png',
true,
[
'id' => 'left_autorefreshlist',
'alt' => __('Pop selected pages out of autorefresh list'),
'title' => __('Pop selected pages out of autorefresh list'),
]
).'</a>
</div>
<div class="autorefresh_select_list">
<p class="autorefresh_select_text">'.__('List of pages with autorefresh').': </p>
<div>'.$select_in.'</div>
</div>
</div>';
$autorefresh_show .= $table_ichanges;
// Time autorefresh.
$times = get_refresh_time_array();
$time_autorefresh = '<div class="label_select"><p class="edit_user_labels">'.__('Time autorefresh');
$time_autorefresh .= ui_print_help_tip(
__('Interval of autorefresh of the elements, by default they are 30 seconds, needing to enable the autorefresh first'),
true
).'</p>';
$time_autorefresh .= html_print_select(
$times,
'time_autorefresh',
$user_info['time_autorefresh'],
'',
'',
'',
true,
false,
false
).'</div>';
echo '</div>
</div>
<div class="edit_user_autorefresh white_box">'.$autorefresh_show.$time_autorefresh.'</div>
<div class="user_edit_third_row white_box">
<div class="edit_user_comments">'.$comments.'</div>
</div>';
if (empty($ehorus) === false) {
html_print_div(
[
'class' => 'user_edit_third_row white_box',
'content' => $ehorus,
],
true
);
}
} else {
$access_or_pagination = $size_pagination;
// WIP: Only for node.
include_once 'user_management.php';
}
// User management form.
require_once 'user_management.php';
if ((bool) $config['admin_can_add_user'] === true) {
html_print_csrf_hidden();
@ -1845,9 +1649,13 @@ if ($new_user === true) {
html_print_input_hidden('json_profile', $json_profile);
}
echo '</div>';
echo '</form>';
// User Profile definition table. (Only where user is not creating).
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true));
}
echo '</div>';
$actionButtons = [];
@ -1914,7 +1722,7 @@ if (is_metaconsole() === false) {
$(document).ready(function() {
// Set up the picker to update target timezone and country select lists.
$('#timezone-image').timezonePicker({
target: '#timezone',
target: '#timezone1',
});
// Optionally an auto-detect button to trigger JavaScript geolocation.
@ -1936,23 +1744,13 @@ if (is_metaconsole() === false) {
var json_profile = $('#hidden-json_profile');
/* <![CDATA[ */
$(document).ready(function() {
// Set up the picker to update target timezone and country select lists.
$('#timezone-image').timezonePicker({
target: '#timezone1',
});
// Optionally an auto-detect button to trigger JavaScript geolocation.
$('#timezone-detect').click(function() {
$('#timezone-image').timezonePicker('detectLocation');
});
$("#right_autorefreshlist").click(function() {
jQuery.each($("select[name='autorefresh_list_out[]'] option:selected"), function(key, value) {
imodule_name = $(value).html();
if (imodule_name != <?php echo "'".__('None')."'"; ?>) {
id_imodule = $(value).attr('value');
$("select[name='autorefresh_list[]']").append($("<option></option>").val(id_imodule).html('<i>' + imodule_name + '</i>'));
$("select[name='autorefresh_list[]'] option").each(function() { $(this).attr("selected", true) });
$("select[name='autorefresh_list[]']").append($("<option></option>").val(id_imodule).html('<i>' + imodule_name + '</i>').attr("selected", true));
$("#autorefresh_list_out").find("option[value='" + id_imodule + "']").remove();
$("#autorefresh_list").find("option[value='']").remove();
$("#autorefresh_list").find("option[value='0']").remove();
@ -1979,6 +1777,13 @@ if (is_metaconsole() === false) {
});
});
$("#button-uptbutton").click (function () {
console.log('aaaaaaaaaaaaa');
if($("#autorefresh_list option").length > 0) {
$('#autorefresh_list option').prop('selected', true);
}
});
$("input#checkbox-double_auth").change(function(e) {
e.preventDefault();
if (this.checked) {

View File

@ -395,8 +395,6 @@ if ($delete_user === true) {
__('There was a problem deleting the user from %s', io_safe_input($server['server_name']))
);
}
header('Refresh:1');
}
} else {
ui_print_error_message(__('There was a problem deleting the user'));
@ -453,9 +451,9 @@ if ($delete_user === true) {
}
}
$filter_group = (int) get_parameter('filter_group', 0);
$filter_search = get_parameter('filter_search', '');
$search = (bool) get_parameter('search', false);
$filter_group = (int) get_parameter('filter_group', 0);
$filter_search = get_parameter('filter_search', '');
$search = (bool) get_parameter('search', false);
if (($filter_group == 0) && ($filter_search == '')) {
$search = false;
@ -463,43 +461,72 @@ if (($filter_group == 0) && ($filter_search == '')) {
$filterTable = new stdClass();
$filterTable->width = '100%';
$filterTable->class = 'fixed_filter_bar';
$filterTable->class = 'filter-table-adv';
$filterTable->rowclass[0] = '';
$filterTable->cellstyle[0][0] = 'width:0';
$filterTable->cellstyle[0][1] = 'width:0';
$filterTable->data[0][0] = __('Group');
$filterTable->data[1][0] = html_print_select_groups(
false,
'AR',
true,
'filter_group',
$filter_group,
'',
'',
0,
true
$filterTable->data[0][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'AR',
true,
'filter_group',
$filter_group,
'',
'',
0,
true
)
);
$filterTable->data[0][1] = __('Search').ui_print_help_tip(__('Search by username, fullname or email'), true);
$filterTable->data[1][1] = html_print_input_text(
'filter_search',
$filter_search,
__('Search by username, fullname or email'),
30,
90,
true
);
$filterTable->cellstyle[1][2] = 'vertical-align: bottom';
$filterTable->data[1][2] = html_print_submit_button(
$filterTable->data[0][] = html_print_label_input_block(
__('Search'),
'search',
false,
html_print_input_text(
'filter_search',
$filter_search,
__('Search by username, fullname or email'),
30,
90,
true
).ui_print_input_placeholder(
__('Search by username, fullname or email'),
true
)
);
$form_filter = "<form method='post'>";
$form_filter .= html_print_table($filterTable, true);
$form_filter .= html_print_div(
[
'icon' => 'search',
'class' => 'float-right',
'mode' => 'secondary mini',
'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button(
__('Search'),
'search',
false,
[
'icon' => 'search',
'class' => 'float-right',
'mode' => 'secondary mini',
],
true
),
],
true
);
$form_filter .= '</form>';
ui_toggle(
$form_filter,
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'filter',
true,
false,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
$is_management_allowed = true;
if (is_metaconsole() === false && is_management_allowed() === false) {
@ -520,20 +547,6 @@ if (is_metaconsole() === false && is_management_allowed() === false) {
);
}
if (is_metaconsole() === true) {
$filterTable->width = '96%';
$form_filter = "<form class='filters_form' method='post'>";
$form_filter .= html_print_table($filterTable, true);
$form_filter .= '</form>';
ui_toggle($form_filter, __('Show Options'));
} else {
$form_filter = "<form method='post'>";
$form_filter .= html_print_table($filterTable, true);
$form_filter .= '</form>';
echo $form_filter;
}
// Urls to sort the table.
$url_up_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=up&pure='.$pure;
$url_down_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=down&pure='.$pure;
@ -790,7 +803,6 @@ foreach ($info as $user_id => $user_info) {
);
}
$data[4] .= '<br/>';
$data[4] .= '<br/>';
$total_profile++;

View File

@ -325,53 +325,55 @@ if ($new_user === false) {
$userManagementTable->data['passwordManage_table'] = html_print_table($passwordManageTable, true);
if (users_is_admin() === true) {
$userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width w50p';
$userManagementTable->cellclass['captions_loginErrorUser'][0] = 'wrap';
$userManagementTable->cellclass['captions_loginErrorUser'][1] = 'wrap';
$notLoginCheckContent = [];
$notLoginCheckContent[] = '<span>'.__('Not Login').'</span>';
$notLoginCheckContent[] = html_print_checkbox_switch(
'not_login',
1,
$user_info['not_login'],
true
);
$userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width w50p';
$userManagementTable->cellclass['captions_loginErrorUser'][0] = 'wrap';
$userManagementTable->cellclass['captions_loginErrorUser'][1] = 'wrap';
$notLoginCheckContent = [];
$notLoginCheckContent[] = '<span>'.__('Not Login').'</span>';
$notLoginCheckContent[] = html_print_checkbox_switch(
'not_login',
1,
$user_info['not_login'],
true
);
$userManagementTable->data['captions_loginErrorUser'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $notLoginCheckContent),
],
true
);
$userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_input_placeholder(
__('The user with not login set only can access to API.'),
true
);
$userManagementTable->data['captions_loginErrorUser'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $notLoginCheckContent),
],
true
);
$userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_input_placeholder(
__('The user with not login set only can access to API.'),
true
);
$localUserCheckContent = [];
$localUserCheckContent[] = '<span>'.__('Local User').'</span>';
$localUserCheckContent[] = html_print_checkbox_switch(
'local_user',
1,
$user_info['local_user'],
true
);
$localUserCheckContent = [];
$localUserCheckContent[] = '<span>'.__('Local User').'</span>';
$localUserCheckContent[] = html_print_checkbox_switch(
'local_user',
1,
$user_info['local_user'],
true
);
$userManagementTable->data['captions_loginErrorUser'][1] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $localUserCheckContent),
],
true
);
$userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_input_placeholder(
__('The user with local authentication enabled will always use local authentication.'),
true
);
}
$userManagementTable->data['captions_loginErrorUser'][1] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $localUserCheckContent),
],
true
);
$userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_input_placeholder(
__('The user with local authentication enabled will always use local authentication.'),
true
);
$userManagementTable->data['show_tips_startup'][0] = html_print_checkbox_switch('show_tips_startup', 1, ($user_info['show_tips_startup'] === null) ? true : $user_info['show_tips_startup'], true);
$userManagementTable->data['show_tips_startup'][1] = '<span>'.__('Show usage tips at startup').'</span>';
@ -551,10 +553,10 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh
// Title for Language and Appearance.
$userManagementTable->data['title_lookAndFeel'] = html_print_subtitle_table(__('Language and Appearance'));
// Language and color scheme.
$userManagementTable->rowclass['captions_lang_colorscheme'] = 'field_half_width';
$userManagementTable->rowclass['fields_lang_colorscheme'] = 'field_half_width';
$userManagementTable->data['captions_lang_colorscheme'][0] = __('Language');
$userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_from_sql(
$userManagementTable->rowclass['line1_looknfeel'] = 'field_half_width';
$userManagementTable->rowclass['line2_looknfeel'] = 'field_half_width';
$userManagementTable->data['line1_looknfeel'][0] = __('Language');
$userManagementTable->data['line2_looknfeel'][0] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'language',
$user_info['language'],
@ -563,9 +565,17 @@ $userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_fro
'default',
true
);
if (function_exists('skins_print_select')) {
$userManagementTable->data['captions_lang_colorscheme'][1] = __('User color scheme');
$userManagementTable->data['fields_lang_colorscheme'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
if (is_metaconsole() === true) {
if (users_is_admin() === true) {
$userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0];
$userManagementTable->data['line2_looknfeel'][1] = $outputMetaAccess[1];
}
} else {
if (function_exists('skins_print_select')) {
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme');
$userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
}
}
$userManagementTable->rowclass['captions_blocksize_eventfilter'] = 'field_half_width';
@ -592,41 +602,55 @@ $userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_selec
false,
false
);
if (is_metaconsole() === false) {
// Home screen table.
$homeScreenTable = new stdClass();
$homeScreenTable->class = 'w100p table_section full_section';
$homeScreenTable->id = 'home_screen_table';
$homeScreenTable->style = [];
$homeScreenTable->rowclass = [];
$homeScreenTable->data = [];
// Home screen.
$homeScreenTable->data['captions_homescreen'][0] = __('Home screen');
$homeScreenTable->colspan['captions_homescreen'][0] = 2;
$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width';
$homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex';
$homeScreenTable->data['fields_homescreen'][0] = html_print_select(
$homeScreenValues,
'section',
io_safe_output($user_info['section']),
'show_data_section();',
'',
-1,
true,
false,
false
);
$homeScreenTable->data['fields_homescreen'][1] = html_print_div(
[
'class' => 'w100p',
'content' => $customHomeScreenDataField,
],
true
);
// Home screen table.
$homeScreenTable = new stdClass();
$homeScreenTable->class = 'w100p table_section full_section';
$homeScreenTable->id = 'home_screen_table';
$homeScreenTable->style = [];
$homeScreenTable->rowclass = [];
$homeScreenTable->data = [];
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
}
// Home screen.
$homeScreenTable->data['captions_homescreen'][0] = __('Home screen');
$homeScreenTable->colspan['captions_homescreen'][0] = 2;
$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width';
$homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex';
$homeScreenTable->data['fields_homescreen'][0] = html_print_select(
$homeScreenValues,
'section',
io_safe_output($user_info['section']),
'show_data_section();',
'',
-1,
true,
false,
false
);
$homeScreenTable->data['fields_homescreen'][1] = html_print_div(
[
'class' => 'w100p',
'content' => $customHomeScreenDataField,
],
true
);
if (is_metaconsole() === true && users_is_admin() === true) {
$userManagementTable->rowclass['search_custom1_looknfeel'] = 'field_half_width';
$userManagementTable->rowclass['search_custom2_looknfeel'] = 'field_half_width flex-column';
$userManagementTable->data['search_custom1_looknfeel'][0] = $searchCustomFieldView[0];
$userManagementTable->data['search_custom2_looknfeel'][0] = $searchCustomFieldView[1];
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
$userManagementTable->rowclass['agent_manager1_looknfeel'] = 'field_half_width';
$userManagementTable->rowclass['agent_manager2_looknfeel'] = 'field_half_width flex-column';
$userManagementTable->data['agent_manager1_looknfeel'][0] = $metaconsoleAgentManager[0];
$userManagementTable->data['agent_manager1_looknfeel'][1] = $metaconsoleAgentManager[2];
$userManagementTable->data['agent_manager2_looknfeel'][0] = $metaconsoleAgentManager[1];
$userManagementTable->data['agent_manager2_looknfeel'][1] = $metaconsoleAgentManager[3];
}
// Timezone.
$userManagementTable->rowclass['captions_timezone'] = 'field_half_width';
@ -640,14 +664,15 @@ $userManagementTable->data['fields_timezone'][0] .= ui_print_input_placeholder(
__('The timezone must be that of the associated server.'),
true
);
$userManagementTable->data['fields_timezone'][1] = html_print_div(
[
'id' => 'timezone-picker',
'content' => implode('', $timezoneContent),
],
true
);
if (is_metaconsole() === false) {
$userManagementTable->data['fields_timezone'][1] = html_print_div(
[
'id' => 'timezone-picker',
'content' => implode('', $timezoneContent),
],
true
);
}
// Title for Language and Appearance.
$userManagementTable->data['title_additionalSettings'] = html_print_subtitle_table(__('Additional settings'));
@ -740,7 +765,3 @@ html_print_div(
);
html_print_table($userManagementTable);
// User Profile definition table. (Only where user is not creating).
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true));
}

View File

@ -731,7 +731,7 @@ class DiscoveryTaskList extends HTML
case DISCOVERY_CLOUD_AZURE_COMPUTE:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/plugin@svg.svg',
'images/plugins@svg.svg',
true,
[
'title' => __('Discovery Cloud Azure Compute'),
@ -744,7 +744,7 @@ class DiscoveryTaskList extends HTML
case DISCOVERY_CLOUD_AWS_EC2:
// Discovery Applications MySQL.
$data[6] = html_print_image(
'images/plugin@svg.svg',
'images/plugins@svg.svg',
true,
[
'title' => __('Discovery Cloud AWS EC2'),
@ -835,7 +835,10 @@ class DiscoveryTaskList extends HTML
$data[6] = html_print_image(
'images/cluster@os.svg',
true,
['title' => __('Discovery Applications Microsoft SQL Server')]
[
'title' => __('Discovery Applications Microsoft SQL Server'),
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.Microsoft SQL Server');
break;
@ -856,7 +859,7 @@ class DiscoveryTaskList extends HTML
} else {
// APP or external script recon task.
$data[6] = html_print_image(
'images/plugin@svg.svg',
'images/plugins@svg.svg',
true,
['class' => 'main_menu_icon invert_filter']
).'&nbsp;&nbsp;';
@ -871,9 +874,9 @@ class DiscoveryTaskList extends HTML
$data[7] = ui_progress(
$task['status'],
'100%',
1.9,
1.2,
// Color.
'#82b92e',
'#ececec',
// Return.
true,
// Text.
@ -888,7 +891,8 @@ class DiscoveryTaskList extends HTML
'id' => $task['id_rt'],
'method' => 'taskProgress',
],
]
],
''
);
}
@ -1218,12 +1222,12 @@ class DiscoveryTaskList extends HTML
$result .= progress_circular_bar(
$task['id_rt'],
($task['status'] < 0) ? 100 : $task['status'],
200,
200,
'#7eb641',
150,
150,
'#3A3A3A',
'%',
'',
'#3A3A3A',
'#ececec',
0
);
@ -1288,12 +1292,12 @@ class DiscoveryTaskList extends HTML
$result .= progress_circular_bar(
$task['id_rt'].'_detail',
$task['stats']['c_network_percent'],
200,
200,
'#7eb641',
150,
150,
'#3A3A3A',
'%',
'',
'#3A3A3A',
'#ececec',
0
);
$result .= '</div></div>';

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 20 20" 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>Dark / 20 / star@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-star" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,16.5 L5.32783438,18.9563028 C4.83898979,19.2133036 4.23436264,19.0253571 3.97736183,18.5365125 C3.87502276,18.3418521 3.83970808,18.118884 3.87688493,17.9021263 L4.76918916,12.6995935 L4.76918916,12.6995935 L0.989327772,9.01513923 C0.593844194,8.62963801 0.585751887,7.99652475 0.971253099,7.60104117 C1.1247617,7.44355754 1.32590411,7.34107036 1.54354115,7.30944585 L6.76718111,6.55040653 L6.76718111,6.55040653 L9.10326392,1.81698575 C9.34768622,1.32173209 9.94731205,1.11839309 10.4425657,1.36281539 C10.6397783,1.46014562 10.7994058,1.61977315 10.8967361,1.81698575 L13.2328189,6.55040653 L13.2328189,6.55040653 L18.4564589,7.30944585 C19.0030037,7.38886347 19.3816852,7.89630632 19.3022676,8.44285118 C19.270643,8.66048821 19.1681559,8.86163062 19.0106722,9.01513923 L15.2308108,12.6995935 L15.2308108,12.6995935 L16.1231151,17.9021263 C16.2164761,18.4464628 15.8508883,18.9634187 15.3065518,19.0567797 C15.0897942,19.0939566 14.8668261,19.0586419 14.6721656,18.9563028 L10,16.5 L10,16.5 Z" id="Star" fill="#a6adb2"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 27.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;}
.st1{fill:#000000;}
</style>
<g id="Dark-/-20-/-delete-v2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group" transform="translate(10.000000, 10.000000) rotate(0.000000) translate(-10.000000, -10.000000) translate(4.000000, 4.000000)" fill="#3F3F3F">
<path d="M6,0 C6.51283584,0 6.93550716,0.38604019 6.99327227,0.883378875 L7,1 L7,5 L11,5 C11.5522847,5 12,5.44771525 12,6 C12,6.51283584 11.6139598,6.93550716 11.1166211,6.99327227 L11,7 L7,7 L7,11 C7,11.5522847 6.55228475,12 6,12 C5.48716416,12 5.06449284,11.6139598 5.00672773,11.1166211 L5,11 L5,7 L1,7 C0.44771525,7 0,6.55228475 0,6 C0,5.48716416 0.38604019,5.06449284 0.883378875,5.00672773 L1,5 L5,5 L5,1 C5,0.44771525 5.44771525,0 6,0 Z" id="Path-7"></path>
</g>
<path d="M10,0 C4.4771525,0 0,4.4771525 0,10 C0,15.5228475 4.4771525,20 10,20 C15.5228475,20 20,15.5228475 20,10 C20,4.4771525 15.5228475,0 10,0 Z M10,2 C14.418278,2 18,5.581722 18,10 C18,14.418278 14.418278,18 10,18 C5.581722,18 2,14.418278 2,10 C2,5.581722 5.581722,2 10,2 Z" id="Oval" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g>
<circle cx="10" cy="10" r="10" fill="#3F3F3F"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 237 B

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" 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>Dark / 20 / web@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-web" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,0 C4.4771525,0 0,4.4771525 0,10 C0,15.5228475 4.4771525,20 10,20 C15.5228475,20 20,15.5228475 20,10 C19.9945565,4.47940886 15.5205911,0.00544352451 10,0 Z M10.0288333,17.4971042 C10.0246667,17.4971042 10.0206042,17.4983125 10.0163333,17.4983125 C9.68185417,17.3901458 9.011375,16.3172917 8.56475,14.3237292 C9.04327083,14.3508125 9.52308333,14.375 10,14.375 C10.4774375,14.375 10.9581042,14.3508958 11.437375,14.3237292 C10.9950208,16.3143958 10.3361458,17.3863125 10.0288333,17.4971042 Z M10,11.875 C9.35577083,11.875 8.75960417,11.8472292 8.19702083,11.8032917 C8.15291667,11.2406875 8.125,10.6442292 8.125,10 C8.125,9.35577083 8.15277083,8.75960417 8.19670833,8.19702083 C8.7593125,8.15291667 9.35577083,8.125 10,8.125 C10.6442292,8.125 11.2403958,8.15277083 11.8029792,8.19670833 C11.8470833,8.7593125 11.875,9.35577083 11.875,10 C11.875,10.6442292 11.8472292,11.2403958 11.8032917,11.8029792 C11.2406875,11.8470833 10.6442292,11.875 10,11.875 Z M2.50289583,10.0288333 C2.50289583,10.0246667 2.5016875,10.0206042 2.5016875,10.0163333 C2.60985417,9.68185417 3.68270833,9.011375 5.67627083,8.56475 C5.64927083,9.04327083 5.625,9.52316667 5.625,10 C5.625,10.4774375 5.64910417,10.9581042 5.67627083,11.437375 C3.68560417,10.9950208 2.6136875,10.3361458 2.50289583,10.0288333 Z M9.97116667,2.50289583 C9.97533333,2.50289583 9.97939583,2.5016875 9.98366667,2.5016875 C10.3181458,2.60985417 10.988625,3.68270833 11.43525,5.67627083 C10.9567292,5.64927083 10.4768333,5.625 10,5.625 C9.5225625,5.625 9.04189583,5.64910417 8.562625,5.67627083 C9.00497917,3.68560417 9.66385417,2.6136875 9.97116667,2.50289583 Z M14.3237292,8.562625 C16.3143958,9.00497917 17.3862292,9.66385417 17.4971042,9.97116667 C17.4971042,9.97533333 17.4983125,9.97939583 17.4983125,9.98366667 C17.3901458,10.3181458 16.3172917,10.988625 14.3237292,11.43525 C14.3508125,10.9567292 14.375,10.4769167 14.375,10 C14.375,9.5225625 14.3508958,9.04189583 14.3237292,8.562625 Z M16.671,6.64397917 C15.8116964,6.34280615 14.9276165,6.11763659 14.0289375,5.9710625 C13.8823634,5.07238349 13.6571938,4.18830364 13.3560208,3.329 C14.7866526,4.05165344 15.9483466,5.21334744 16.671,6.64397917 L16.671,6.64397917 Z M6.64375,3.329 C6.34261768,4.18830554 6.11749674,5.07238609 5.97097917,5.9710625 C5.0723873,6.11755451 4.18838995,6.34264769 3.32916667,6.64375 C4.05172797,5.21324363 5.21327996,4.05163323 6.64375,3.329 L6.64375,3.329 Z M3.32916667,13.35625 C4.1884091,13.6574028 5.07243613,13.8825243 5.9710625,14.0290208 C6.11753664,14.9276164 6.34263021,15.8116153 6.64375,16.6708333 C5.21325958,15.948307 4.05169302,14.7867404 3.32916667,13.35625 Z M13.35625,16.6708333 C13.6573853,15.8115856 13.8825065,14.9275601 14.0290208,14.0289375 C14.9276665,13.8824423 15.8117189,13.6573493 16.671,13.35625 C15.9483668,14.78672 14.7867564,15.948272 13.35625,16.6708333 L13.35625,16.6708333 Z" id="Shape" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -216,11 +216,8 @@ if ($get_double_auth_info_page) {
$html .= '</p>';
$html .= '</div>';
$html .= '<br>';
$html .= '<div class="center_align">';
$html .= '<div class="flex flex-space-around">';
$html .= html_print_button(__('Download the app'), 'google_authenticator_download', false, '', '', true);
$html .= '</div>';
$html .= '<br>';
$html .= '<div class="center_align">';
$html .= html_print_button(__('Continue'), 'continue_to_generate', false, '', '', true);
$html .= '</div>';
@ -311,11 +308,11 @@ if ($get_double_auth_generation_page) {
$html .= '<br>';
$html .= __('QR').': <br>';
$html .= '<div id="qr-container"></div>';
$html .= '<br>';
$html .= '<br><div class="flex flex-space-around">';
$html .= html_print_button(__('Refresh code'), 'continue_to_generate', false, '', '', true);
$html .= '&nbsp;';
$html .= html_print_button(__('Continue'), 'continue_to_validate', false, '', '', true);
$html .= '</div>';
$html .= '</div>';
ob_clean();
?>
@ -453,7 +450,7 @@ if ($get_double_auth_validation_page) {
$html .= html_print_input_text('code', '', '', 50, $secret_lenght, true);
$html .= '<div id="code_input_message" class="red"></div>';
$html .= '<br><br>';
$html .= '<div id="button-container">';
$html .= '<div id="button-container" class="flex flex-space-around">';
$html .= html_print_button(__('Validate code'), 'continue_to_validate', false, '', '', true);
$html .= html_print_image('images/spinner.gif', true);
$html .= '</div>';

View File

@ -91,9 +91,8 @@ $node_id = (int) get_parameter('node_id', 0);
if ($get_comments === true) {
$event = get_parameter('event', false);
$event_rep = (int) get_parameter('event_rep', 0);
$event_rep = get_parameter_post('event')['event_rep'];
$group_rep = get_parameter_post('event')['group_rep'];
$event_rep = (int) get_parameter_post('event')['event_rep'];
$group_rep = (int) get_parameter_post('event')['group_rep'];
if ($event === false) {
return __('Failed to retrieve comments');
@ -126,7 +125,7 @@ if ($get_comments === true) {
} else if ($group_rep === EVENT_GROUP_REP_EXTRAIDS) {
$whereGrouped = sprintf(
'`id_extra` = "%s"',
$event['id_extra']
io_safe_output($event['id_extra'])
);
} else {
$whereGrouped = sprintf('`id_evento` = %d', $event['id_evento']);

View File

@ -0,0 +1,82 @@
<?php
/**
* Fav menu
*
* @category Ajax library.
* @package Pandora FMS
* @subpackage Modules.
* @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.
* ============================================================================
*/
// Begin.
global $config;
// Login check
check_login();
if (is_ajax() === false) {
exit;
}
$id_element = get_parameter('id_element', '');
$url = io_safe_output(get_parameter('url', ''));
$label = get_parameter('label', '');
$section = get_parameter('section', '');
$id_user = $config['id_user'];
$exist = db_get_row_filter(
'tfavmenu_user',
[
'url' => $url,
'id_user' => $config['id_user'],
],
['*']
);
$res = false;
$action = '';
if ($exist !== false) {
$res = db_process_sql_delete(
'tfavmenu_user',
[
'url' => $url,
'id_user' => $config['id_user'],
]
);
$action = 'delete';
} else {
$res = db_process_sql_insert(
'tfavmenu_user',
[
'id_element' => $id_element,
'url' => $url,
'label' => $label,
'section' => $section,
'id_user' => $id_user,
]
);
$action = 'create';
}
if ($res !== false) {
echo json_encode(['success' => true, 'action' => $action]);
} else {
echo json_encode(['success' => false, 'action' => $action]);
}

View File

@ -25,6 +25,8 @@ if ((bool) is_metaconsole() === true) {
if ($networkmap) {
$networkmap_id = get_parameter('networkmap_id', 0);
$dashboard = get_parameter('dashboard', 0);
$size = get_parameter('size', []);
$x_offset = get_parameter('x_offset', 0);
$y_offset = get_parameter('y_offset', 0);
$zoom_dash = get_parameter('zoom_dash', 0.5);
@ -62,6 +64,15 @@ if ($networkmap) {
global $id_networkmap;
$id_networkmap = $networkmap['id'];
$tab = 'radial_dynamic';
if (empty($size) === false) {
if ($size['width'] > $size['height']) {
$width = $size['height'];
$height = ($size['height'] - 10);
} else {
$width = $size['width'];
$height = ($size['width'] + 50);
}
}
include_once 'operation/agentes/networkmap.dinamic.php';
} else {

View File

@ -1573,7 +1573,7 @@ if (check_login()) {
$value['thresholds']
);
$resultData = '<span style="color:'.$status['color'].'">';
$resultData = '<span class="widget-module-tabs-data" style="color:'.$status['color'].'">';
if ($vdata !== null && $vdata !== '' && $vdata !== false) {
if (isset($formatData) === true
&& (bool) $formatData === true
@ -1750,7 +1750,9 @@ if (check_login()) {
INNER JOIN tagente
ON tagente_modulo.id_agente = tagente.id_agente
INNER JOIN tagente_estado
ON tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo'
ON tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
WHERE %s',
$where
);
$recordsTotal = db_get_value_sql($sql_count);
@ -1795,6 +1797,32 @@ if (check_login()) {
}
}
if (in_array(0, $servers_ids) === true) {
$sql = sprintf(
'SELECT
tagente_modulo.nombre,
tagente.alias,
tagente.id_agente,
tagente_estado.last_status_change,
tagente_estado.estado
FROM tagente_modulo
INNER JOIN tagente
ON tagente_modulo.id_agente = tagente.id_agente
INNER JOIN tagente_estado
ON tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
WHERE %s',
$where
);
$res_sql = db_get_all_rows_sql($sql);
foreach ($res_sql as $row_sql) {
$row_sql['server_name'] = __('Metaconsole');
$row_sql['server_url'] = $config['homeurl'];
array_push($data, $row_sql);
}
}
// Drop temporary table if exist.
db_process_sql('DROP TEMPORARY TABLE IF EXISTS temp_modules_status;');
@ -1852,7 +1880,9 @@ if (check_login()) {
$sql_count = sprintf(
'SELECT COUNT(*) AS "total"
FROM temp_modules_status'
FROM temp_modules_status
WHERE %s',
$where
);
$recordsTotal = db_get_value_sql($sql_count);
@ -2044,6 +2074,14 @@ if (check_login()) {
if ($monitor_filters === false) {
echo 'error';
} else {
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id,
'section' => 'Modules',
'id_user' => $config['id_user'],
]
);
echo 'ok';
}
}

View File

@ -27,8 +27,6 @@
*/
// Begin.
require_once 'config.php';
require_once __DIR__.'/config.php';
require_once __DIR__.'/functions.php';
require_once __DIR__.'/functions_db.php';
@ -87,7 +85,7 @@ if (check_login(false) === false) {
</head>
<body>
<h1>Access is not granted</h1>
<div id="container-chart-generator-item" style="display:none; margin:0px;">
<div id="container-chart-generator-item" style="display:none; margin:0px;width:100px;height:100px;">
</body>
</html>
@ -246,6 +244,9 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
break;
case 'slicebar':
// TO-DO Cambiar esto para que se pase por POST, NO SE PUEDE PASAR POR GET.
$params['graph_data'] = json_decode(io_safe_output($config[$params['tokem_config']]), true);
delete_config_token($params['tokem_config']);
echo flot_slicesbar_graph(
$params['graph_data'],
$params['period'],

View File

@ -601,6 +601,7 @@ class AgentWizard extends HTML
'action' => $this->sectionUrl,
'id' => 'form-main-wizard',
'method' => 'POST',
'class' => 'white_box pdd_20px filter-list-adv',
];
// Inputs.
@ -829,24 +830,22 @@ class AgentWizard extends HTML
];
}
$inputs[] = [
'arguments' => [
'label' => $this->actionLabel,
'name' => 'sub-protocol',
'type' => 'submit',
'attributes' => [
html_print_action_buttons(
html_print_submit_button(
$this->actionLabel,
'sub-protocol',
false,
[
'icon' => 'cog',
'onclick' => '$(\'#form-main-wizard\').submit();',
'onclick' => '$("#form-main-wizard").submit();',
],
'return' => true,
],
];
true
)
);
// Prints main form.
html_print_div(
[
'class' => 'white_box',
'style' => 'padding: 20px',
'content' => $this->printForm(
[
'form' => $form,
@ -1330,7 +1329,7 @@ class AgentWizard extends HTML
$table->rowstyle[$i] = 'color:#ccc;';
$data[0] .= ' ';
$data[0] .= html_print_image(
'images/error.png',
'images/alert-warning@svg.svg',
true,
['title' => $msgError]
);
@ -1348,7 +1347,7 @@ class AgentWizard extends HTML
// Img Server.
if ($this->serverType == SERVER_TYPE_ENTERPRISE_SATELLITE) {
$img_server = html_print_image(
'images/satellite.png',
'images/satellite@os.svg',
true,
[
'title' => __('Enterprise Satellite server'),
@ -1358,7 +1357,7 @@ class AgentWizard extends HTML
} else {
if ($module['execution_type'] == EXECUTION_TYPE_PLUGIN) {
$img_server = html_print_image(
'images/plugin.png',
'images/plugins@svg.svg',
true,
[
'title' => __('Plugin server'),
@ -1368,7 +1367,7 @@ class AgentWizard extends HTML
} else {
if ($this->protocol === 'wmi') {
$img_server = html_print_image(
'images/wmi.png',
'images/WMI@svg.svg',
true,
[
'title' => __('WMI server'),
@ -1377,7 +1376,7 @@ class AgentWizard extends HTML
);
} else {
$img_server = html_print_image(
'images/op_network.png',
'images/network@svg.svg',
true,
[
'title' => __('Network server'),
@ -4091,7 +4090,7 @@ class AgentWizard extends HTML
$blockTitle .= '<b>'.$block['name'];
$blockTitle .= '&nbsp;&nbsp;';
$blockTitle .= html_print_image(
'images/tip_help.png',
'images/info@svg.svg',
true,
[
'title' => __('Modules selected'),
@ -4111,7 +4110,7 @@ class AgentWizard extends HTML
$blockTitle .= '&nbsp;&nbsp;';
$blockTitle .= html_print_image(
'images/tip_help.png',
'images/info@svg.svg',
true,
[
'title' => __('Modules selected'),
@ -4206,6 +4205,9 @@ class AgentWizard extends HTML
$table->size[4] = '140px';
$table->size[5] = '3%';
$table->align = [];
$table->align[1] = 'center';
// If is needed show current value, we must correct the table.
if ($showCurrentValue === true) {
// Correct headers.
@ -4274,7 +4276,7 @@ class AgentWizard extends HTML
false,
false,
'',
$md5IdBlock,
$md5IdBlock.' w100p',
'',
'',
false,
@ -4294,8 +4296,9 @@ class AgentWizard extends HTML
1,
20,
$module['description'],
'form=\'form-create-modules\' class=\'min-height-50px\'',
true
'form=\'form-create-modules\'',
true,
'w100p'
);
}
@ -4704,8 +4707,6 @@ class AgentWizard extends HTML
'toggle_class' => '',
'container_class' => 'white-box-content',
'main_class' => $class,
'img_a' => 'images/arrow_down_green.png',
'img_b' => 'images/arrow_right_green.png',
'clean' => false,
'reverseImg' => $reverseImg,
'switch' => $buttonSwitch,
@ -5980,7 +5981,7 @@ class AgentWizard extends HTML
});
// Loading.
$('#submit-sub-protocol').click(function() {
$('#button-sub-protocol').click(function() {
$('.wizard-result').remove();
$('#form-create-modules').remove();
$('.textodialogo').remove();

View File

@ -1831,7 +1831,7 @@ class Diagnostics extends Wizard
if ($items[$key]['status'] === 2) {
$items[$key]['value'] = html_print_image(
'images/icono-warning.png',
'images/alert-yellow@svg.svg',
true,
[
'title' => __('Warning'),
@ -1840,7 +1840,7 @@ class Diagnostics extends Wizard
);
} else if ($items[$key]['status'] === 1) {
$items[$key]['value'] = html_print_image(
'images/exito.png',
'images/validate.svg',
true,
[
'title' => __('Successfully'),
@ -1849,7 +1849,7 @@ class Diagnostics extends Wizard
);
} else {
$items[$key]['value'] = html_print_image(
'images/error_1.png',
'images/fail@svg.svg',
true,
[
'title' => __('Error'),

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -203,132 +203,161 @@ class ExternalTools extends HTML
}
}
html_print_div(['id' => 'layer_sound_alert']);
html_print_div(['id' => 'layer_sound_critical']);
html_print_div(['id' => 'layer_sound_warning']);
// Make the table for show the form.
$table = new stdClass();
$table->width = '100%';
$table->class = 'filter-table-adv';
$table->id = 'commandsTable';
$table->data = [];
$table->data[$i][0] = __('Sound for Alert fired');
$table->data[$i][1] = html_print_select(
$sounds,
'sound_alert',
$config['sound_alert'],
'replaySound(\'alert\');',
'',
'',
true
);
$table->data[$i][1] .= html_print_anchor(
[
'href' => 'javascript:toggleButton(\'alert\')',
'content' => html_print_image(
'images/control_play_col.png',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle;',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
);
$table->data[$i++][1] .= '<div id="layer_sound_alert"></div>';
$table->data[$i][0] = __('Sound for Monitor critical');
$table->data[$i][1] = html_print_select(
$sounds,
'sound_critical',
$config['sound_critical'],
'replaySound(\'critical\');',
'',
'',
true
);
$table->data[$i][1] .= html_print_anchor(
[
'href' => 'javascript:toggleButton(\'critical\')',
'content' => html_print_image(
'images/control_play_col.png',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle;',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
);
$table->data[$i++][1] .= '<div id="layer_sound_critical"></div>';
$table->data[$i][0] = __('Sound for Monitor warning');
$table->data[$i][1] = html_print_select(
$sounds,
'sound_warning',
$config['sound_warning'],
'replaySound(\'warning\');',
'',
'',
true
);
$table->data[$i][1] .= html_print_anchor(
[
'href' => 'javascript:toggleButton(\'warning\')',
'content' => html_print_image(
'images/control_play_col.png',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle;',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
);
$table->data[$i++][1] .= '<div id="layer_sound_warning"></div>';
$table->data[$i][0] = __('Custom graphviz directory');
$table->data[$i++][1] = html_print_input_text(
'graphviz_bin_dir',
$config['graphviz_bin_dir'],
'',
25,
255,
true
$table->data[$i][] = html_print_label_input_block(
__('Sound for Alert fired'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$sounds,
'sound_alert',
$config['sound_alert'],
'replaySound(\'alert\');',
'',
'',
true
).html_print_anchor(
[
'href' => 'javascript:toggleButton(\'alert\')',
'content' => html_print_image(
'images/change-active.svg',
true,
[
'id' => 'button_sound_alert',
'style' => 'vertical-align: middle; margin-left: 10px',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
),
],
true
),
);
$table->data[$i][0] = __('Traceroute path');
$table->data[$i++][1] = html_print_input_text('traceroute_path', $this->pathTraceroute, '', 40, 255, true);
$table->data[$i++][] = html_print_label_input_block(
__('Sound for Monitor critical'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$sounds,
'sound_critical',
$config['sound_critical'],
'replaySound(\'critical\');',
'',
'',
true
).html_print_anchor(
[
'href' => 'javascript:toggleButton(\'critical\')',
'content' => html_print_image(
'images/change-active.svg',
true,
[
'id' => 'button_sound_critical',
'style' => 'vertical-align: middle; margin-left: 10px',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
),
],
true
),
);
$table->data[$i][0] = __('Ping path');
$table->data[$i++][1] = html_print_input_text('ping_path', $this->pathPing, '', 40, 255, true);
$table->data[$i++][] = html_print_label_input_block(
__('Sound for Monitor warning'),
html_print_div(
[
'class' => '',
'content' => html_print_select(
$sounds,
'sound_warning',
$config['sound_warning'],
'replaySound(\'warning\');',
'',
'',
true
).html_print_anchor(
[
'href' => 'javascript:toggleButton(\'warning\')',
'content' => html_print_image(
'images/change-active.svg',
true,
[
'id' => 'button_sound_warning',
'style' => 'vertical-align: middle; margin-left: 10px',
'width' => '16',
'title' => __('Play sound'),
'class' => 'invert_filter',
]
),
],
true
),
],
true
),
);
$table->data[$i][0] = __('Nmap path');
$table->data[$i++][1] = html_print_input_text('nmap_path', $this->pathNmap, '', 40, 255, true);
$table->data[$i][] = html_print_label_input_block(
__('Custom graphviz directory'),
html_print_input_text(
'graphviz_bin_dir',
$config['graphviz_bin_dir'],
'',
25,
255,
true
)
);
$table->data[$i][0] = __('Dig path');
$table->data[$i++][1] = html_print_input_text('dig_path', $this->pathDig, '', 40, 255, true);
$table->data[$i++][] = html_print_label_input_block(
__('Snmpget path'),
html_print_input_text('snmpget_path', $this->pathSnmpget, '', 40, 255, true)
);
$table->data[$i][0] = __('Snmpget path');
$table->data[$i++][1] = html_print_input_text('snmpget_path', $this->pathSnmpget, '', 40, 255, true);
$table->data[$i][] = html_print_label_input_block(
__('Traceroute path'),
html_print_input_text('traceroute_path', $this->pathTraceroute, '', 40, 255, true)
);
$table->data[$i++][] = html_print_label_input_block(
__('Ping path'),
html_print_input_text('ping_path', $this->pathPing, '', 40, 255, true)
);
$table->data[$i][] = html_print_label_input_block(
__('Nmap path'),
html_print_input_text('nmap_path', $this->pathNmap, '', 40, 255, true)
);
$table->data[$i++][] = html_print_label_input_block(
__('Dig path'),
html_print_input_text('dig_path', $this->pathDig, '', 40, 255, true)
);
$table->data[$i][0] = html_print_div(
[
'class' => 'title_custom_commands bolder float-left',
'content' => __('Custom commands'),
'content' => '<label>'.__('Custom commands').'</label>',
],
true
);
@ -336,13 +365,13 @@ class ExternalTools extends HTML
[
'id' => 'add_button_custom_command',
'content' => html_print_image(
'images/add.png',
'images/plus@svg.svg',
true,
[
'title' => __('Add new custom command'),
'onclick' => 'manageCommandLines(event)',
'id' => 'img_add_button_custom_command',
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
),
@ -350,8 +379,8 @@ class ExternalTools extends HTML
true
);
$table->data[$i][0] = __('Command');
$table->data[$i++][1] = __('Parameters').ui_print_help_tip(__('Adding `_address_` macro will use agent\'s IP when perform the execution'), true);
$table->data[$i][0] = '<div><label>'.__('Command').'</label></div>';
$table->data[$i++][1] = '<div style="flex-direction: row;justify-content: flex-start;"><label>'.__('Parameters').'</label>'.ui_print_help_tip(__('Adding `_address_` macro will use agent\'s IP when perform the execution'), true, '', false, 'margin-top: 2px').'</div>';
$y = 1;
$iRow = $i;
@ -378,30 +407,27 @@ class ExternalTools extends HTML
}
}
$form = '<form id="form_setup" method="post" >';
$form = '<form class="max_floating_element_size" id="form_setup" method="POST" >';
$form .= '<fieldset>';
$form .= '<legend>'.__('Options').'</legend>';
$form .= html_print_input_hidden('update_paths', 1, true);
$form .= html_print_table($table, true);
$form .= '</fieldset>';
$form .= html_print_div(
[
'id' => '',
'class' => 'action-buttons',
'style' => 'width: 100%',
'content' => html_print_submit_button(
__('Update'),
'update_button',
false,
[ 'icon' => 'update' ],
true
),
],
true
);
$form .= '</form>';
html_print_action_buttons(
html_print_submit_button(
__('Update'),
'update_button',
false,
[
'icon' => 'update',
'form' => 'form_setup',
],
true
)
);
echo $form;
}
@ -436,15 +462,14 @@ class ExternalTools extends HTML
$output = html_print_div(
[
'id' => 'delete_button_custom_'.$index,
'class' => '',
'content' => html_print_image(
'images/delete.png',
'images/delete.svg',
true,
[
'title' => __('Delete this custom command'),
'onclick' => 'manageCommandLines(event)',
'id' => 'img_delete_button_custom_'.$index,
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
),
],
@ -528,77 +553,103 @@ class ExternalTools extends HTML
// Form table.
$table = new StdClass();
$table->class = 'fixed_filter_bar';
$table->class = 'fixed_filter_bar filter-table-adv pdd_15px';
$table->id = 'externalToolTable';
$table->cellstyle['captions'][0] = 'width: 0';
$table->cellstyle['captions'][1] = 'width: 0';
$table->cellstyle['captions'][2] = 'width: 0';
$table->size[0] = '25%';
$table->size[1] = '25%';
$table->size[2] = '25%';
$table->size[3] = '25%';
$table->colspan = [];
$table->colspan[1][0] = 4;
// $table->cellclass[0][2] = 'snmpcolumn';
// $table->cellclass[0][2] = 'snmpcolumn';
// $table->cellclass[0][3] = 'snmpcolumn';
// $table->cellclass[0][3] = 'snmpcolumn';
$table->data = [];
$table->data['captions'][0] = __('Operation');
$table->data['inputs'][0] = html_print_select(
$commandList,
'operation',
$this->operation,
'mostrarColumns(this.value)',
__('Please select'),
0,
true
$table->data[0][0] = html_print_label_input_block(
__('Operation'),
html_print_select(
$commandList,
'operation',
$this->operation,
'mostrarColumns(this.value)',
__('Please select'),
0,
true,
false,
true,
'w100p',
false,
'width: 100%;'
)
);
$table->data['captions'][1] = __('IP Adress');
$table->data['inputs'][1] = html_print_select(
$ipsSelect,
'select_ips',
$principal_ip,
'',
'',
0,
true
$table->data[0][1] = html_print_label_input_block(
__('IP Adress'),
html_print_select(
$ipsSelect,
'select_ips',
$principal_ip,
'',
'',
0,
true,
false,
true,
'w100p',
false,
'width: 100%;'
)
);
$table->cellclass['captions'][2] = 'snmpcolumn';
$table->cellclass['inputs'][2] = 'snmpcolumn';
$table->data['captions'][2] = __('SNMP Version');
$table->data['inputs'][2] = html_print_select(
$table->data[0][2] = html_print_label_input_block(
__('SNMP Version'),
html_print_select(
[
'1' => 'v1',
'2c' => 'v2c',
],
'select_version',
$this->snmp_version,
'',
'',
0,
true,
false,
true,
'w100p',
false,
'width: 100%;'
),
['div_class' => 'snmpcolumn']
);
$table->data[0][3] = html_print_label_input_block(
__('SNMP Community'),
html_print_input_text(
'community',
$this->community,
'',
50,
255,
true,
false,
false,
'',
'w100p'
),
['div_class' => 'snmpcolumn']
);
$table->data[1][0] = html_print_submit_button(
__('Execute'),
'submit',
false,
[
'1' => 'v1',
'2c' => 'v2c',
],
'select_version',
$this->snmp_version,
'',
'',
0,
true
);
$table->cellclass['captions'][3] = 'snmpcolumn';
$table->cellclass['inputs'][3] = 'snmpcolumn';
$table->data['captions'][3] = __('SNMP Community');
$table->data['inputs'][3] = html_print_input_text(
'community',
$this->community,
'',
50,
255,
true
);
$table->data['inputs'][4] = html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Execute'),
'submit',
false,
[
'icon' => 'cog',
'mode' => 'mini',
],
true
),
'icon' => 'cog',
'mode' => 'mini',
'class' => 'float-right mrgn_right_10px',
],
true
);
@ -716,7 +767,7 @@ class ExternalTools extends HTML
*/
private function performExecution(string $command='', string $caption='')
{
$output = '';
$output = '<div class="white_box max_floating_element_size no_border">';
try {
// If caption is not added, don't show anything.
@ -736,7 +787,7 @@ class ExternalTools extends HTML
$output .= __('Command not response');
}
$output .= '</pre>';
$output .= '</pre></div>';
if ($resultCode !== 0) {
throw new Exception(
@ -774,6 +825,8 @@ class ExternalTools extends HTML
{
$output = '';
echo '<div class="white_box max_floating_element_size no_border pdd_15px">';
if (validate_address($ip) === false) {
$output .= ui_print_error_message(
__('The ip or dns name entered cannot be resolved'),
@ -938,6 +991,7 @@ class ExternalTools extends HTML
}
}
echo '</div>';
return $output;
}

View File

@ -453,7 +453,7 @@ class ManageNetScanScripts extends Wizard
'delete',
'images/delete.svg',
1,
'width:40px;',
'',
true,
[
'title' => __('Delete Script'),

View File

@ -868,7 +868,7 @@ class ModuleTemplates extends HTML
'delete_profile',
'images/delete.svg',
$row['id_np'],
'width:40px',
'',
true,
[
'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
@ -1156,7 +1156,7 @@ class ModuleTemplates extends HTML
'del_block_'.$id_group.'_',
'images/delete.svg',
1,
'width: 40px',
'',
true,
[
'title' => __('Delete this block'),
@ -1253,7 +1253,7 @@ class ModuleTemplates extends HTML
'del_module_'.$module['component_id'].'_',
'images/delete.svg',
1,
'width:40px;',
'',
true,
[
'title' => __('Delete this module'),

View File

@ -393,7 +393,7 @@ class SatelliteAgent extends HTML
true,
[
'border' => '0',
'class' => 'action_button_img mrgn_lft_05em invert_filter',
'class' => 'main_menu_icon mrgn_lft_05em invert_filter',
'onclick' => 'disable_agent(\''.$tmp->address.'\',\''.strip_tags($tmp->name).'\',\''.(int) $disable.'\',\''.$id_agente.'\')',
]
);
@ -405,7 +405,7 @@ class SatelliteAgent extends HTML
true,
[
'border' => '0',
'class' => 'action_button_img mrgn_lft_05em invert_filter',
'class' => 'main_menu_icon mrgn_lft_05em invert_filter',
'onclick' => 'delete_agent(\''.$tmp->address.'\',\''.strip_tags($tmp->name).'\',\''.(int) $delete.'\',\''.$id_agente.'\')',
]
);

View File

@ -181,113 +181,47 @@ class SnmpConsole extends HTML
$default_refr = 300;
if (!isset($config['pure']) || $config['pure'] === false) {
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'">'.html_print_image(
'images/logs@svg.svg',
true,
[
'title' => __('Statistics'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$list['text'] = '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pure=0">'.html_print_image(
'images/SNMP-network-numeric-data@svg.svg',
true,
[
'title' => __('List'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$list['active'] = true;
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure='.$config['pure'].'">'.html_print_image(
'images/logs@svg.svg',
true,
[
'title' => __('Statistics'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$list['text'] = '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pure=0">'.html_print_image(
'images/SNMP-network-numeric-data@svg.svg',
true,
[
'title' => __('List'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
$list['active'] = true;
$screen['text'] = '<a href="#" onClick="javascript:fullscreen(1)">'.html_print_image(
'images/fullscreen@svg.svg',
true,
// Header.
ui_print_standard_header(
__('SNMP Console'),
'images/op_snmp.png',
false,
'snmp_console',
false,
[
$screen,
$list,
$statistics,
],
[
[
'title' => __('View in full screen'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
// Header.
ui_print_standard_header(
__('SNMP Console'),
'images/op_snmp.png',
false,
'snmp_console',
false,
[
$screen,
$list,
$statistics,
'link' => '',
'label' => __('Monitoring'),
],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('SNMP'),
],
]
);
} else {
echo '<div id="dashboard-controls">';
echo '<div id="menu_tab">';
echo '<ul class="mn">';
// Normal view button.
echo '<li class="nomn">';
echo '<a href="#" onClick="javascript:fullscreen(0)">';
echo html_print_image(
'images/exit_fullscreen@svg.svg',
true,
[
'title' => __('Exit fullscreen'),
'class' => 'main_menu_icon invert_filter',
]
);
echo '</a>';
echo '</li>';
// Auto refresh control.
echo '<li class="nomn">';
echo '<div class="dashboard-refr mrgn_top_6px">';
echo '<div class="dashboard-countdown display_in"></div>';
$normal_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view';
echo '<form id="refr-form" method="get" action="'.$normal_url.'" >';
echo __('Refresh every').':';
echo html_print_select(get_refresh_time_array(), 'refresh', $this->refr, '', '', 0, true, false, false);
echo '</form>';
echo '</li>';
html_print_input_hidden('sec', 'snmpconsole');
html_print_input_hidden('sec2', 'operation/snmpconsole/snmp_view');
html_print_input_hidden('pure', 1);
html_print_input_hidden('refresh', (($this->refr > 0) ? $this->refr : $default_refr));
// Dashboard name.
echo '<li class="nomn">';
echo '<div class="dashboard-title">'.__('SNMP Traps').'</div>';
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR.'/include/styles/');
ui_require_css_file('pandora_dashboard', ENTERPRISE_DIR.'/include/styles/');
ui_require_css_file('cluetip', 'include/styles/js/');
ui_require_jquery_file('countdown');
ui_require_javascript_file('pandora_dashboard', ENTERPRISE_DIR.'/include/javascript/');
ui_require_javascript_file('wz_jsgraphics');
ui_require_javascript_file('pandora_visual_console');
}
'link' => '',
'label' => __('SNMP'),
],
]
);
// Datatables list.
try {
@ -325,7 +259,10 @@ class SnmpConsole extends HTML
'class' => 'snmp-td',
],
'alert',
'action',
[
'text' => 'action',
'class' => 'table_action_buttons w120px',
],
[
'text' => 'm',
'class' => 'mw60px pdd_0px',

View File

@ -121,6 +121,10 @@ class TipsWindow
}
ui_require_css_file('tips_window');
if ($config['style'] === 'pandora_black' && is_metaconsole() === false) {
ui_require_css_file('pandora_black');
}
ui_require_css_file('jquery.bxslider');
ui_require_javascript_file('tipsWindow');
ui_require_javascript_file('jquery.bxslider.min');
@ -157,11 +161,12 @@ class TipsWindow
View::render(
'dashboard/tipsWindow',
[
'title' => $initialTip['title'],
'text' => $initialTip['text'],
'url' => $initialTip['url'],
'files' => $initialTip['files'],
'id' => $initialTip['id'],
'title' => $initialTip['title'],
'text' => $initialTip['text'],
'url' => $initialTip['url'],
'files' => $initialTip['files'],
'id' => $initialTip['id'],
'totalTips' => $this->getTotalTipsShowUser(),
]
);
}
@ -434,7 +439,14 @@ class TipsWindow
'title',
'text',
'enable',
'actions',
[
'text' => 'edit',
'class' => 'table_action_buttons',
],
[
'text' => 'delete',
'class' => 'table_action_buttons',
],
];
$columnNames = [
@ -442,7 +454,8 @@ class TipsWindow
__('Title'),
__('Text'),
__('Enable'),
__('Actions'),
__('Edit'),
__('Delete'),
];
// Load datatables user interface.
@ -450,7 +463,9 @@ class TipsWindow
[
'id' => 'list_tips_windows',
'class' => 'info_table',
'style' => 'width: 100%',
'style' => 'width: 99%',
'dom_elements' => 'lpfti',
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
'columns' => $columns,
'column_names' => $columnNames,
'ajax_url' => $this->ajaxController,
@ -473,18 +488,19 @@ class TipsWindow
],
]
);
echo '<div class="action-buttons w100p">';
echo '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=create">';
html_print_submit_button(
echo '<div class="action-buttons w100p" style="width: 100%">';
$buttonCreate = html_print_button(
__('Create tip'),
'create',
false,
'window.location.replace("index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=create")',
[
'class' => 'sub',
'icon' => 'create_file',
]
'icon' => 'plus',
],
true
);
echo '</a>';
html_print_action_buttons($buttonCreate);
echo '</div>';
} catch (Exception $e) {
echo $e->getMessage();
@ -584,16 +600,15 @@ class TipsWindow
$data[$key]['title'] = io_safe_output($row['title']);
$data[$key]['text'] = io_safe_output($row['text']);
$data[$key]['url'] = io_safe_output($row['url']);
$data[$key]['actions'] = '<div class="buttons_actions">';
$data[$key]['actions'] .= '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=edit&idTip='.$row['id'].'">';
$data[$key]['actions'] .= html_print_image(
$data[$key]['edit'] = '<a href="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=edit&idTip='.$row['id'].'">';
$data[$key]['edit'] .= html_print_image(
'images/edit.svg',
true,
['class' => 'main_menu_icon']
);
$data[$key]['actions'] .= '</a>';
$data[$key]['actions'] .= '<form name="grupo" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&action=delete">';
$data[$key]['actions'] .= html_print_input_image(
$data[$key]['edit'] .= '</a>';
$data[$key]['delete'] .= '<form name="grupo" method="post" class="rowPair table_action_buttons" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&action=delete">';
$data[$key]['delete'] .= html_print_input_image(
'button_delete_tip',
'images/delete.svg',
'',
@ -601,12 +616,11 @@ class TipsWindow
true,
[
'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
'class' => 'main_menu_icon',
'class' => 'main_menu_icon invert_filter',
]
);
$data[$key]['actions'] .= html_print_input_hidden('idTip', $row['id'], true);
$data[$key]['actions'] .= '</form>';
$data[$key]['actions'] .= '</div>';
$data[$key]['delete'] .= html_print_input_hidden('idTip', $row['id'], true);
$data[$key]['delete'] .= '</form>';
}
if (empty($data) === true) {
@ -679,14 +693,50 @@ class TipsWindow
</script>';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filter-table-adv';
$table->style[0] = 'font-weight: bold';
$table->style[0] = 'width: 50%';
$table->data = [];
$table->data[0][0] = __('Images');
$table->data[0][1] .= html_print_div(['id' => 'inputs_images'], true);
$table->data[0][1] .= html_print_div(
$table->data[0][0] = html_print_label_input_block(
__('Language'),
html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'id_lang',
'',
'',
'',
'0',
true,
false,
true,
false,
'width: 100%;'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Profile'),
html_print_select($profiles, 'id_profile', '0', '', __('All'), 0, true)
);
$table->data[1][0] = html_print_label_input_block(
__('Title'),
html_print_input_text('title', '', '', 35, 100, true)
);
$table->data[1][1] = html_print_label_input_block(
__('Url'),
html_print_input_text('url', '', '', 35, 100, true)
);
$table->data[2][0] = html_print_label_input_block(
__('Text'),
html_print_textarea('text', 5, 50, '', '', true),
);
$table->data[2][1] = html_print_label_input_block(
__('Enable'),
html_print_checkbox_switch('enable', true, true, true)
);
$inputImages = html_print_div(['id' => 'inputs_images'], true);
$inputImages .= html_print_div(
[
'id' => 'notices_images',
'class' => 'invisible',
@ -694,41 +744,36 @@ class TipsWindow
],
true
);
$table->data[0][1] .= html_print_button(__('Add image'), 'button_add_image', false, '', '', true);
$table->data[1][0] = __('Language');
$table->data[1][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'id_lang',
'',
'',
'',
'0',
$inputImages .= html_print_div(
[
'id' => 'notices_images',
'class' => 'invisible empty_input_images',
'content' => '<p>'.__('Please select a image').'</p>',
],
true
);
$table->data[2][0] = __('Profile');
$table->data[2][1] = html_print_select($profiles, 'id_profile', '0', '', __('All'), 0, true);
$table->data[3][0] = __('Title');
$table->data[3][1] = html_print_input_text('title', '', '', 35, 100, true);
$table->data[4][0] = __('Text');
$table->data[4][1] = html_print_textarea('text', 5, 50, '', '', true);
$table->data[5][0] = __('Url');
$table->data[5][1] = html_print_input_text('url', '', '', 35, 100, true);
$table->data[6][0] = __('Enable');
$table->data[6][1] = html_print_checkbox_switch('enable', true, true, true);
$inputImages .= html_print_button(__('Add image'), 'button_add_image', false, '', ['class' => 'button-add-image'], true);
echo '<form name="grupo" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=create&action=create" enctype="multipart/form-data">';
$table->data[3][0] = html_print_label_input_block(
__('Images'),
$inputImages
);
echo '<form method="post" class="max_floating_element_size" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=create&action=create" enctype="multipart/form-data">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(
$actionButtons = html_print_submit_button(
__('Send'),
'submit_button',
false,
[
'class' => 'sub',
'icon' => 'update',
]
],
true
);
html_print_submit_button(
$actionButtons .= html_print_submit_button(
__('Preview'),
'preview_button',
false,
@ -736,8 +781,11 @@ class TipsWindow
'class' => 'sub preview',
'id' => 'prev_button',
'icon' => 'preview',
]
],
true
);
html_print_action_buttons($actionButtons);
echo '</div>';
echo '</form>';
html_print_div(['id' => 'tips_window_modal_preview']);
@ -789,7 +837,7 @@ class TipsWindow
true,
[
'onclick' => 'deleteImage(this, \''.$value['id'].'\', \''.$namePath.'\')',
'class' => 'remove-image',
'class' => 'remove-image main_menu_icon',
]
);
$outputImagesTip .= html_print_div(
@ -811,16 +859,52 @@ class TipsWindow
</script>';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filter-table-adv';
$table->style[0] = 'font-weight: bold';
$table->style[0] = 'width: 50%';
$table->data = [];
$table->data[0][0] = __('Images');
$table->data[0][1] .= $outputImagesTip;
$table->data[0][1] .= html_print_div(['id' => 'inputs_images'], true);
$table->data[0][1] .= html_print_input_hidden('images_to_delete', '{}', true);
$table->data[0][1] .= html_print_div(
$table->data[0][0] = html_print_label_input_block(
__('Language'),
html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'id_lang',
$tip['id_lang'],
'',
'',
'0',
true,
false,
true,
false,
'width: 100%;'
)
);
$table->data[0][1] = html_print_label_input_block(
__('Profile'),
html_print_select($profiles, 'id_profile', $tip['id_profile'], '', __('All'), 0, true)
);
$table->data[1][0] = html_print_label_input_block(
__('Title'),
html_print_input_text('title', $tip['title'], '', 35, 100, true)
);
$table->data[1][1] = html_print_label_input_block(
__('Url'),
html_print_input_text('url', $tip['url'], '', 35, 100, true)
);
$table->data[2][0] = html_print_label_input_block(
__('Text'),
html_print_textarea('text', 5, 50, $tip['text'], '', true),
);
$table->data[2][1] = html_print_label_input_block(
__('Enable'),
html_print_checkbox_switch('enable', 1, ($tip['enable'] === '1') ? true : false, true)
);
$inputImages = $outputImagesTip;
$inputImages .= html_print_div(['id' => 'inputs_images'], true);
$inputImages .= html_print_input_hidden('images_to_delete', '{}', true);
$inputImages .= html_print_div(
[
'id' => 'notices_images',
'class' => 'invisible',
@ -828,41 +912,35 @@ class TipsWindow
],
true
);
$table->data[0][1] .= html_print_button(__('Add image'), 'button_add_image', false, '', '', true);
$table->data[1][0] = __('Language');
$table->data[1][1] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'id_lang',
$tip['id_lang'],
'',
'',
'0',
$inputImages .= html_print_div(
[
'id' => 'notices_images',
'class' => 'invisible empty_input_images',
'content' => '<p>'.__('Please select a image').'</p>',
],
true
);
$table->data[2][0] = __('Profile');
$table->data[2][1] = html_print_select($profiles, 'id_profile', $tip['id_profile'], '', __('All'), 0, true);
$table->data[3][0] = __('Title');
$table->data[3][1] = html_print_input_text('title', $tip['title'], '', 35, 100, true);
$table->data[4][0] = __('Text');
$table->data[4][1] = html_print_textarea('text', 5, 50, $tip['text'], '', true);
$table->data[5][0] = __('Url');
$table->data[5][1] = html_print_input_text('url', $tip['url'], '', 35, 100, true);
$table->data[6][0] = __('Enable');
$table->data[6][1] = html_print_checkbox_switch('enable', 1, ($tip['enable'] === '1') ? true : false, true);
$inputImages .= html_print_button(__('Add image'), 'button_add_image', false, '', ['class' => 'button-add-image'], true);
echo '<form name="grupo" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=edit&action=edit&idTip='.$tip['id'].'" enctype="multipart/form-data">';
$table->data[3][0] = html_print_label_input_block(
__('Images'),
$inputImages
);
echo '<form class="max_floating_element_size" name="grupo" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=welcome_tips&view=edit&action=edit&idTip='.$tip['id'].'" enctype="multipart/form-data">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(
$actionButtons = html_print_submit_button(
__('Send'),
'submit_button',
false,
[
'class' => 'sub',
'icon' => 'update',
]
],
true
);
html_print_submit_button(
$actionButtons .= html_print_submit_button(
__('Preview'),
'preview_button',
false,
@ -870,9 +948,12 @@ class TipsWindow
'class' => 'sub preview',
'id' => 'prev_button',
'icon' => 'preview',
]
],
true
);
html_print_action_buttons($actionButtons);
echo '</div>';
echo '</form>';
html_print_div(['id' => 'tips_window_modal_preview']);

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC230313';
$build_version = 'PC230323';
$pandora_version = 'v7.0NG.769';
// Do not overwrite default timezone set if defined.
@ -153,6 +153,19 @@ if (! defined('ENTERPRISE_DIR')) {
}
db_select_engine();
if (empty($config['remote_config']) === false
&& file_exists($config['remote_config'].'/conf/'.PANDORA_HA_FILE)
&& filesize($config['remote_config'].'/conf/'.PANDORA_HA_FILE) > 0
) {
$data = file_get_contents($config['remote_config'].'/conf/'.PANDORA_HA_FILE);
if (empty($data) === false) {
$ip_list = explode(',', $data);
// Connects to the first pandora_ha_dbs.conf database.
$config['dbhost'] = trim($ip_list[0]);
}
}
$config['dbconnection'] = db_connect();
require_once $ownDir.'functions_config.php';

View File

@ -1,4 +1,5 @@
<?php
/**
* Constants definitions.
*
@ -703,6 +704,11 @@ define('HA_ACTION_ENABLE', 6);
define('HA_ACTION_CLEANUP', 7);
define('HA_ACTION_RESYNC', 8);
define('HA_RESYNC', 1);
define('HA_DISABLE', 5);
define('HA_ENABLE', 6);
define('HA_UNINITIALIZED', 0);
define('HA_ONLINE', 1);
define('HA_PENDING', 2);
@ -864,6 +870,8 @@ define(
// Pandora FMS Enterprise license.
define('LICENSE_FILE', 'customer_key');
// Pandora HA database list.
define('PANDORA_HA_FILE', 'pandora_ha_hosts.conf');
// Home screen values for user definition.
define('HOME_SCREEN_DEFAULT', 'default');

View File

@ -3548,6 +3548,18 @@ function update_config_token($cfgtoken, $cfgvalue)
}
function delete_config_token($cfgtoken)
{
$delete = db_process_sql(sprintf('DELETE FROM tconfig WHERE token = "%s"', $cfgtoken));
if ($delete) {
return true;
} else {
return false;
}
}
function get_number_of_mr($package, $ent, $offline)
{
global $config;
@ -4275,6 +4287,7 @@ function generator_chart_to_pdf(
];
}
unset($data['data']['graph_data']);
// If not install chromium avoid 500 convert tu images no data to show.
$chromium_dir = io_safe_output($config['chromium_path']);
$result_ejecution = exec($chromium_dir.' --version');

View File

@ -2769,6 +2769,16 @@ function agents_delete_agent($id_agents, $disableACL=false)
enterprise_include_once('include/functions_agents.php');
enterprise_hook('agent_delete_from_cache', [$id_agent]);
// Delete agent from fav menu.
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_agent,
'section' => 'Agents',
'id_user' => $config['id_user'],
]
);
// Break the loop on error.
if ((bool) $error === true) {
break;

View File

@ -456,6 +456,10 @@ function config_update_config()
$error_update[] = __('Enable Update Manager');
}
if (config_update_value('legacy_database_ha', get_parameter('legacy_database_ha'), true) === false) {
$error_update[] = __('Legacy database HA');
}
if (config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'), true) === false) {
$error_update[] = __('Ipam Ocuppied Manager Critical');
}
@ -2237,6 +2241,10 @@ function config_process_config()
config_update_value('enable_update_manager', 1);
}
if (!isset($config['legacy_database_ha'])) {
config_update_value('legacy_database_ha', 0);
}
if (!isset($config['disabled_newsletter'])) {
config_update_value('disabled_newsletter', 0);
}
@ -2561,7 +2569,7 @@ function config_process_config()
}
if (!isset($config['custom_splash_login'])) {
config_update_value('custom_splash_login', 'default');
config_update_value('custom_splash_login', 'none.png');
}
if (!isset($config['custom_docs_logo'])) {
@ -2597,11 +2605,11 @@ function config_process_config()
}
if (!isset($config['custom_title1_login'])) {
config_update_value('custom_title1_login', __('PANDORA FMS'));
config_update_value('custom_title1_login', __('ONE TOOL TO RULE THEM ALL'));
}
if (!isset($config['custom_title2_login'])) {
config_update_value('custom_title2_login', __('ONE TOOL TO MONITOR THEM ALL'));
config_update_value('custom_title2_login', '');
}
if (!isset($config['custom_docs_url'])) {
@ -2649,11 +2657,11 @@ function config_process_config()
}
if (!isset($config['meta_custom_title1_login'])) {
config_update_value('meta_custom_title1_login', __('PANDORA FMS NEXT GENERATION'));
config_update_value('meta_custom_title1_login', __('ONE TOOL TO RULE THEM ALL'));
}
if (!isset($config['meta_custom_title2_login'])) {
config_update_value('meta_custom_title2_login', __('METACONSOLE'));
config_update_value('meta_custom_title2_login', __('COMMAND CENTER'));
}
if (!isset($config['vc_favourite_view'])) {
@ -3218,7 +3226,7 @@ function config_process_config()
// Try to update user table in order to refresh skin inmediatly.
$is_user_updating = get_parameter('sec2', '');
if ($is_user_updating == 'operation/users/user_edit') {
if ($is_user_updating === 'godmode/users/configure_user') {
$id = get_parameter_get('id', $config['id_user']);
// ID given as parameter.
$user_info = get_user_info($id);
@ -3482,7 +3490,7 @@ function config_process_config()
}
if (!isset($config['random_background'])) {
config_update_value('random_background', '');
config_update_value('random_background', 1);
}
if (!isset($config['meta_random_background'])) {
@ -3746,7 +3754,7 @@ function config_user_set_custom_config()
}
}
if (defined('METACONSOLE')) {
if (is_metaconsole() === true) {
$config['metaconsole_access'] = $userinfo['metaconsole_access'];
}
}

View File

@ -2623,7 +2623,7 @@ function events_print_event_table(
$img,
true,
[
'class' => 'image_status',
'class' => 'image_status invert_filter main_menu_icon',
'title' => $title,
]
);
@ -2668,7 +2668,7 @@ function events_print_type_img(
switch ($type) {
case 'alert_recovered':
$icon = 'images/alert@svg.svg';
$style .= ' alert_module_background_state icon_background_normal ';
break;
case 'alert_manual_validation':
@ -2752,6 +2752,146 @@ function events_print_type_img(
}
/**
* Prints the event type image.
*
* @param string $type Event type from SQL.
* @param boolean $return Whether to return or print.
*
* @return string HTML with img.
*/
function events_print_type_img_pdf(
$type,
$return=false
) {
$svg = '';
switch ($type) {
case 'alert_recovered':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / alert@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-alert" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,20 C11.4190985,20 12.5702076,18.8808594 12.5702076,17.5 L7.42979244,17.5 C7.42979244,18.8808594 8.5809015,20 10,20 Z M18.6540098,14.1519531 C17.8777645,13.3410156 16.425318,12.1210937 16.425318,8.125 C16.425318,5.08984375 14.2364028,2.66015625 11.2849029,2.0640625 L11.2849029,1.25 C11.2849029,0.559765625 10.7095493,0 10,0 C9.29045075,0 8.71509711,0.559765625 8.71509711,1.25 L8.71509711,2.0640625 C5.76359722,2.66015625 3.57468198,5.08984375 3.57468198,8.125 C3.57468198,12.1210938 2.12223547,13.3410156 1.3459902,14.1519531 C1.10492023,14.4039062 0.998045886,14.7050781 1.00002702,15 C1.00447442,15.640625 1.52156948,16.25 2.28977909,16.25 L17.7102209,16.25 C18.4784305,16.25 18.9959274,15.640625 18.999973,15 C19.0019541,14.7050781 18.8950798,14.4035156 18.6540098,14.1519531 L18.6540098,14.1519531 Z" id="Shape" fill="#82b92e"></path>
</g>
</svg>';
break;
case 'alert_manual_validation':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / validate@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-validate" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Group" transform="translate(1.000000, 1.000000)" stroke="#3F3F3F" stroke-width="2">
<circle id="Oval" cx="9" cy="9" r="9"></circle>
<polyline id="Path-10" points="4.93746567 8.98550486 7 12 12.9374657 7.03800583"></polyline>
</g>
</g>
</svg>';
break;
case 'going_down_critical':
case 'going_up_critical':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / modules@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-modules" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7929688,3.18164062 L10.8789062,0.162109375 C10.59375,0.0540234375 10.296875,0 10,0 C9.703125,0 9.40625,0.0540234375 9.12109375,0.161914062 L1.20664062,3.18164062 C0.480078125,3.45898438 0,4.15625 0,4.93359375 L0,15.0664062 C0,15.8441406 0.480078125,16.5410156 1.20664062,16.8183594 L9.12070313,19.8378906 C9.40625,19.9453125 9.703125,20 10,20 C10.296875,20 10.5949219,19.9459766 10.8777344,19.8380859 L18.7917969,16.8185547 C19.5195312,16.5429688 20,15.84375 20,15.0664062 L20,4.93359375 C20,4.15625 19.5195312,3.45898438 18.7929688,3.18164062 Z M10,2.50273437 L16.4921875,4.9796875 L10,7.4140625 L3.50664062,4.98046875 L10,2.50273437 Z M11.25,17.0273438 L11.25,9.6171875 L17.5,7.2734375 L17.5,14.6367188 L11.25,17.0273438 Z" id="Shape" fill="#e63c52"></path>
</g>
</svg>';
break;
case 'going_up_normal':
case 'going_down_normal':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / modules@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-modules" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7929688,3.18164062 L10.8789062,0.162109375 C10.59375,0.0540234375 10.296875,0 10,0 C9.703125,0 9.40625,0.0540234375 9.12109375,0.161914062 L1.20664062,3.18164062 C0.480078125,3.45898438 0,4.15625 0,4.93359375 L0,15.0664062 C0,15.8441406 0.480078125,16.5410156 1.20664062,16.8183594 L9.12070313,19.8378906 C9.40625,19.9453125 9.703125,20 10,20 C10.296875,20 10.5949219,19.9459766 10.8777344,19.8380859 L18.7917969,16.8185547 C19.5195312,16.5429688 20,15.84375 20,15.0664062 L20,4.93359375 C20,4.15625 19.5195312,3.45898438 18.7929688,3.18164062 Z M10,2.50273437 L16.4921875,4.9796875 L10,7.4140625 L3.50664062,4.98046875 L10,2.50273437 Z M11.25,17.0273438 L11.25,9.6171875 L17.5,7.2734375 L17.5,14.6367188 L11.25,17.0273438 Z" id="Shape" fill="#82b92e"></path>
</g>
</svg>';
break;
case 'going_up_warning':
case 'going_down_warning':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / modules@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-modules" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7929688,3.18164062 L10.8789062,0.162109375 C10.59375,0.0540234375 10.296875,0 10,0 C9.703125,0 9.40625,0.0540234375 9.12109375,0.161914062 L1.20664062,3.18164062 C0.480078125,3.45898438 0,4.15625 0,4.93359375 L0,15.0664062 C0,15.8441406 0.480078125,16.5410156 1.20664062,16.8183594 L9.12070313,19.8378906 C9.40625,19.9453125 9.703125,20 10,20 C10.296875,20 10.5949219,19.9459766 10.8777344,19.8380859 L18.7917969,16.8185547 C19.5195312,16.5429688 20,15.84375 20,15.0664062 L20,4.93359375 C20,4.15625 19.5195312,3.45898438 18.7929688,3.18164062 Z M10,2.50273437 L16.4921875,4.9796875 L10,7.4140625 L3.50664062,4.98046875 L10,2.50273437 Z M11.25,17.0273438 L11.25,9.6171875 L17.5,7.2734375 L17.5,14.6367188 L11.25,17.0273438 Z" id="Shape" fill="#fcab10"></path>
</g>
</svg>';
break;
case 'going_unknown':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / modules@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-modules" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7929688,3.18164062 L10.8789062,0.162109375 C10.59375,0.0540234375 10.296875,0 10,0 C9.703125,0 9.40625,0.0540234375 9.12109375,0.161914062 L1.20664062,3.18164062 C0.480078125,3.45898438 0,4.15625 0,4.93359375 L0,15.0664062 C0,15.8441406 0.480078125,16.5410156 1.20664062,16.8183594 L9.12070313,19.8378906 C9.40625,19.9453125 9.703125,20 10,20 C10.296875,20 10.5949219,19.9459766 10.8777344,19.8380859 L18.7917969,16.8185547 C19.5195312,16.5429688 20,15.84375 20,15.0664062 L20,4.93359375 C20,4.15625 19.5195312,3.45898438 18.7929688,3.18164062 Z M10,2.50273437 L16.4921875,4.9796875 L10,7.4140625 L3.50664062,4.98046875 L10,2.50273437 Z M11.25,17.0273438 L11.25,9.6171875 L17.5,7.2734375 L17.5,14.6367188 L11.25,17.0273438 Z" id="Shape" fill="#808080"></path>
</g>
</svg>';
break;
case 'system':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / configuration@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-configuration" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7953273,7.94064046 L18.0028475,7.94064046 C17.3563508,7.94064046 16.8141278,7.38349388 16.8141278,6.72220776 C16.8141278,6.38896121 16.9548972,6.08695652 17.205154,5.8630565 L17.7160949,5.36318667 C18.2218222,4.86331684 18.2218222,4.0458214 17.7160949,3.54595158 L16.5534436,2.39520958 C16.3240416,2.16610258 15.9851522,2.03072117 15.6410491,2.03072117 C15.296946,2.03072117 14.9632703,2.16610258 14.7286546,2.39520958 L14.2385684,2.88466545 C14.0039526,3.14501432 13.6911316,3.28560271 13.3522422,3.28560271 C12.6848908,3.28560271 12.1270267,2.74407706 12.1270267,2.10361885 L12.1270267,1.30695131 C12.1270267,0.604009373 11.5587353,0 10.8496744,0 L9.26471474,0 C8.55565385,0 7.99257608,0.598802395 7.99257608,1.30695131 L7.99257608,2.09841187 C7.99257608,2.73887009 7.434712,3.28039573 6.76736057,3.28039573 C6.43368486,3.28039573 6.12607756,3.13980734 5.90188919,2.89507941 L5.39616194,2.39520958 C5.16675988,2.1608956 4.82787048,2.03072117 4.48376741,2.03072117 C4.13966433,2.03072117 3.80598861,2.16610258 3.57137287,2.39520958 L2.39829419,3.5407446 C1.89778062,4.04061442 1.89778062,4.85810987 2.39829419,5.35277272 L2.8883804,5.84222859 C3.14906455,6.07654257 3.29504767,6.38896121 3.29504767,6.72220776 C3.29504767,7.38870086 2.75282464,7.94064046 2.10632794,7.94064046 L1.31384812,7.94064046 C0.599573548,7.94064046 0,8.49778703 0,9.20593595 L0,9.99739651 L0,10.7888571 C0,11.491799 0.599573548,12.0541526 1.31384812,12.0541526 L2.10632794,12.0541526 C2.75282464,12.0541526 3.29504767,12.6112991 3.29504767,13.2725853 C3.29504767,13.6058318 3.14906455,13.9182505 2.8883804,14.1525644 L2.39829419,14.6368133 C1.89778062,15.1366832 1.89778062,15.9541786 2.39829419,16.4488414 L3.56094551,17.6047904 C3.79034756,17.8391044 4.12923696,17.9692788 4.47334004,17.9692788 C4.81744312,17.9692788 5.15111883,17.8338974 5.38573457,17.6047904 L5.89146182,17.1049206 C6.11043651,16.8601927 6.42325749,16.7196043 6.75693321,16.7196043 C7.42428463,16.7196043 7.98214872,17.2611299 7.98214872,17.9015881 L7.98214872,18.6930487 C7.98214872,19.3959906 8.54522648,20 9.25950106,20 L10.8444607,20 C11.5535216,20 12.1165994,19.4011976 12.1165994,18.6930487 L12.1165994,17.9015881 C12.1165994,17.2611299 12.6744634,16.7196043 13.3418149,16.7196043 C13.6754906,16.7196043 13.9883116,16.8653996 14.228141,17.1205415 L14.7182272,17.6099974 C14.9528429,17.8391044 15.2865186,17.9744858 15.6306217,17.9744858 C15.9747248,17.9744858 16.3084005,17.8391044 16.5430163,17.6099974 L17.7056676,16.4540484 C18.2061811,15.9541786 18.2061811,15.1366832 17.7056676,14.6368133 L17.1947266,14.1369435 C16.9444698,13.9130435 16.8037004,13.6058318 16.8037004,13.2777922 C16.8037004,12.6112991 17.3459234,12.0593595 17.9924201,12.0593595 L18.7849,12.0593595 C19.4939608,12.0593595 19.9998464,11.502213 19.9998464,10.794064 L19.9998464,9.99739651 L19.9998464,9.20593595 C20.0101155,8.49778703 19.5043882,7.94064046 18.7953273,7.94064046 Z M14.2229273,9.99739651 L14.2229273,9.99739651 C14.2229273,12.2936735 12.3616425,14.1629784 10.0519809,14.1629784 C7.7423193,14.1629784 5.88103446,12.2936735 5.88103446,9.99739651 L5.88103446,9.99739651 L5.88103446,9.99739651 C5.88103446,7.7011195 7.7423193,5.83181463 10.0519809,5.83181463 C12.3616425,5.83181463 14.2229273,7.7011195 14.2229273,9.99739651 L14.2229273,9.99739651 Z" id="Path-2" fill="#3F3F3F"></path>
</g>
</svg>';
break;
case 'new_agent':
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / agents@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-agents" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group" transform="translate(0.000000, 1.000000)">
<rect id="Rectangle" fill="#3F3F3F" x="0" y="6" width="10" height="6" rx="1"></rect>
<polyline id="Path-43" stroke="#3F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" points="3 4 6.9967103 -2.30926389e-14 15 -2.30926389e-14 19 4 19 14 15 18 6.9967103 18 3 14.0223656"></polyline>
</g>
</g>
</svg>';
break;
case 'configuration_change':
$svg = '<svg viewBox="0 0 20 20" 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>Dark / 20 / configuration@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-configuration" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M18.7953273,7.94064046 L18.0028475,7.94064046 C17.3563508,7.94064046 16.8141278,7.38349388 16.8141278,6.72220776 C16.8141278,6.38896121 16.9548972,6.08695652 17.205154,5.8630565 L17.7160949,5.36318667 C18.2218222,4.86331684 18.2218222,4.0458214 17.7160949,3.54595158 L16.5534436,2.39520958 C16.3240416,2.16610258 15.9851522,2.03072117 15.6410491,2.03072117 C15.296946,2.03072117 14.9632703,2.16610258 14.7286546,2.39520958 L14.2385684,2.88466545 C14.0039526,3.14501432 13.6911316,3.28560271 13.3522422,3.28560271 C12.6848908,3.28560271 12.1270267,2.74407706 12.1270267,2.10361885 L12.1270267,1.30695131 C12.1270267,0.604009373 11.5587353,0 10.8496744,0 L9.26471474,0 C8.55565385,0 7.99257608,0.598802395 7.99257608,1.30695131 L7.99257608,2.09841187 C7.99257608,2.73887009 7.434712,3.28039573 6.76736057,3.28039573 C6.43368486,3.28039573 6.12607756,3.13980734 5.90188919,2.89507941 L5.39616194,2.39520958 C5.16675988,2.1608956 4.82787048,2.03072117 4.48376741,2.03072117 C4.13966433,2.03072117 3.80598861,2.16610258 3.57137287,2.39520958 L2.39829419,3.5407446 C1.89778062,4.04061442 1.89778062,4.85810987 2.39829419,5.35277272 L2.8883804,5.84222859 C3.14906455,6.07654257 3.29504767,6.38896121 3.29504767,6.72220776 C3.29504767,7.38870086 2.75282464,7.94064046 2.10632794,7.94064046 L1.31384812,7.94064046 C0.599573548,7.94064046 0,8.49778703 0,9.20593595 L0,9.99739651 L0,10.7888571 C0,11.491799 0.599573548,12.0541526 1.31384812,12.0541526 L2.10632794,12.0541526 C2.75282464,12.0541526 3.29504767,12.6112991 3.29504767,13.2725853 C3.29504767,13.6058318 3.14906455,13.9182505 2.8883804,14.1525644 L2.39829419,14.6368133 C1.89778062,15.1366832 1.89778062,15.9541786 2.39829419,16.4488414 L3.56094551,17.6047904 C3.79034756,17.8391044 4.12923696,17.9692788 4.47334004,17.9692788 C4.81744312,17.9692788 5.15111883,17.8338974 5.38573457,17.6047904 L5.89146182,17.1049206 C6.11043651,16.8601927 6.42325749,16.7196043 6.75693321,16.7196043 C7.42428463,16.7196043 7.98214872,17.2611299 7.98214872,17.9015881 L7.98214872,18.6930487 C7.98214872,19.3959906 8.54522648,20 9.25950106,20 L10.8444607,20 C11.5535216,20 12.1165994,19.4011976 12.1165994,18.6930487 L12.1165994,17.9015881 C12.1165994,17.2611299 12.6744634,16.7196043 13.3418149,16.7196043 C13.6754906,16.7196043 13.9883116,16.8653996 14.228141,17.1205415 L14.7182272,17.6099974 C14.9528429,17.8391044 15.2865186,17.9744858 15.6306217,17.9744858 C15.9747248,17.9744858 16.3084005,17.8391044 16.5430163,17.6099974 L17.7056676,16.4540484 C18.2061811,15.9541786 18.2061811,15.1366832 17.7056676,14.6368133 L17.1947266,14.1369435 C16.9444698,13.9130435 16.8037004,13.6058318 16.8037004,13.2777922 C16.8037004,12.6112991 17.3459234,12.0593595 17.9924201,12.0593595 L18.7849,12.0593595 C19.4939608,12.0593595 19.9998464,11.502213 19.9998464,10.794064 L19.9998464,9.99739651 L19.9998464,9.20593595 C20.0101155,8.49778703 19.5043882,7.94064046 18.7953273,7.94064046 Z M14.2229273,9.99739651 L14.2229273,9.99739651 C14.2229273,12.2936735 12.3616425,14.1629784 10.0519809,14.1629784 C7.7423193,14.1629784 5.88103446,12.2936735 5.88103446,9.99739651 L5.88103446,9.99739651 L5.88103446,9.99739651 C5.88103446,7.7011195 7.7423193,5.83181463 10.0519809,5.83181463 C12.3616425,5.83181463 14.2229273,7.7011195 14.2229273,9.99739651 L14.2229273,9.99739651 Z" id="Path-2" fill="#3F3F3F"></path>
</g>
</svg>';
break;
case 'unknown':
default:
$svg = '<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Dark / 20 / event@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-event" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g>
<rect id="Rectangle" x="0" y="0" width="20" height="20"></rect>
<path d="M15.9503156,6.25 L10.901623,6.25 L12.7653518,1.1796875 C12.9403498,0.5859375 12.4372305,0 11.7503633,0 L5.45043493,0 C4.9254409,0 4.47919597,0.34765625 4.40919676,0.8125 L3.00921267,10.1875 C2.92608862,10.75 3.41608305,11.25 4.05045084,11.25 L9.24351682,11.25 L7.22666474,18.8476562 C7.06916653,19.4414062 7.57666077,20 8.24602816,20 C8.61352398,20 8.96352,19.828125 9.15601782,19.53125 L16.8559303,7.65625 C17.2628007,7.03515625 16.7596814,6.25 15.9503156,6.25 Z" id="Path" fill="#3F3F3F"></path>
</g>
</g>
</svg>';
break;
}
$output = '<div style="width:20px;height:20px">'.$svg.'</div>';
if ($return) {
return $output;
}
echo $output;
}
/**
* Prints the event type description
*
@ -4356,7 +4496,7 @@ function events_page_details($event, $server_id=0)
$graph_params_str = http_build_query($graph_params);
$link = "winopeng_var('".$url.'?'.$graph_params_str."','".$win_handle."', 800, 480)";
$link = 'winopeng_var("'.$url.'?'.$graph_params_str.'","'.$win_handle.'", 800, 480)';
$data[1] = html_print_button(__('View graph'), 'view_graph_button', false, $link, ['mode' => 'link'], true);
$table_details->data[] = $data;
}
@ -5180,10 +5320,6 @@ function events_page_comments($event, $ajax=false, $groupedComments=[])
true
);
$comments_form .= '</div><br></div>';
} else {
$comments_form = ui_print_message(
__('If event replication is ongoing, it won\'t be possible to enter comments here. This option is only to allow local pandora users to see comments, but not to operate with them. The operation, when event replication is enabled, must be done only in the Metaconsole.')
);
}
if ($ajax === true) {
@ -5208,9 +5344,10 @@ function events_clean_tags($tags)
}
$event_tags = tags_get_tags_formatted($tags, false);
$event_tags = str_replace(' ', '', $event_tags);
$event_tags = io_safe_input($event_tags);
return explode(',', str_replace(' ', '', $event_tags));
return explode(',', $event_tags);
}

View File

@ -4816,7 +4816,7 @@ function graph_nodata_image($options)
$height = $options['height'];
}
$width_style = '';
$width_style = 'width: 200px';
if (isset($options['width']) === true
&& empty($options['width']) === false
) {
@ -4835,7 +4835,7 @@ function graph_nodata_image($options)
true,
[
'title' => __('No data'),
'style' => 'height:'.$height.'px;'.$width_style,
'style' => $width_style,
]
);
}

View File

@ -3261,6 +3261,7 @@ function html_print_input_image($name, $src, $value, $style='', $return=false, $
'onkeyup',
'class',
'form',
'disabled',
];
foreach ($attrs as $attribute) {
@ -3630,10 +3631,9 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
$classes .= ' buttonButton';
}
if ($disabled === true) {
$classes .= ' disabled_action_button';
}
// if ($disabled === true) {
// $classes .= ' disabled_action_button';
// }
if (empty($buttonAttributes) === true) {
$parameters = [];
$parameters[] = 'class="'.$classes.'"';
@ -4565,12 +4565,6 @@ function html_print_image(
// Dont use safe_input here or the performance will dead.
$style = '';
if (empty($options) === false && isset($options['class']) === true) {
$options['class'] .= ' main_menu_icon';
} else {
$options['class'] = 'main_menu_icon invert_filter';
}
if (!empty($options)) {
// Deprecated or value-less attributes.
if (isset($options['align'])) {
@ -6104,6 +6098,8 @@ function html_print_autocomplete_users_from_integria(
$attrs['class'] = $class;
}
ui_print_help_tip(__('Type at least two characters to search the user.'), false);
html_print_input_text_extended(
$name,
$default,
@ -6117,8 +6113,6 @@ function html_print_autocomplete_users_from_integria(
);
html_print_input_hidden($name.'_hidden', $id_agent_module);
ui_print_help_tip(__('Type at least two characters to search the user.'), false);
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false, false);
?>
<script type="text/javascript">
@ -6205,7 +6199,8 @@ function html_print_tabs(array $tabs)
$result .= "<li><a href='".$value['href']."' id='".$value['id']."'>";
$result .= html_print_image(
'images/'.$value['img'],
true
true,
['class' => 'main_menu_icon invert_filter']
);
$result .= '<span>'.$value['name'].'</span>';
$result .= '</a></li>';

View File

@ -31,7 +31,7 @@ require_once $config['homedir'].'/include/functions.php';
* @param string $active_tab Current tab or false for View page.
* @param number $view Id of incident. Show View tab.
*
* @return string HTML code. Print tabs in header.
* @return array HTML code. Print tabs in header.
*/
function integriaims_tabs($active_tab, $view=false)
{

View File

@ -58,6 +58,16 @@ function menu_print_menu(&$menu)
$sec2 = (string) get_parameter('sec2');
if ($sec2 === 'operation/agentes/ver_agente') {
$sec2 = 'godmode/agentes/configurar_agente';
} else if ($sec2 === 'godmode/alerts/configure_alert_template') {
$sec2 = 'godmode/alerts/alert_templates';
} else if ($sec2 === 'godmode/events/events') {
$sec2 = 'godmode/events/events&section=filter';
} else if ($sec2 === 'godmode/alerts/configure_alert_action') {
$sec2 = 'godmode/alerts/alert_actions';
} else if ($sec2 === 'godmode/alerts/configure_alert_command') {
$sec2 = 'godmode/alerts/alert_commands';
} else if ($sec2 === 'enterprise/godmode/setup/edit_skin') {
$sec2 = 'enterprise/godmode/setup/setup_skins';
} else if ($sec2 === 'godmode/servers/discovery') {
$wiz = (string) get_parameter('wiz');
$sec2 = 'godmode/servers/discovery&wiz='.$wiz;
@ -842,7 +852,7 @@ if (is_ajax()) {
$fragmentation_status = '';
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
$fragmentation_status = html_print_image(
'images/exito.png',
'images/validate.svg',
true,
[
'title' => __('Successfully'),
@ -851,7 +861,7 @@ if (is_ajax()) {
);
} else {
$fragmentation_status = html_print_image(
'images/error_1.png',
'images/fail@svg.svg',
true,
[
'title' => __('Error'),

View File

@ -1153,6 +1153,27 @@ function modules_get_raw_data($id_agent_module, $date_init, $date_end)
}
function module_get_min_max_tagente_datos($id_agent_module, $date_init, $date_end)
{
$table = modules_get_table_data($id_agent_module, null);
$datelimit = ($date_init - $date_end);
$search_in_history_db = db_search_in_history_db($datelimit);
$data = db_get_all_rows_sql(
'
SELECT max(datos) as max, min(datos) as min
FROM '.$table.'
WHERE id_agente_modulo = '.$id_agent_module.'
AND utimestamp >= '.$date_init.'
AND utimestamp <= '.$date_end,
$search_in_history_db
);
return $data;
}
function modules_get_agent_groups($id_agent_module)
{
$return = false;

View File

@ -202,7 +202,7 @@ function netflow_stat_table($data, $start_date, $end_date, $aggregate)
$table = new stdClass();
$table->width = '100%';
$table->cellspacing = 0;
$table->class = 'databox';
$table->class = 'info_table';
$table->data = [];
$j = 0;
$x = 0;
@ -270,7 +270,7 @@ function netflow_data_table($data, $start_date, $end_date, $aggregate, $pdf=fals
$table->size = ['100%'];
}
$table->class = 'databox w100p';
$table->class = 'info_table w100p';
$table->cellspacing = 0;
$table->data = [];
@ -339,7 +339,7 @@ function netflow_top_n_table(array $data, int $total_bytes)
$values = [];
$table = new stdClass();
$table->class = 'w100p';
$table->class = 'info_table w100p';
$table->cellspacing = 0;
$table->data = [];
@ -405,7 +405,7 @@ function netflow_summary_table($data)
$values = [];
$table = new stdClass();
$table->cellspacing = 0;
$table->class = 'databox';
$table->class = 'info_table';
$table->styleTable = 'width: 100%';
$table->data = [];
@ -1323,7 +1323,7 @@ function netflow_draw_item(
}
if ($output === 'HTML' || $output === 'PDF') {
$html = '<table class="w100p">';
$html = '<table class="databox w100p">';
$html .= '<tr>';
$html .= '<td class="w50p">';
$html .= netflow_summary_table($data_summary);

View File

@ -68,10 +68,10 @@ function network_print_explorer_header(
$cell = '<div class="flex_center">';
$cell .= $title;
$cell .= html_print_link_with_params(
'images/arrow-down-white.png',
'images/arrow@svg.svg',
array_merge($hidden_data, ['order_by' => $order]),
'image',
($selected === $order) ? 'opacity: 0.5' : ''
'rotate: 270deg; width: 20px; margin-top: 4px;'.(($selected === $order) ? '' : 'opacity: 0.5')
);
$cell .= '</div>';

View File

@ -191,15 +191,9 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$table->id = 'table_profiles';
$table->width = '100%';
$table->class = 'info_table';
if (is_metaconsole() === true) {
$table->head_colspan[0] = 0;
$table->width = '100%';
$table->class = 'databox_tactical data';
$table->title = $title;
} else {
echo '<div id="edit_user_profiles" class="floating_form white_box">';
echo '<p class="subsection_header_title padding-lft-10">'.$title.'</p>';
}
echo '<div id="edit_user_profiles" class="max_floating_element_size white_box">';
echo '<p class="subsection_header_title padding-lft-10">'.$title.'</p>';
$table->data = [];
$table->head = [];
@ -318,12 +312,12 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
true,
[
'onclick' => 'delete_profile(event, this)',
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
);
} else {
$data['actions'] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
$data['actions'] .= html_print_input_image('del', 'images/delete.svg', 1, 'width:40px; height: 28px', true);
$data['actions'] .= html_print_input_image('del', 'images/delete.svg', 1, '', true, ['class' => 'main_menu_icon invert_filter']);
$data['actions'] .= html_print_input_hidden('delete_profile', 1, true);
$data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true);
$data['actions'] .= html_print_input_hidden('id_user', $id, true);
@ -397,7 +391,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$data['last_hierarchy'] = html_print_checkbox('no_hierarchy', 1, false, true);
$data['last_actions'] = html_print_input_image('add', 'images/validate.svg', 1, 'width: 40px; height: 28px', true);
$data['last_actions'] = html_print_input_image('add', 'images/validate.svg', 1, '', true, ['class' => 'main_menu_icon invert_filter']);
$data['last_actions'] .= html_print_input_hidden('id', $id, true);
$data['last_actions'] .= html_print_input_hidden('add_profile', 1, true);
$data['last_actions'] .= '</form>';
@ -405,9 +399,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
array_push($table->data, $data);
html_print_table($table, $return);
if (is_metaconsole() === false) {
echo '</div>';
}
echo '</div>';
unset($table);
}

View File

@ -1053,17 +1053,17 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
$table1->head = [];
if ($item['show_summary_group']) {
$table1->head[0] = __('Status');
$table1->head[1] = __('Count');
$table1->head[2] = __('Name');
$table1->head[3] = __('Type');
$table1->head[1] = __('Type');
$table1->head[2] = __('Count');
$table1->head[3] = __('Name');
$table1->head[4] = __('Agent');
$table1->head[5] = __('Severity');
$table1->head[6] = __('Val. by');
$table1->head[7] = __('Timestamp');
} else {
$table1->head[0] = __('Status');
$table1->head[1] = __('Name');
$table1->head[2] = __('Type');
$table1->head[1] = __('Type');
$table1->head[2] = __('Name');
$table1->head[3] = __('Agent');
$table1->head[4] = __('Severity');
$table1->head[5] = __('Val. by');
@ -1075,24 +1075,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
}
foreach ($item['data'] as $k => $event) {
// First pass along the class of this row.
if ($item['show_summary_group']) {
$table1->cellclass[$k][1] = get_priority_class($event['criticity']);
$table1->cellclass[$k][2] = get_priority_class($event['criticity']);
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
$table1->cellclass[$k][6] = get_priority_class($event['criticity']);
$table1->cellclass[$k][7] = get_priority_class($event['criticity']);
$table1->cellclass[$k][8] = get_priority_class($event['criticity']);
} else {
$table1->cellclass[$k][1] = get_priority_class($event['criticity']);
$table1->cellclass[$k][3] = get_priority_class($event['criticity']);
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
$table1->cellclass[$k][6] = get_priority_class($event['criticity']);
$table1->cellclass[$k][7] = get_priority_class($event['criticity']);
}
$data = [];
// Colored box.
@ -1125,6 +1107,12 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
]
);
if ($pdf) {
$data[] = events_print_type_img_pdf($event['event_type'], true);
} else {
$data[] = events_print_type_img($event['event_type'], true);
}
if ($item['show_summary_group']) {
$data[] = $event['event_rep'];
}
@ -1136,8 +1124,6 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
true
);
$data[] = events_print_type_img($event['event_type'], true);
if (empty($event['alias']) === false) {
$alias = $event['alias'];
if (is_metaconsole() === true) {
@ -1313,20 +1299,20 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
$table1->class = 'info_table';
$table1->data = [];
$table1->head = [];
$table1->align = [];
$table1->align[2] = 'center';
$table1->align = 'left';
if ($show_summary_group) {
$table1->head[0] = __('Status');
$table1->head[1] = __('Event name');
$table1->head[2] = __('Type');
$table1->head[1] = __('Type');
$table1->head[2] = __('Event name');
$table1->head[3] = __('Severity');
$table1->head[4] = __('Count');
$table1->head[5] = __('Timestamp');
$table1->style[0] = 'text-align: center;';
} else {
$table1->head[0] = __('Status');
$table1->head[1] = __('Event name');
$table1->head[2] = __('Type');
$table1->head[1] = __('Type');
$table1->head[2] = __('Event name');
$table1->head[3] = __('Severity');
$table1->head[4] = __('Timestamp');
$table1->style[0] = 'text-align: center;';
@ -1343,20 +1329,6 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
if (is_array($item_data) || is_object($item_data)) {
foreach ($item_data as $i => $event) {
$data = [];
if ($show_summary_group) {
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
} else {
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
}
// Colored box.
switch ($event['estado']) {
case 0:
@ -1386,8 +1358,14 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
'id' => 'status_img_'.$event['id_evento'],
]
);
$data[1] = io_safe_output($event['evento']);
$data[2] = events_print_type_img($event['event_type'], true);
if ($pdf) {
$data[1] = events_print_type_img_pdf($event['event_type'], true);
} else {
$data[1] = events_print_type_img($event['event_type'], true);
}
$data[2] = io_safe_output($event['evento']);
$data[3] = get_priority_name($event['criticity']);
if ($show_summary_group) {
$data[4] = $event['event_rep'];
@ -2178,7 +2156,7 @@ function reporting_html_agent_module($table, $item)
if ($module === null) {
$table_data .= '<td></td>';
} else {
$table_data .= "<td class='center'>";
$table_data .= '<td style="text-align: left;">';
if (isset($row['show_type']) === true && $row['show_type'] === '1') {
$table_data .= $module;
} else {
@ -2657,12 +2635,12 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
$table1->head = [];
$table1->head[0] = __('Status');
$table1->head[3] = __('Type');
if ($item['show_summary_group']) {
$table1->head[1] = __('Count');
}
$table1->head[2] = __('Name');
$table1->head[3] = __('Type');
$table1->head[4] = __('Severity');
$table1->head[5] = __('Val. by');
$table1->head[6] = __('Timestamp');
@ -2671,21 +2649,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
}
foreach ($item['data'] as $i => $event) {
if ($item['show_summary_group']) {
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
$table1->cellclass[$i][7] = get_priority_class($event['criticity']);
} else {
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
}
$data = [];
// Colored box.
switch ($event['status']) {
@ -2716,6 +2679,12 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
]
);
if ($pdf) {
$data[] = events_print_type_img_pdf($event['type'], true);
} else {
$data[] = events_print_type_img($event['type'], true);
}
if ($item['show_summary_group']) {
$data[] = $event['count'];
}
@ -2727,8 +2696,6 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
true
);
$data[] = events_print_type_img($event['type'], true);
$data[] = get_priority_name($event['criticity']);
if (empty($event['validated_by']) && $event['status'] == EVENT_VALIDATE) {
$data[] = '<i>'.__('System').'</i>';
@ -3283,12 +3250,20 @@ function reporting_html_alert_report_actions($table, $item, $pdf=0)
function get_alert_table($data)
{
$table = new StdCLass();
$table->width = '100%';
$table->width = '99%';
$table->class = 'info_table';
$table->data = [];
$table->head = [];
$table->headstyle = [];
$table->cellstyle = [];
$table->headstyle[0] = 'text-align:left;';
$table->size[0] = '25%';
$table->size[1] = '12%';
$table->size[2] = '12%';
$table->size[3] = '12%';
$table->size[4] = '12%';
$table->size[5] = '12%';
$table->size[6] = '12%';
$head = reset($data);
foreach (array_reverse(array_keys($head)) as $name) {
@ -3527,7 +3502,7 @@ function reporting_html_alert_report($table, $item, $pdf=0)
$table->data['alerts']['cell'] = html_print_table($table1, true);
if ($pdf) {
$table1->class = 'pdf_alert_table';
$table1->class = 'info_table';
return html_print_table($table1, true);
}
}
@ -3691,7 +3666,7 @@ function reporting_html_agent_configuration(
$row = [];
$row['name'] = $item['data']['name'];
$row['group'] = $item['data']['group_icon'];
$row['group'] = groups_get_name($item['data']['group'], true);
$row['address'] = $item['data']['os_icon'];
$row['os'] = $item['data']['address'];
$row['description'] = $item['data']['description'];
@ -3732,36 +3707,21 @@ function reporting_html_agent_configuration(
$table1->width = '99%';
$table1->head = [];
$table1->head['name'] = __('Name');
$table1->head['type'] = __('Type');
$table1->head['warning_critical'] = __('Warning<br/>Critical');
$table1->head['threshold'] = __('Threshold');
$table1->head['group_icon'] = __('Group');
$table1->head['description'] = __('Description');
$table1->head['interval'] = __('Interval');
$table1->head['unit'] = __('Unit');
$table1->head['status'] = __('Status');
$table1->head['tags'] = __('Tags');
$table1->align = [];
$table1->align['name'] = 'left';
$table1->align['type'] = 'center';
$table1->align['warning_critical'] = 'right';
$table1->align['threshold'] = 'right';
$table1->align['group_icon'] = 'center';
$table1->align['description'] = 'left';
$table1->align['interval'] = 'right';
$table1->align['unit'] = 'left';
$table1->align['status'] = 'center';
$table1->align['tags'] = 'left';
$table1->align[] = 'left';
$table1->data = [];
foreach ($item['data']['modules'] as $module) {
$row = [];
$row['name'] = $module['name'];
$row['type'] = $module['type_icon'];
$row['warning_critical'] = $module['max_warning'].' / '.$module['min_warning'].'<br>'.$module['max_critical'].' / '.$module['min_critical'];
$row['threshold'] = $module['threshold'];
$row['group_icon'] = ui_print_group_icon($item['data']['group'], true);
$row['description'] = $module['description'];
$row['interval'] = $module['interval'];
$row['unit'] = $module['unit'];
@ -3927,6 +3887,8 @@ function reporting_html_value(
if ($item['visual_format'] != 2) {
$table1 = new stdClass();
$table1->width = '100%';
$table1->headstyle[0] = 'text-align:left';
$table1->headstyle[1] = 'text-align:left';
switch ($item['type']) {
case 'max_value':
$table1->head = [
@ -6040,6 +6002,7 @@ function reporting_get_last_activity()
$table = new stdClass();
$table->width = '100%';
$table->data = [];
$table->class = 'info_table';
$table->size = [];
$table->size[2] = '150px';
$table->size[3] = '130px';
@ -6053,37 +6016,13 @@ function reporting_get_last_activity()
$table->head[5] = __('Comments');
$table->title = '<span>'.__('Last activity in %s console', get_product_name()).'</span>';
switch ($config['dbtype']) {
case 'mysql':
$sql = sprintf(
'SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp
FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 5",
$config['id_user']
);
break;
case 'postgresql':
$sql = sprintf(
"SELECT \"id_usuario\", accion, fecha, \"ip_origen\", descripcion, utimestamp
FROM tsesion
WHERE (\"utimestamp\" > ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_1WEEK.")
AND \"id_usuario\" = '%s' ORDER BY \"utimestamp\" DESC LIMIT 5",
$config['id_user']
);
break;
case 'oracle':
$sql = sprintf(
"SELECT id_usuario, accion, fecha, ip_origen, descripcion, utimestamp
FROM tsesion
WHERE ((utimestamp > ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_1WEEK.")
AND id_usuario = '%s') AND rownum <= 10 ORDER BY utimestamp DESC",
$config['id_user']
);
break;
}
$sql = sprintf(
'SELECT id_usuario,accion,fecha,ip_origen,descripcion,utimestamp
FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 5",
$config['id_user']
);
$sessions = db_get_all_rows_sql($sql);
@ -6094,18 +6033,8 @@ function reporting_get_last_activity()
foreach ($sessions as $session) {
$data = [];
switch ($config['dbtype']) {
case 'mysql':
case 'oracle':
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
break;
case 'postgresql':
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
break;
}
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
$data[0] = '<strong>'.$session_id_usuario.'</strong>';
$data[1] = ui_print_session_action_icon($session['accion'], true);
@ -6117,10 +6046,6 @@ function reporting_get_last_activity()
array_push($table->data, $data);
}
if (defined('METACONSOLE')) {
$table->class = 'databox_tactical';
}
return html_print_table($table, true);
}

View File

@ -221,6 +221,8 @@ function reports_update_report($id_report, $values)
*/
function reports_delete_report($id_report)
{
global $config;
$id_report = safe_int($id_report);
if (empty($id_report)) {
return false;
@ -231,6 +233,16 @@ function reports_delete_report($id_report)
return false;
}
// Delete report from fav menu.
db_process_sql_delete(
'tfavmenu_user',
[
'id_element' => $id_report,
'section' => 'Reporting',
'id_user' => $config['id_user'],
]
);
@db_process_sql_delete('treport_content', ['id_report' => $id_report]);
return @db_process_sql_delete('treport', ['id_report' => $id_report]);
}

View File

@ -657,7 +657,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$table->data['description'] = $row;
// Last contact.
$last_contact = ui_print_timestamp($agent['ultimo_contacto'], true, ['class' => 'font_11']);
$last_contact = ui_print_timestamp($agent['ultimo_contacto'], true, ['style' => 'font-size: 13px;']);
if ($agent['ultimo_contacto_remoto'] === '01-01-1970 00:00:00') {
$last_remote_contact = __('Never');
@ -689,8 +689,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
'#ececec',
true,
'',
false,
'line-height: 13px;'
false
);
$table->data['next_contact'] = $row;
@ -703,6 +702,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$eventsGraph = html_print_div(
[
'style' => 'height: 150px;',
'class' => 'max-graph-tree-view',
'content' => graph_graphic_agentevents(
$id_agente,
'500px;',
@ -727,8 +727,8 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
false,
false,
'',
'white-box-content',
'white_table_flex margin-bottom-10 border-bottom-gray'
'white-box-content mrgn_top_0 mrgn_btn_0px',
'white_table_flex'
);
if ($config['agentaccess']) {
@ -747,8 +747,8 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
true,
false,
'',
'white-box-content border-bottom-gray',
'white_table_flex margin-top-10 margin-bottom-10'
'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white_table_flex'
);
}
@ -920,8 +920,8 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
true,
false,
'',
'white-box-content border-bottom-gray',
'white_table_flex margin-top-10 margin-bottom-10'
'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white_table_flex'
);
if (empty($server_data) === false && is_metaconsole() === true) {
@ -935,5 +935,18 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
}
$('.max-graph-tree-view').ready(function() {
widthGraph();
});
$(window).resize(function() {
widthGraph();
});
function widthGraph () {
var parentWidth = $('.max-graph-tree-view').parent().width();
$('.max-graph-tree-view').children().width(parentWidth + 5);
}
</script>";
}

View File

@ -283,6 +283,14 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t
if (empty($message['force_class']) === false) {
$force_class = $message['force_class'];
}
if (isset($message['autoclose']) === true) {
if ($message['autoclose'] === true) {
$autoclose = true;
} else {
$autoclose = false;
}
}
} else {
$text_message = $message;
}
@ -385,7 +393,12 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t
$messageCreated = html_print_table($messageTable, true);
$autocloseTime = ((int) $config['notification_autoclose_time'] * 1000);
$classes[] = 'info_box_container';
if (empty($message['div_class']) === false) {
$classes[] = $message['div_class'];
} else {
$classes[] = 'info_box_container';
}
$classes[] = (($autoclose === true) && ($autocloseTime > 0)) ? ' info_box_autoclose' : '';
// This session var is defined in index.
@ -718,7 +731,23 @@ function ui_print_group_icon($id_group, $return=false, $path='', $style='', $lin
$output .= '<span title="'.groups_get_name($id_group, true).'">'.groups_get_name($id_group, true).'&nbsp;</span>';
} else {
if (empty($icon) === true) {
$output .= '<span title="'.groups_get_name($id_group, true).'">&nbsp;&nbsp;</span>';
$output .= '<span title="'.groups_get_name($id_group, true).'">';
$output .= '</span>';
$output .= html_print_image(
'images/unknown@groups.svg',
true,
[
'style' => $style,
'class' => 'main_menu_icon invert_filter '.$class,
'alt' => groups_get_name($id_group, true),
'title' => groups_get_name($id_group, true),
],
false,
false,
false,
true
);
$output .= '</span>';
} else {
if (empty($class) === true) {
$class = 'bot';
@ -734,7 +763,7 @@ function ui_print_group_icon($id_group, $return=false, $path='', $style='', $lin
true,
[
'style' => $style,
'class' => 'main_menu_icon '.$class,
'class' => 'main_menu_icon invert_filter '.$class,
'alt' => groups_get_name($id_group, true),
'title' => groups_get_name($id_group, true),
],
@ -841,7 +870,7 @@ function ui_print_os_icon(
}
if (isset($options['class']) === false) {
$options['class'] = 'main_menu_icon';
$options['class'] = 'main_menu_icon invert_filter';
}
$no_in_meta = (is_metaconsole() === false);
@ -930,15 +959,39 @@ function ui_print_type_agent_icon(
if ((int) $id_os === SATELLITE_OS_ID) {
// Satellite.
$options['title'] = __('Satellite');
$output = html_print_image('images/satellite@os.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true);
$output = html_print_image(
'images/satellite@os.svg',
true,
['class' => 'main_menu_icon invert_filter'],
false,
false,
false,
true
);
} else if ($remote_contact === $contact && $remote === 0 && empty($version) === true) {
// Network.
$options['title'] = __('Network');
$output = html_print_image('images/network-server@os.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true);
$output = html_print_image(
'images/network-server@os.svg',
true,
['class' => 'main_menu_icon invert_filter'],
false,
false,
false,
true
);
} else {
// Software.
$options['title'] = __('Software');
$output = html_print_image('images/data-server@svg.svg', true, ['class' => 'main_menu_icon invert_filter'], false, false, false, true);
$output = html_print_image(
'images/data-server@svg.svg',
true,
['class' => 'main_menu_icon invert_filter'],
false,
false,
false,
true
);
}
return $output;
@ -3873,6 +3926,31 @@ function ui_print_datatable(array $parameters)
}';
}
$js .= 'if ($("#'.$table_id.' tr td").length == 1) {
$(".datatable-msg-info-'.$table_id.'").show();
$(".datatable-msg-info-'.$table_id.'").removeClass(\'invisible_important\');
$("table#'.$table_id.'").hide();
$("div.dataTables_paginate").hide();
$("div.dataTables_info").hide();
$("div.dataTables_length").hide();
$("div.dt-buttons").hide();
if (dt_'.$table_id.'.page.info().pages > 1) {
$(".dataTables_paginate.paging_simple_numbers").show()
}
} else {
$(".datatable-msg-info-'.$table_id.'").hide();
$("table#'.$table_id.'").show();
$("div.dataTables_paginate").show();
$("div.dataTables_info").show();
$("div.dataTables_length").show();
$("div.dt-buttons").show();
if (dt_'.$table_id.'.page.info().pages == 1) {
$(".dataTables_paginate.paging_simple_numbers").hide()
}
}';
if (isset($parameters['drawCallback'])) {
$js .= $parameters['drawCallback'];
}
@ -3996,8 +4074,13 @@ function ui_print_datatable(array $parameters)
$js .= '</script>';
// Order.
$info_msg_arr = [];
$info_msg_arr['message'] = $emptyTable;
$info_msg_arr['div_class'] = 'info_box_container invisible_important datatable-msg-info-'.$table_id;
$info_msg = '<div>'.ui_print_info_message($info_msg_arr).'</div>';
$err_msg = '<div id="error-'.$table_id.'"></div>';
$output = $err_msg.$filter.$extra.$table.$js;
$output = $info_msg.$err_msg.$filter.$extra.$table.$js;
if (is_ajax() === false) {
ui_require_css_file('datatables.min', 'include/styles/js/');
ui_require_css_file('tables');
@ -4323,28 +4406,6 @@ function ui_toggle(
$rotateA = '90deg';
$rotateB = '180deg';
if (empty($img_a) === false) {
$image_a = html_print_image(
$img_a,
true,
[ 'style' => 'rotate: '.$rotateA ],
true
);
} else {
$image_a = '';
}
if (empty($img_b) === false) {
$image_b = html_print_image(
$img_b,
true,
[ 'style' => 'rotate: '.$rotateB ],
true
);
} else {
$image_b = '';
}
// Options.
$style = 'overflow:hidden;width: -webkit-fill-available;width: -moz-available;';
$style = 'overflow:hidden;';
@ -4401,7 +4462,7 @@ function ui_toggle(
$original,
true,
[
'class' => 'float-left main_menu_icon',
'class' => 'float-left main_menu_icon mrgn_right_10px invert_filter',
'style' => 'object-fit: contain; margin-right:10px; rotate:'.$imageRotate,
'title' => $title,
'id' => 'image_'.$uniqid,
@ -4433,7 +4494,7 @@ function ui_toggle(
$original,
true,
[
'class' => 'main_menu_icon',
'class' => 'main_menu_icon mrgn_right_10px invert_filter',
'style' => 'object-fit: contain; float:right; margin-right:10px; rotate:'.$imageRotate,
'title' => $title,
'id' => 'image_'.$uniqid,
@ -4957,7 +5018,8 @@ function ui_print_standard_header(
string $help='',
bool $godmode=false,
array $options=[],
array $breadcrumbs=[]
array $breadcrumbs=[],
array $fav_menu_config=[]
) {
// For standard breadcrumbs.
ui_require_css_file('discovery');
@ -4982,28 +5044,22 @@ function ui_print_standard_header(
$applyBreadcrumbs,
true
);
// Create the header.
// if (is_metaconsole() === true) {
// $output = ui_meta_print_header(
// $title,
// false,
// $options
// );
// } else {
$output = ui_print_page_header(
$title,
$icon,
true,
$help,
$godmode,
$options,
false,
'',
GENERIC_SIZE_TEXT,
'',
$headerInformation->printHeader(true)
);
// }
$output = ui_print_page_header(
$title,
$icon,
true,
$help,
$godmode,
$options,
false,
'',
GENERIC_SIZE_TEXT,
'',
$headerInformation->printHeader(true),
false,
$fav_menu_config
);
if ($return !== true) {
echo $output;
} else {
@ -5042,8 +5098,11 @@ function ui_print_page_header(
$numChars=GENERIC_SIZE_TEXT,
$alias='',
$breadcrumbs='',
$hide_left_small=false
$hide_left_small=false,
$fav_menu_config=[]
) {
global $config;
$title = io_safe_input_html($title);
if (($icon == '') && ($godmode == true)) {
$icon = 'images/gm_setup.png';
@ -5057,13 +5116,18 @@ function ui_print_page_header(
$type = 'view';
$type2 = 'menu_tab_frame_view';
$separator_class = 'separator';
$div_style = '';
} else {
$type = 'view';
$type2 = 'menu_tab_frame_view';
$separator_class = 'separator_view';
$div_style = '';
if ($config['pure'] === true) {
$div_style = 'top:0px;';
}
}
$buffer = '<div id="'.$type2.'" >';
$buffer = '<div id="'.$type2.'" style="'.$div_style.'" >';
if (!empty($breadcrumbs)) {
$buffer .= '<div class="menu_tab_left_bc">';
@ -5099,6 +5163,17 @@ function ui_print_page_header(
}
}
if (is_array($fav_menu_config) === true && is_metaconsole() === false) {
if (count($fav_menu_config) > 0) {
$buffer .= ui_print_fav_menu(
$fav_menu_config['id_element'],
$fav_menu_config['url'],
$fav_menu_config['label'],
$fav_menu_config['section']
);
}
}
$buffer .= '</span>';
if (is_metaconsole() === true) {
@ -5935,14 +6010,14 @@ function ui_print_agent_autocomplete_input($parameters)
$javascript_function_change .= '
function setInputBackground(inputId, image) {
$("#"+inputId)
.attr("style", "background-image: url(\'"+image+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; '.$inputStyles.'");
.attr("style", "background-image: url(\'"+image+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'");
}
$(document).ready(function () {
$("#'.$input_id.'").focusout(function (e) {
setTimeout(() => {
let iconImage = "'.$icon_image.'";
$("#'.$input_id.'").attr("style", "background-image: url(\'"+iconImage+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; '.$inputStyles.'");
$("#'.$input_id.'").attr("style", "background-image: url(\'"+iconImage+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'");
}, 100);
});
});
@ -6216,7 +6291,7 @@ function ui_print_agent_autocomplete_input($parameters)
if (select_item_click) {
select_item_click = 0;
$("#'.$input_id.'")
.attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; '.$inputStyles.'");
.attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'");
return;
} else {
// Clear selectbox if item is not selected.
@ -6231,7 +6306,7 @@ function ui_print_agent_autocomplete_input($parameters)
//Set loading
$("#'.$input_id.'")
.attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; '.$inputStyles.'");
.attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'");
var term = input_value; //Word to search
'.$javascript_change_ajax_params_text.'
@ -6248,7 +6323,7 @@ function ui_print_agent_autocomplete_input($parameters)
success: function (data) {
if (data.length < 2) {
//Set icon
$("#'.$input_id.'").attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; '.$inputStyles.'");
$("#'.$input_id.'").attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'");
return;
}
@ -6298,7 +6373,7 @@ function ui_print_agent_autocomplete_input($parameters)
//Set icon
$("#'.$input_id.'")
.attr("style", "background: url(\"'.$icon_image.'\") 97% center no-repeat; background-size: 20px; '.$inputStyles.'")
.attr("style", "background: url(\"'.$icon_image.'\") 97% center no-repeat; background-size: 20px; width:100%; '.$inputStyles.'")
return;
}
});
@ -6317,7 +6392,7 @@ function ui_print_agent_autocomplete_input($parameters)
}
$attrs = [];
$attrs['style'] = 'background-image: url('.$icon_image.'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; '.$text_color.' '.$inputStyles.'';
$attrs['style'] = 'background-image: url('.$icon_image.'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$text_color.' '.$inputStyles.'';
if (!$disabled_javascript_on_blur_function) {
$attrs['onblur'] = $javascript_on_blur_function_name.'()';
@ -7025,20 +7100,6 @@ function ui_query_result_editor($name='default')
true
);
$editorSubContainer .= html_print_div(
[
'class' => 'action-buttons edit-button',
'content' => html_print_submit_button(
__('Execute query'),
'execute_query',
false,
['icon' => 'next'],
true
),
],
true
);
$editorContainer = html_print_div(
[
'id' => $name.'_editor_container',
@ -7096,6 +7157,11 @@ function ui_query_result_editor($name='default')
'content' => ui_get_full_url(false, false, false, false),
]
);
$buttons = html_print_submit_button(__('Execute query'), 'execute_query', false, ['icon' => 'update'], true);
html_print_action_buttons(
$buttons
);
}
@ -7267,22 +7333,19 @@ function ui_get_inventory_module_add_form(
$table = new stdClass();
$table->id = 'inventory-module-form';
$table->width = '100%';
$table->class = 'databox filters';
$table->style['module-title'] = 'font-weight: bold;';
$table->style['interval-title'] = 'font-weight: bold;';
$table->style['target-title'] = 'font-weight: bold;';
$table->style['chkbx-custom-fields-title'] = 'font-weight: bold;';
$table->style['username-title'] = 'font-weight: bold;';
$table->style['password-title'] = 'font-weight: bold;';
$table->class = 'databox filters filter-table-adv';
$table->size['module'] = '50%';
$table->size['interval'] = '50%';
$table->size['target'] = '50%';
$table->size['chkbx-custom-fields'] = '50%';
$table->size['username'] = '50%';
$table->size['password'] = '50%';
$table->rowstyle = [];
$table->rowstyle['hidden-custom-field-row'] = 'display: none;';
$table->colspan = [];
$table->colspan['custom-fields-row'] = [];
$table->colspan['custom-fields-row']['custom-fields-column'] = 4;
$table->rowstyle['custom-fields-button'] = 'display: none;';
$table->data = [];
$row = [];
$row['module-title'] = __('Module');
if (empty($inventory_module_id)) {
if (empty($os_id)) {
$sql = 'SELECT mi.id_module_inventory AS id, mi.name AS name, co.name AS os
@ -7314,33 +7377,111 @@ function ui_get_inventory_module_add_form(
}
}
$row['module-input'] = html_print_select($inventory_modules, 'id_module_inventory', 0, '', __('Select inventory module'), 0, true, false, false);
$row['module'] = html_print_label_input_block(
__('Module'),
html_print_select(
$inventory_modules,
'id_module_inventory',
0,
'',
__('Select inventory module'),
0,
true,
false,
false,
'w100p',
false,
'width: 100%'
)
);
} else {
$row['module-input'] = db_get_sql('SELECT name FROM tmodule_inventory WHERE id_module_inventory = '.$inventory_module_id);
$row['module'] = html_print_label_input_block(
__('Module'),
db_get_sql('SELECT name FROM tmodule_inventory WHERE id_module_inventory = '.$inventory_module_id)
);
}
$row['interval-title'] = __('Interval');
$row['interval-input'] = html_print_extended_select_for_time('interval', $interval, '', '', '', false, true);
$row['interval'] = html_print_label_input_block(
__('Interval'),
html_print_extended_select_for_time(
'interval',
$interval,
'',
'',
'',
false,
true,
false,
true,
'w100p'
)
);
$table->data['first-row'] = $row;
$row = [];
if ($target !== false) {
$row['target-title'] = __('Target');
$row['target-input'] = html_print_input_text('target', $target, '', 25, 40, true);
$row['target'] = html_print_label_input_block(
__('Target'),
html_print_input_text(
'target',
$target,
'',
25,
40,
true,
false,
false,
'',
'w100p'
)
);
}
$row['chkbx-custom-fields-title'] = __('Use custom fields');
$row['chkbx-custom-fields-input'] = html_print_checkbox('custom_fields_enabled', 1, $custom_fields_enabled, true);
$row['chkbx-custom-fields'] = html_print_label_input_block(
__('Use custom fields'),
html_print_checkbox(
'custom_fields_enabled',
1,
$custom_fields_enabled,
true
)
);
$table->data['second-row'] = $row;
$row = [];
$row['username-title'] = __('Username');
$row['username-input'] = html_print_input_text('username', $username, '', 25, 40, true);
$row['password-title'] = __('Password');
$row['password-input'] = html_print_input_password('password', $password, '', 25, 40, true);
$row['username'] = html_print_label_input_block(
__('Username'),
html_print_input_text(
'username',
$username,
'',
25,
40,
true,
false,
false,
'',
'w100p'
)
);
$row['password'] = html_print_label_input_block(
__('Password'),
html_print_input_password(
'password',
$password,
'',
25,
40,
true,
false,
false,
'w100p'
)
);
$table->data['userpass-row'] = $row;
@ -7348,8 +7489,18 @@ function ui_get_inventory_module_add_form(
$row['hidden-title'] = '';
$row['hidden-input'] = html_print_input_hidden('hidden-custom-field-name', '', true);
$row['hidden-input'] .= html_print_input_hidden('hidden-custom-field-is-secure', 0, true);
$row['hidden-input'] .= html_print_input_text('hidden-custom-field-input', '', '', 25, 40, true);
$row['hidden-input'] .= '<span>&nbsp;</span>';
$row['hidden-input'] .= html_print_input_text(
'hidden-custom-field-input',
'',
'',
25,
40,
true,
false,
false,
'',
'w93p'
);
$row['hidden-input'] .= html_print_image(
'images/delete.svg',
true,
@ -7414,19 +7565,51 @@ function ui_get_inventory_module_add_form(
}
$row = [];
$row['custom-fields-column'] = '<b>'.__('Field name').'</b>'.'&nbsp;&nbsp;'.html_print_input_text('field-name', '', '', 25, 40, true).'&nbsp;&nbsp;&nbsp;'.html_print_checkbox('field-is-password', 1, false, true).__("It's a password").'&nbsp;&nbsp;&nbsp;'.html_print_button(__('Add field'), 'add-field', false, '', 'class="sub add"', true);
$row['custom-fields-column'] = html_print_label_input_block(
__('Field name'),
'<div class="flex">'.html_print_input_text(
'field-name',
'',
'',
25,
40,
true,
false,
false,
'',
'w60p mrgn_right_10px'
).html_print_checkbox(
'field-is-password',
1,
false,
true
).'&nbsp;'.__("It's a password").'</div>'
);
$table->data['custom-fields-row'] = $row;
$row = [];
$row['custom-fields-button-title'] = '';
$row['custom-fields-button'] = html_print_button(
__('Add field'),
'add-field',
false,
'',
[
'class' => 'mini float-right',
'icon' => 'plus',
],
true
);
$table->data['custom-fields-button'] = $row;
ob_start();
echo '<form name="modulo" method="post" action="'.$form_action.'">';
echo '<form id="policy_inventory_module_edit_form" name="modulo" method="post" action="'.$form_action.'" class="max_floating_element_size">';
echo html_print_table($table);
echo '<div class="action-buttons w100p">';
echo $form_buttons;
echo '</div>';
echo '</form>';
?>
<script type="text/javascript">
@ -7617,4 +7800,48 @@ function ui_print_status_div($status)
}
return $return;
}
function ui_print_fav_menu($id_element, $url, $label, $section)
{
global $config;
$label = io_safe_output($label);
if (strlen($label) > 18) {
$label = io_safe_input(substr($label, 0, 18).'...');
}
$fav = db_get_row_filter(
'tfavmenu_user',
[
'url' => $url,
'id_user' => $config['id_user'],
],
['*']
);
$config_fav_menu = [
'id_element' => $id_element,
'url' => $url,
'label' => $label,
'section' => $section,
];
$output = '<span class="fav-menu">';
$output .= html_print_input_image(
'fav-menu-action',
(($fav !== false) ? 'images/star_fav_menu.png' : 'images/star_dark.png'),
base64_encode(json_encode($config_fav_menu)),
'',
true,
[
'onclick' => 'favMenuAction(this)',
'class' => (($fav !== false) ? 'active' : ''),
]
);
$output .= '</span>';
$output .= '<div id="dialog-fav-menu">';
$output .= '<p><b>'.__('Title').'</b></p>';
$output .= html_print_input_text('label_fav_menu', '', '', 25, 255, true, false, true);
$output .= '</div>';
return $output;
}

View File

@ -696,7 +696,7 @@ function get_build_setup_charts($type, $options, $data)
$legend->setAlign($legendAlign);
// Defaults fonts legends.
$legend->labels()->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']);
$legend->labels()->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$legend->labels()->getFonts()->setStyle('normal');
$legend->labels()->getFonts()->setWeight(600);
$legend->labels()->getFonts()->setSize(((int) $config['font_size'] + 2));
@ -835,7 +835,7 @@ function get_build_setup_charts($type, $options, $data)
$dataLabel->setFormatter($dataLabelFormatter);
// Defaults fonts datalabel.
$dataLabel->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']);
$dataLabel->getFonts()->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$dataLabel->getFonts()->setStyle('normal');
$dataLabel->getFonts()->setWeight(600);
$dataLabel->getFonts()->setSize(((int) $config['font_size'] + 2));
@ -944,14 +944,14 @@ function get_build_setup_charts($type, $options, $data)
// Defaults scalesFont X.
$scalesXFonts = $scales->getX()->ticks()->getFonts();
$scalesXFonts->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']);
$scalesXFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$scalesXFonts->setStyle('normal');
$scalesXFonts->setWeight(600);
$scalesXFonts->setSize(((int) $config['font_size'] + 2));
// Defaults scalesFont Y.
$scalesYFonts = $scales->getY()->ticks()->getFonts();
$scalesYFonts->setFamily((empty($config['fontpath']) === true) ? 'Lato' : $config['fontpath']);
$scalesYFonts->setFamily((empty($config['fontpath']) === true) ? 'lato' : $config['fontpath']);
$scalesYFonts->setStyle('normal');
$scalesYFonts->setWeight(600);
$scalesYFonts->setSize(((int) $config['font_size'] + 2));

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