Merge remote-tracking branch 'origin/develop' into ent-6422-10782-Error-entity-en-informe-SQL-query
This commit is contained in:
commit
b42cb5a30f
|
@ -17,7 +17,7 @@ services:
|
|||
- pandora
|
||||
|
||||
pandora:
|
||||
image: pandorafms/pandorafms-open-stack-el8:749
|
||||
image: pandorafms/pandorafms-open-stack-el8:latest
|
||||
restart: always
|
||||
depends_on:
|
||||
- db
|
||||
|
|
|
@ -143,7 +143,7 @@ done
|
|||
|
||||
# Darwin dmg installer files
|
||||
echo "Updating DARWIN DMG files..."
|
||||
sed -i -e "/VERSION/s/=.*/=\"$VERSION\"/" "$AGENT_DARWIN_BUILDER"
|
||||
sed -i -e "/VERSION/s/=\"7.0NG.*/=\"$VERSION\"/" "$AGENT_DARWIN_BUILDER"
|
||||
sed -i -r "s/(version=\").*(\"\s+onConclusion=)/\1$VERSION\2/g" "$AGENT_DARWIN_DISTR"
|
||||
sed -i -r "s/(CFBundleVersion<\/key>\s*<string>).*(<\/string>)/\1$VERSION\2/g" "$AGENT_DARWIN_PLIST"
|
||||
sed -i -r "s/(CFBundleShortVersionString<\/key>\s*<string>).*(<\/string>)/\1$VERSION\2/g" "$AGENT_DARWIN_PLIST"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.750-201030
|
||||
Version: 7.0NG.750-201124
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.750-201030"
|
||||
pandora_version="7.0NG.750-201124"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -22,7 +22,7 @@ fi
|
|||
|
||||
# DMG package version
|
||||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="7.0NG.750"
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.750"
|
||||
fi
|
||||
|
@ -37,7 +37,7 @@ fi
|
|||
BUILD_DMG="$BUILD_PATH/build"
|
||||
BUILD_TMP="$BUILD_PATH/buildtmp"
|
||||
|
||||
FULLNAME="7.0NG.749"
|
||||
FULLNAME="$DMGNAME-$VERSION.dmg"
|
||||
echo "VERSION-"$VERSION" NAME-"$DMGNAME
|
||||
pushd .
|
||||
cd $LOCALINST
|
||||
|
|
|
@ -26,11 +26,13 @@ else
|
|||
`/usr/local/share/pandora_agent/inst_utilities/print_conf.pl /usr/local/share/pandora_agent/pandora_agent.conf remote_config $REMOTECFG`
|
||||
|
||||
# Create agent directories and files
|
||||
mkdir -p /usr/local/share/pandora_agent/collections
|
||||
mkdir -p /usr/local/share/pandora_agent/commands
|
||||
mkdir -p /usr/local/bin/
|
||||
mkdir -p /usr/local/share/man/man1/
|
||||
mkdir -p /usr/local/share/pandora_agent/collections/
|
||||
mkdir -p /usr/local/share/pandora_agent/commands/
|
||||
mkdir -p /etc/pandora/
|
||||
mkdir -p /var/spool/pandora/data_out
|
||||
mkdir -p /var/log/pandora
|
||||
mkdir -p /var/spool/pandora/data_out/
|
||||
mkdir -p /var/log/pandora/
|
||||
mv pandora_agent.conf /etc/pandora/
|
||||
touch /var/log/pandora/pandora_agent.log
|
||||
|
||||
|
@ -70,9 +72,9 @@ ln -s /usr/local/share/pandora_agent/collections /etc/pandora/collections
|
|||
|
||||
|
||||
# Copy manuals
|
||||
cp -f man/man1/pandora_agent.1.gz /usr/local/share/man/man1
|
||||
cp -f man/man1/pandora_agent.1.gz /usr/local/share/man/man1/
|
||||
chmod 644 /usr/local/share/man/man1/pandora_agent.1.gz
|
||||
cp -f man/man1/tentacle_client.1.gz /usr/local/share/man/man1
|
||||
cp -f man/man1/tentacle_client.1.gz /usr/local/share/man/man1/
|
||||
chmod 644 /usr/local/share/man/man1/tentacle_client.1.gz
|
||||
|
||||
# Create newsyslog entry
|
||||
|
|
|
@ -55,7 +55,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.750';
|
||||
use constant AGENT_BUILD => '201030';
|
||||
use constant AGENT_BUILD => '201124';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.750
|
||||
%define release 201030
|
||||
%define release 201124
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.750
|
||||
%define release 201030
|
||||
%define release 201124
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.750"
|
||||
PI_BUILD="201030"
|
||||
PI_BUILD="201124"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{201030}
|
||||
{201124}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.750(Build 201030)")
|
||||
#define PANDORA_VERSION ("7.0NG.750(Build 201124)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.750(Build 201030))"
|
||||
VALUE "ProductVersion", "(7.0NG.750(Build 201124))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.750-201030
|
||||
Version: 7.0NG.750-201124
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.750-201030"
|
||||
pandora_version="7.0NG.750-201124"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -468,6 +468,7 @@ function quickShellSettings()
|
|||
100,
|
||||
true
|
||||
);
|
||||
$hidden->data[1][1] .= ui_print_reveal_password('gotty_pass', true);
|
||||
|
||||
html_print_table($t);
|
||||
|
||||
|
|
|
@ -92,7 +92,11 @@ function output_xml_report($id)
|
|||
|
||||
$group = db_get_value('nombre', 'tgrupo', 'id_grupo', $report['id_group']);
|
||||
echo '<group><![CDATA['.io_safe_output($group)."]]></group>\n";
|
||||
$items = db_get_all_rows_field_filter('treport_content', 'id_report', $report['id_report']);
|
||||
$items = db_get_all_rows_field_filter(
|
||||
'treport_content',
|
||||
'id_report',
|
||||
$report['id_report']
|
||||
);
|
||||
foreach ($items as $item) {
|
||||
echo "<item>\n";
|
||||
echo '<type>'.io_safe_output($item['type'])."</type>\n";
|
||||
|
|
|
@ -37,8 +37,16 @@ function insert_item_report($report_id, $values)
|
|||
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
sprintf(__("Success add '%s' item in report '%s'."), $values['type'], $name),
|
||||
sprintf(__("Error create '%s' item in report '%s'."), $values['type'], $name)
|
||||
sprintf(
|
||||
__("Success add '%s' item in report '%s'."),
|
||||
$values['type'],
|
||||
$name
|
||||
),
|
||||
sprintf(
|
||||
__("Error create '%s' item in report '%s'."),
|
||||
$values['type'],
|
||||
$name
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -55,9 +63,12 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
$posible_name = $values['name'];
|
||||
$exist = true;
|
||||
$loops = 30;
|
||||
// Loops to exit or tries
|
||||
// Loops to exit or tries.
|
||||
while ($exist && $loops > 0) {
|
||||
$exist = (bool) db_get_row_filter('treport', ['name' => io_safe_input($posible_name)]);
|
||||
$exist = (bool) db_get_row_filter(
|
||||
'treport',
|
||||
['name' => io_safe_input($posible_name)]
|
||||
);
|
||||
|
||||
if ($exist) {
|
||||
$loops--;
|
||||
|
@ -74,7 +85,7 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
);
|
||||
break;
|
||||
} else if ($loops != 30) {
|
||||
ui_print_error_message(
|
||||
ui_print_warning_message(
|
||||
sprintf(
|
||||
__("Warning create '%s' report, the name exist, the report have a name %s."),
|
||||
$reportElement->name,
|
||||
|
@ -89,13 +100,22 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
break;
|
||||
}
|
||||
|
||||
$id_group = db_get_value('id_grupo', 'tgrupo', 'nombre', $reportElement->group);
|
||||
if (isset($reportElement->group) === true
|
||||
&& empty($reportElement->group) === false
|
||||
) {
|
||||
$id_group = db_get_value(
|
||||
'id_grupo',
|
||||
'tgrupo',
|
||||
'nombre',
|
||||
$reportElement->group
|
||||
);
|
||||
if ($id_group === false) {
|
||||
ui_print_error_message(__("Error the report haven't group."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($reportElement->description)) {
|
||||
if (isset($reportElement->description) === true) {
|
||||
$values['description'] = $reportElement->description;
|
||||
}
|
||||
|
||||
|
@ -108,9 +128,19 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
);
|
||||
|
||||
if ($id_report) {
|
||||
db_pandora_audit('Report management', 'Create report '.$id_report, false, false);
|
||||
db_pandora_audit(
|
||||
'Report management',
|
||||
'Create report '.$id_report,
|
||||
false,
|
||||
false
|
||||
);
|
||||
} else {
|
||||
db_pandora_audit('Report management', 'Fail to create report', false, false);
|
||||
db_pandora_audit(
|
||||
'Report management',
|
||||
'Fail to create report',
|
||||
false,
|
||||
false
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -119,45 +149,52 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
|
||||
$values = [];
|
||||
$values['id_report'] = $id_report;
|
||||
if (isset($item['description'])) {
|
||||
if (isset($item['description']) === true) {
|
||||
$values['description'] = io_safe_input($item['description']);
|
||||
}
|
||||
|
||||
if (isset($item['period'])) {
|
||||
if (isset($item['period']) === true) {
|
||||
$values['period'] = io_safe_input($item['period']);
|
||||
}
|
||||
|
||||
if (isset($item['type'])) {
|
||||
if (isset($item['type']) === true) {
|
||||
$values['type'] = io_safe_input($item['type']);
|
||||
}
|
||||
|
||||
$agents_item = [];
|
||||
if (isset($item['agent'])) {
|
||||
if (isset($item['agent']) === true) {
|
||||
$agents = agents_get_agents(
|
||||
['id_grupo' => $group_filter],
|
||||
[
|
||||
'id_agente',
|
||||
'nombre',
|
||||
'alias',
|
||||
]
|
||||
);
|
||||
|
||||
$agent_clean = str_replace(['[', ']'], '', $item['agent']);
|
||||
$agent_clean = str_replace(
|
||||
[
|
||||
'[',
|
||||
']',
|
||||
],
|
||||
'',
|
||||
io_safe_output($item['agent'])
|
||||
);
|
||||
$regular_expresion = ($agent_clean != $item['agent']);
|
||||
|
||||
foreach ($agents as $agent) {
|
||||
if ($regular_expresion) {
|
||||
if ((bool) preg_match('/'.$agent_clean.'/', io_safe_output($agent['nombre']))) {
|
||||
$agents_item[$agent['id_agente']]['name'] = $agent['nombre'];
|
||||
if ((bool) preg_match('/'.$agent_clean.'/', io_safe_output($agent['alias']))) {
|
||||
$agents_item[$agent['id_agente']]['name'] = $agent['alias'];
|
||||
}
|
||||
} else {
|
||||
if ($agent_clean == io_safe_output($agent['nombre'])) {
|
||||
$agents_item[$agent['id_agente']]['name'] = $agent['nombre'];
|
||||
if ($agent_clean == io_safe_output($agent['alias'])) {
|
||||
$agents_item[$agent['id_agente']]['name'] = $agent['alias'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($item['module'])) {
|
||||
if (isset($item['module']) === true) {
|
||||
$module_clean = str_replace(['[', ']'], '', $item['module']);
|
||||
$regular_expresion = ($module_clean != $item['module']);
|
||||
|
||||
|
|
|
@ -114,6 +114,13 @@ foreach ($custom_fields as $field) {
|
|||
}
|
||||
}
|
||||
|
||||
// Connection lost alert.
|
||||
ui_require_css_file('register', 'include/styles/', true);
|
||||
ui_require_javascript_file('connection_check');
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
|
||||
|
||||
// Get the custom icons.
|
||||
$docs_logo = ui_get_docs_logo();
|
||||
$support_logo = ui_get_support_logo();
|
||||
|
@ -450,7 +457,12 @@ if ($login_screen == 'logout') {
|
|||
echo '<div class="content_message_alert">';
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<h1>'.__('Logged out').'</h1>';
|
||||
if (empty($config['logout_msg']) === true) {
|
||||
echo '<p>'.__('Your session has ended. Please close your browser window to close this %s session.', get_product_name()).'</p>';
|
||||
} else {
|
||||
echo '<p>'.__($config['logout_msg']).'</p>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'hide-login-logout', false);
|
||||
|
|
|
@ -148,7 +148,8 @@ if ($initial && users_is_admin()) {
|
|||
config_wiz_modal(
|
||||
false,
|
||||
true,
|
||||
(($registration === true) ? 'show_registration_wizard()' : null)
|
||||
(($registration === true) ? 'show_registration_wizard()' : null),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -159,7 +160,8 @@ if (!$config['disabled_newsletter']) {
|
|||
false,
|
||||
// Launch only if not being launch from 'initial'.
|
||||
!$initial,
|
||||
(($show_newsletter === true) ? 'force_run_newsletter()' : null)
|
||||
(($show_newsletter === false) ? 'force_run_newsletter()' : null),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
if ($show_newsletter) {
|
||||
|
@ -167,7 +169,8 @@ if (!$config['disabled_newsletter']) {
|
|||
newsletter_wiz_modal(
|
||||
false,
|
||||
// Launch only if not being call from 'registration'.
|
||||
!$registration && !$initial
|
||||
!$registration && !$initial,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -535,20 +535,30 @@ $table_advanced->data[0][1] = html_print_input_text(
|
|||
);
|
||||
|
||||
$table_advanced->data[0][3] = __('Unit');
|
||||
// $table_advanced->data[1][4] = html_print_input_text ('unit', $unit, '', 20, 65, true,
|
||||
// $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
|
||||
// $table_advanced->colspan[1][4] = 3;
|
||||
$table_advanced->data[0][4] = html_print_extended_select_for_unit(
|
||||
$table_advanced->data[0][4] = html_print_input_text (
|
||||
'unit',
|
||||
$unit,
|
||||
'',
|
||||
'',
|
||||
'0',
|
||||
false,
|
||||
20,
|
||||
65,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
false
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
// $table_advanced->colspan[1][4] = 3;
|
||||
//$table_advanced->data[0][4] = html_print_extended_select_for_unit(
|
||||
// 'unit',
|
||||
// $unit,
|
||||
// '',
|
||||
// '',
|
||||
// '0',
|
||||
// false,
|
||||
// true,
|
||||
// false,
|
||||
// false
|
||||
//);
|
||||
$table_advanced->colspan[0][4] = 3;
|
||||
|
||||
$module_id_policy_module = 0;
|
||||
|
@ -1340,6 +1350,7 @@ $(document).ready (function () {
|
|||
var type_name_selected = type_names[type_selected];
|
||||
var element = document.getElementById("module_type_help");
|
||||
var language = "<?php echo $config['language']; ?>" ;
|
||||
if (typeof element !== 'undefined' && element !== null) {
|
||||
element.onclick = function (event) {
|
||||
if(type_name_selected == 'async_data' ||
|
||||
type_name_selected == 'async_proc' ||
|
||||
|
@ -1451,6 +1462,7 @@ $(document).ready (function () {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type_name_selected.match(/_string$/) == null) {
|
||||
// Numeric types
|
||||
|
|
|
@ -130,6 +130,16 @@ if ($update || $create) {
|
|||
$id_agent = (int) get_parameter('id_agent');
|
||||
$text_module = get_parameter('text_module', '');
|
||||
$id_agent_module = (int) get_parameter('module_search_hidden');
|
||||
if ($text_module === '') {
|
||||
$text_module = io_safe_output(
|
||||
db_get_value_filter(
|
||||
'nombre',
|
||||
'tagente_modulo',
|
||||
['id_agente_modulo' => $id_agent_module]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$pagination = get_parameter('pagination', '');
|
||||
$event_view_hr = get_parameter('event_view_hr', '');
|
||||
$id_user_ack = get_parameter('id_user_ack', '');
|
||||
|
|
|
@ -419,46 +419,53 @@ if ($update_group) {
|
|||
$aviable_name = false;
|
||||
}
|
||||
|
||||
// Check if name field is empty.
|
||||
if ($name != '' && $aviable_name === true) {
|
||||
$sql = sprintf(
|
||||
'UPDATE tgrupo
|
||||
SET nombre = "%s",
|
||||
icon = "%s",
|
||||
disabled = %d,
|
||||
parent = %d,
|
||||
custom_id = "%s",
|
||||
propagate = %d,
|
||||
id_skin = %d,
|
||||
description = "%s",
|
||||
contact = "%s",
|
||||
other = "%s",
|
||||
password = "%s"
|
||||
WHERE id_grupo = %d',
|
||||
$name,
|
||||
empty($icon) ? '' : substr($icon, 0, -4),
|
||||
!$alerts_enabled,
|
||||
$id_parent,
|
||||
$custom_id,
|
||||
$propagate,
|
||||
$skin,
|
||||
$description,
|
||||
$contact,
|
||||
$other,
|
||||
$group_pass,
|
||||
$id_group
|
||||
// Check if group name is unique.
|
||||
$check = db_get_value_filter(
|
||||
'nombre',
|
||||
'tgrupo',
|
||||
[
|
||||
'nombre' => $name,
|
||||
'id_grupo' => $id_group,
|
||||
],
|
||||
'AND NOT'
|
||||
);
|
||||
|
||||
$result = db_process_sql($sql);
|
||||
} else {
|
||||
$result = false;
|
||||
// Check if name field is empty.
|
||||
if ($name != '') {
|
||||
if (!$check) {
|
||||
if ($aviable_name === true) {
|
||||
$values = [
|
||||
'nombre' => $name,
|
||||
'icon' => empty($icon) ? '' : substr($icon, 0, -4),
|
||||
'parent' => $id_parent,
|
||||
'disabled' => !$alerts_enabled,
|
||||
'custom_id' => $custom_id,
|
||||
'id_skin' => $skin,
|
||||
'description' => $description,
|
||||
'contact' => $contact,
|
||||
'propagate' => $propagate,
|
||||
'other' => $other,
|
||||
'password' => io_safe_input($group_pass),
|
||||
];
|
||||
|
||||
$result = db_process_sql_update(
|
||||
'tgrupo',
|
||||
$values,
|
||||
['id_grupo' => $id_group]
|
||||
);
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
if ($result) {
|
||||
ui_print_success_message(__('Group successfully updated'));
|
||||
} else {
|
||||
ui_print_error_message(__('There was a problem modifying group'));
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Each group must have a different name'));
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Group must have a name'));
|
||||
}
|
||||
}
|
||||
|
||||
// Delete group.
|
||||
|
|
|
@ -67,12 +67,32 @@ if ($add) {
|
|||
$modules = get_parameter('module');
|
||||
$modules_id = [];
|
||||
if (!empty($modules)) {
|
||||
$modules_id = [];
|
||||
|
||||
foreach ($modules as $module) {
|
||||
foreach ($id_agents as $id_agent) {
|
||||
if ($module == '0') {
|
||||
// Get all modules of agent.
|
||||
$agent_modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
['id_agente' => $id_agent],
|
||||
'id_agente_modulo'
|
||||
);
|
||||
|
||||
$agent_modules_id = array_map(
|
||||
function ($field) {
|
||||
return $field['id_agente_modulo'];
|
||||
},
|
||||
$agent_modules
|
||||
);
|
||||
|
||||
$modules_id = array_merge($modules_id, $agent_modules_id);
|
||||
} else {
|
||||
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
||||
$modules_id[] = $module_id['id_agente_modulo'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$agent_alerts = agents_get_alerts($id_agents);
|
||||
$cont = 0;
|
||||
|
|
|
@ -106,15 +106,31 @@ function process_manage_add($id_alert_template, $id_agents, $module_names)
|
|||
return false;
|
||||
}
|
||||
|
||||
$modules_id = [];
|
||||
|
||||
foreach ($module_names as $module) {
|
||||
foreach ($id_agents as $id_agent) {
|
||||
if ($module == '0') {
|
||||
// Get all modules of agent.
|
||||
$agent_modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
['id_agente' => $id_agent],
|
||||
'id_agente_modulo'
|
||||
);
|
||||
|
||||
$agent_modules_id = array_map(
|
||||
function ($field) {
|
||||
return $field['id_agente_modulo'];
|
||||
},
|
||||
$agent_modules
|
||||
);
|
||||
|
||||
$modules_id = array_merge($modules_id, $agent_modules_id);
|
||||
} else {
|
||||
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
||||
$modules_id[] = $module_id['id_agente_modulo'];
|
||||
}
|
||||
}
|
||||
|
||||
if (count($module_names) == 1 && $module_names[0] == '0') {
|
||||
$modules_id = agents_common_modules($id_agents, false, true);
|
||||
}
|
||||
|
||||
$conttotal = 0;
|
||||
|
|
|
@ -66,12 +66,31 @@ if ($delete) {
|
|||
$modules = (array) get_parameter('module');
|
||||
$modules_id = [];
|
||||
if (!empty($modules)) {
|
||||
$modules_id = [];
|
||||
foreach ($modules as $module) {
|
||||
foreach ($id_agents as $id_agent) {
|
||||
if ($module == '0') {
|
||||
// Get all modules of agent.
|
||||
$agent_modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
['id_agente' => $id_agent],
|
||||
'id_agente_modulo'
|
||||
);
|
||||
|
||||
$agent_modules_id = array_map(
|
||||
function ($field) {
|
||||
return $field['id_agente_modulo'];
|
||||
},
|
||||
$agent_modules
|
||||
);
|
||||
|
||||
$modules_id = array_merge($modules_id, $agent_modules_id);
|
||||
} else {
|
||||
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
||||
$modules_id[] = $module_id['id_agente_modulo'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$agent_alerts = agents_get_alerts($id_agents);
|
||||
$alerts_agent_modules = [];
|
||||
|
|
|
@ -450,7 +450,7 @@ $table->data['form_modules_2'][1] = html_print_select(
|
|||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
);
|
||||
).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'");
|
||||
|
||||
$table->data['form_modules_2'][2] = __('When select modules');
|
||||
$table->data['form_modules_2'][2] .= '<br>';
|
||||
|
@ -522,7 +522,8 @@ $table->data['form_agents_3'][1] = html_print_select(
|
|||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
);
|
||||
).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'");
|
||||
|
||||
$table->data['form_agents_3'][2] = __('When select agents');
|
||||
$table->data['form_agents_3'][2] .= '<br>';
|
||||
$table->data['form_agents_3'][2] .= html_print_select(
|
||||
|
@ -588,6 +589,44 @@ if ($selection_mode == 'modules') {
|
|||
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||
|
||||
$(document).ready (function () {
|
||||
$("#checkbox-select_all_modules").change(function() {
|
||||
if( $('#checkbox-select_all_modules').prop('checked')) {
|
||||
$("#module_name option").prop('selected', 'selected');
|
||||
$("#module_name").trigger('change');
|
||||
} else {
|
||||
$("#module_name option").prop('selected', false);
|
||||
$("#module_name").trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
$("#module_name").change(function() {
|
||||
var options_length = $("#module_name option").length;
|
||||
var options_selected_length = $("#module_name option:selected").length;
|
||||
|
||||
if (options_selected_length < options_length) {
|
||||
$('#checkbox-select_all_modules').prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
$("#checkbox-select_all_agents").change(function() {
|
||||
if( $('#checkbox-select_all_agents').prop('checked')) {
|
||||
$("#id_agents option").prop('selected', 'selected');
|
||||
$("#id_agents").trigger('change');
|
||||
} else {
|
||||
$("#id_agents option").prop('selected', false);
|
||||
$("#id_agents").trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
$("#id_agents").change(function() {
|
||||
var options_length = $("#id_agents option").length;
|
||||
var options_selected_length = $("#id_agents option:selected").length;
|
||||
|
||||
if (options_selected_length < options_length) {
|
||||
$('#checkbox-select_all_agents').prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
$("#module_name").change(module_changed_by_multiple_modules);
|
||||
|
||||
|
@ -680,7 +719,7 @@ $(document).ready (function () {
|
|||
$('#groups_select').val(-1);
|
||||
}
|
||||
|
||||
$('input[type=checkbox]').change (
|
||||
$('input[type=checkbox]').not(".static").change (
|
||||
function () {
|
||||
if (this.id == "checkbox-force_type") {
|
||||
if (this.checked) {
|
||||
|
|
|
@ -406,7 +406,8 @@ $table->data['form_modules_2'][1] = html_print_select(
|
|||
true,
|
||||
true,
|
||||
true
|
||||
);
|
||||
).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'");
|
||||
|
||||
$table->data['form_modules_2'][2] = __('When select modules');
|
||||
$table->data['form_modules_2'][2] .= '<br>';
|
||||
$table->data['form_modules_2'][2] .= html_print_select(
|
||||
|
@ -491,7 +492,7 @@ $table->data['form_agents_3'][1] = html_print_select(
|
|||
true,
|
||||
true,
|
||||
false
|
||||
);
|
||||
).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'");
|
||||
|
||||
$table->data['form_agents_3'][2] = __('When select agents');
|
||||
$table->data['form_agents_3'][2] .= '<br>';
|
||||
|
@ -1213,6 +1214,44 @@ $(document).ready (function () {
|
|||
}
|
||||
});
|
||||
|
||||
$("#checkbox-select_all_modules").change(function() {
|
||||
if( $('#checkbox-select_all_modules').prop('checked')) {
|
||||
$("#module_name option").prop('selected', 'selected');
|
||||
$("#module_name").trigger('change');
|
||||
} else {
|
||||
$("#module_name option").prop('selected', false);
|
||||
$("#module_name").trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
$("#module_name").change(function() {
|
||||
var options_length = $("#module_name option").length;
|
||||
var options_selected_length = $("#module_name option:selected").length;
|
||||
|
||||
if (options_selected_length < options_length) {
|
||||
$('#checkbox-select_all_modules').prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
$("#checkbox-select_all_agents").change(function() {
|
||||
if( $('#checkbox-select_all_agents').prop('checked')) {
|
||||
$("#id_agents option").prop('selected', 'selected');
|
||||
$("#id_agents").trigger('change');
|
||||
} else {
|
||||
$("#id_agents option").prop('selected', false);
|
||||
$("#id_agents").trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
$("#id_agents").change(function() {
|
||||
var options_length = $("#id_agents option").length;
|
||||
var options_selected_length = $("#id_agents option:selected").length;
|
||||
|
||||
if (options_selected_length < options_length) {
|
||||
$('#checkbox-select_all_agents').prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
$("#text-custom_ip_target").hide();
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
|
@ -1463,7 +1502,7 @@ $(document).ready (function () {
|
|||
$('#groups_select').val(-1);
|
||||
}
|
||||
|
||||
$('input[type=checkbox]').change (
|
||||
$('input[type=checkbox]').not(".static").change (
|
||||
function () {
|
||||
if (this.id == "checkbox-force_type") {
|
||||
if (this.checked) {
|
||||
|
|
|
@ -386,6 +386,8 @@ $next_row++;
|
|||
console.log(type_name_selected);
|
||||
var element = document.getElementById("module_type_help");
|
||||
var language = "<?php echo $config['language']; ?>" ;
|
||||
|
||||
if (typeof element !== 'undefined' && element !== null) {
|
||||
element.onclick = function (event) {
|
||||
if(type_name_selected == 'async_data' ||
|
||||
type_name_selected == 'async_proc' ||
|
||||
|
@ -501,6 +503,7 @@ $next_row++;
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type_name_selected.match(/_string$/) == null) {
|
||||
// Numeric types
|
||||
|
|
|
@ -1813,11 +1813,9 @@ switch ($action) {
|
|||
);
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
|
||||
if ($values['server_name'] == '') {
|
||||
$values['server_name'] = get_parameter(
|
||||
'combo_server'
|
||||
);
|
||||
}
|
||||
|
||||
if ((($values['type'] == 'custom_graph')
|
||||
|| ($values['type'] == 'automatic_custom_graph'))
|
||||
|
|
|
@ -91,8 +91,20 @@ foreach ($servers as $server) {
|
|||
|
||||
// Status
|
||||
$data[1] = ui_print_status_image(STATUS_SERVER_OK, '', true);
|
||||
if (($server['status'] == 0) || (($date - time_w_fixed_tz($server['keepalive'])) > ($server['server_keepalive']) * 2)) {
|
||||
$data[1] = ui_print_status_image(STATUS_SERVER_DOWN, '', true);
|
||||
if ($server['status'] == -1) {
|
||||
$data[1] = ui_print_status_image(
|
||||
STATUS_SERVER_CRASH,
|
||||
__('Server has crashed.'),
|
||||
true
|
||||
);
|
||||
} else if (($server['status'] == 0)
|
||||
|| (($date - time_w_fixed_tz($server['keepalive'])) > ($server['server_keepalive']) * 2)
|
||||
) {
|
||||
$data[1] = ui_print_status_image(
|
||||
STATUS_SERVER_DOWN,
|
||||
__('Server is stopped.'),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// Type
|
||||
|
|
|
@ -189,6 +189,10 @@ if (is_ajax()) {
|
|||
100,
|
||||
true
|
||||
);
|
||||
$row['control'] .= ui_print_reveal_password(
|
||||
'ldap_admin_pass',
|
||||
true
|
||||
);
|
||||
$table->data['ldap_admin_pass'] = $row;
|
||||
break;
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ $table_remote->data['ehorus_user'] = $row;
|
|||
$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);
|
||||
$table_remote->data['ehorus_pass'] = $row;
|
||||
|
||||
// Directory hostname.
|
||||
|
|
|
@ -116,7 +116,8 @@ $table->data[$i][0] = __('Phantomjs bin directory');
|
|||
$table->data[$i++][1] = html_print_input_text('phantomjs_bin', io_safe_output($config['phantomjs_bin']), '', 30, 100, true);
|
||||
|
||||
$table->data[$i][0] = __('Auto login (hash) password');
|
||||
$table->data[$i++][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true);
|
||||
$table->data[$i][1] = html_print_input_password('loginhash_pwd', io_output_password($config['loginhash_pwd']), '', 15, 15, true);
|
||||
$table->data[$i++][1] .= ui_print_reveal_password('loginhash_pwd', true);
|
||||
|
||||
$table->data[$i][0] = __('Time source');
|
||||
$sources['system'] = __('System');
|
||||
|
@ -154,7 +155,8 @@ if (isset($_POST['list_ACL_IPs_for_API'])) {
|
|||
$table->data[$i++][1] = html_print_textarea('list_ACL_IPs_for_API', 2, 25, $list_ACL_IPs_for_API, 'style="height: 50px; width: 300px"', true);
|
||||
|
||||
$table->data[$i][0] = __('API password');
|
||||
$table->data[$i++][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true);
|
||||
$table->data[$i][1] = html_print_input_password('api_password', io_output_password($config['api_password']), '', 25, 255, true);
|
||||
$table->data[$i++][1] .= ui_print_reveal_password('api_password', true);
|
||||
|
||||
$table->data[$i][0] = __('Enable GIS features');
|
||||
$table->data[$i++][1] = html_print_checkbox_switch('activate_gis', 1, $config['activate_gis'], true);
|
||||
|
@ -379,6 +381,7 @@ $table_mail_conf->data[5][1] = html_print_input_text('email_username', $config['
|
|||
|
||||
$table_mail_conf->data[6][0] = __('Email password');
|
||||
$table_mail_conf->data[6][1] = html_print_input_password('email_password', io_output_password($config['email_password']), '', 30, 100, true);
|
||||
$table_mail_conf->data[6][1] .= ui_print_reveal_password('email_password', true);
|
||||
|
||||
$uniqid = uniqid();
|
||||
|
||||
|
|
|
@ -221,6 +221,7 @@ $table_remote->data['integria_user'] = $row;
|
|||
$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);
|
||||
$table_remote->data['integria_pass'] = $row;
|
||||
|
||||
// Integria hostname.
|
||||
|
@ -233,6 +234,7 @@ $table_remote->data['integria_hostname'] = $row;
|
|||
$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);
|
||||
$table_remote->data['integria_api_pass'] = $row;
|
||||
|
||||
// Request timeout.
|
||||
|
|
|
@ -44,6 +44,16 @@ if (! check_acl($config['id_user'], 0, 'PM')
|
|||
return;
|
||||
}
|
||||
|
||||
require_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
|
||||
|
||||
if (update_manager_verify_license_expired()) {
|
||||
ui_print_error_message(
|
||||
__('The license has expired. Please contact Artica at info@artica.es')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$baseurl = ui_get_full_url(false, false, false, false);
|
||||
|
||||
$current_package = db_get_value(
|
||||
|
|
|
@ -94,6 +94,13 @@ if ($upload_max_filesize < $PHPupload_max_filesize_min) {
|
|||
$php_settings_fine++;
|
||||
}
|
||||
|
||||
if (update_manager_verify_license_expired()) {
|
||||
ui_print_error_message(
|
||||
__('The license has expired. Please contact Artica at info@artica.es')
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Verify registry.
|
||||
if (update_manager_verify_registration() === false) {
|
||||
ui_require_css_file('register');
|
||||
|
|
|
@ -1387,15 +1387,33 @@ $(document).ready (function () {
|
|||
});
|
||||
});
|
||||
|
||||
$('#submit-crtbutton').click(function (e) {
|
||||
function checkProfiles(e) {
|
||||
e.preventDefault();
|
||||
var rows = $("#table_profiles tr").length;
|
||||
if ((is_metaconsole === '1' && rows <= 3) || (is_metaconsole === '' && rows <= 2)) {
|
||||
alert('<?php echo __('please add a profile'); ?>');
|
||||
if ($('input[name="is_admin"]:checked').val() == 1) {
|
||||
// Admin does not require profiles.
|
||||
$('#user_profile_form').submit();
|
||||
} else {
|
||||
this.form.submit();
|
||||
if ($('#table_profiles tbody').children().length == 1) {
|
||||
confirmDialog({
|
||||
title: "<?php echo __('Warning'); ?>",
|
||||
message: "<?php echo __('User will be created without profiles assigned and won\'t be able to log in, are you sure?'); ?>",
|
||||
onAccept: function() {
|
||||
$('#user_profile_form').submit();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#user_profile_form').submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('#submit-crtbutton').click(function (e) {
|
||||
checkProfiles(e);
|
||||
});
|
||||
|
||||
$('#submit-uptbutton').click(function (e) {
|
||||
checkProfiles(e);
|
||||
});
|
||||
});
|
||||
|
||||
function delete_profile(event, btn) {
|
||||
|
|
|
@ -176,7 +176,7 @@ class DiscoveryTaskList extends HTML
|
|||
'type' => 'button',
|
||||
'attributes' => 'class="sub upd"',
|
||||
'return' => true,
|
||||
'script' => 'location.reload();',
|
||||
'script' => 'location.href = \''.$this->url.'\';',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -402,8 +402,10 @@ class DiscoveryTaskList extends HTML
|
|||
$table->headstyle[$i] = 'text-align: left;';
|
||||
}
|
||||
|
||||
// Task name.
|
||||
$table->headstyle[1] .= 'min-width: 150px; width: 300px;';
|
||||
// Name.
|
||||
$table->headstyle[4] .= 'min-width: 100px; width: 600px;';
|
||||
$table->headstyle[4] .= 'min-width: 100px; width: 400px;';
|
||||
// Status.
|
||||
$table->headstyle[5] .= 'min-width: 50px; width: 100px;';
|
||||
// Task type.
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 647 B |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
|
@ -339,11 +339,46 @@ if ($get_filter_values) {
|
|||
'tag_with' => [],
|
||||
'tag_without' => [],
|
||||
'history' => false,
|
||||
'module_search' => '',
|
||||
'filter_only_alert' => '-1',
|
||||
'user_comment' => '',
|
||||
'id_extra' => '',
|
||||
'id_user_ack' => '',
|
||||
'date_from' => '',
|
||||
'date_to' => '',
|
||||
'severity' => '',
|
||||
'event_type' => '',
|
||||
'group_rep' => 0,
|
||||
'id_group' => 0,
|
||||
'id_group_filter' => 0,
|
||||
'group_name' => 'All',
|
||||
'text_agent' => '',
|
||||
'id_agent' => 0,
|
||||
'id_name' => 'None',
|
||||
'filter_id' => 0,
|
||||
];
|
||||
} else {
|
||||
$event_filter['module_search'] = io_safe_output(db_get_value_filter('nombre', 'tagente_modulo', ['id_agente_modulo' => $event_filter['id_agent_module']]));
|
||||
$a = array_keys(users_get_groups(false));
|
||||
$event_filter['group_name'] = '';
|
||||
foreach ($a as $key => $value) {
|
||||
if ($value == $event_filter['id_group']) {
|
||||
$event_filter['group_name'] = db_get_value('nombre', 'tgrupo', 'id_grupo', $event_filter['id_group_filter']);
|
||||
if ($event_filter['group_name'] === false) {
|
||||
$event_filter['group_name'] = __('All');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$event_filter['module_search'] = io_safe_output(db_get_value_filter('nombre', 'tagente_modulo', ['id_agente_modulo' => $event_filter['id_agent_module']]));
|
||||
}
|
||||
|
||||
$event_filter['search'] = io_safe_output($event_filter['search']);
|
||||
$event_filter['id_name'] = io_safe_output($event_filter['id_name']);
|
||||
$event_filter['text_agent'] = io_safe_output($event_filter['text_agent']);
|
||||
$event_filter['source'] = io_safe_output($event_filter['source']);
|
||||
|
||||
|
||||
$event_filter['tag_with'] = base64_encode(
|
||||
io_safe_output($event_filter['tag_with'])
|
||||
);
|
||||
|
@ -355,7 +390,7 @@ if ($get_filter_values) {
|
|||
}
|
||||
|
||||
if ($load_filter_modal) {
|
||||
$current = get_parameter('current_filter', '');
|
||||
$current = db_get_value_filter('default_event_filter', 'tusuario', ['id_user' => $config['id_user']]);
|
||||
$filters = events_get_event_filter_select();
|
||||
$user_groups_array = users_get_groups_for_select(
|
||||
$config['id_user'],
|
||||
|
@ -435,10 +470,12 @@ function load_form_filter() {
|
|||
},
|
||||
function (data) {
|
||||
jQuery.each (data, function (i, val) {
|
||||
console.log(val);
|
||||
if (i == 'id_name')
|
||||
$("#hidden-id_name").val(val);
|
||||
if (i == 'id_group')
|
||||
$("#id_group").val(val);
|
||||
if (i == 'id_group'){
|
||||
$('#id_group').val(val);
|
||||
}
|
||||
if (i == 'event_type')
|
||||
$("#event_type").val(val);
|
||||
if (i == 'severity') {
|
||||
|
@ -448,9 +485,9 @@ function load_form_filter() {
|
|||
if (i == 'status')
|
||||
$("#status").val(val);
|
||||
if (i == 'search')
|
||||
$("#text-search").val(val);
|
||||
$('#text-search').val(val);
|
||||
if (i == 'text_agent')
|
||||
$("#text_id_agent").val(val);
|
||||
$('input[name=text_agent]').val(val);
|
||||
if (i == 'id_agent')
|
||||
$('input:hidden[name=id_agent]').val(val);
|
||||
if (i == 'id_agent_module')
|
||||
|
@ -479,6 +516,15 @@ function load_form_filter() {
|
|||
$("#text-user_comment").val(val);
|
||||
if (i == 'id_source_event')
|
||||
$("#text-id_source_event").val(val);
|
||||
if(i == 'date_from')
|
||||
$("#text-date_from").val(val);
|
||||
if(i == 'date_to')
|
||||
$("#text-date_to").val(val);
|
||||
if(i == 'module_search')
|
||||
$('input[name=module_search]').val(val);
|
||||
if(i == 'group_name')
|
||||
$("#select2-id_group_filter-container").text(val);
|
||||
|
||||
});
|
||||
reorder_tags_inputs();
|
||||
// Update the info with the loaded filter
|
||||
|
@ -1147,12 +1193,37 @@ if ($change_status) {
|
|||
$event_ids = get_parameter('event_ids');
|
||||
$new_status = get_parameter('new_status');
|
||||
|
||||
$return = events_change_status(explode(',', $event_ids), $new_status, $meta, $history);
|
||||
$return = events_change_status(
|
||||
explode(',', $event_ids),
|
||||
$new_status,
|
||||
$meta,
|
||||
$history
|
||||
);
|
||||
|
||||
if ($return) {
|
||||
echo 'status_ok';
|
||||
if ($return !== false) {
|
||||
echo json_encode(
|
||||
[
|
||||
'status' => 'status_ok',
|
||||
'user' => db_get_value(
|
||||
'fullname',
|
||||
'tusuario',
|
||||
'id_user',
|
||||
$config['id_user']
|
||||
),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
echo 'status_error';
|
||||
echo json_encode(
|
||||
[
|
||||
'status' => 'status_error',
|
||||
'user' => db_get_value(
|
||||
'fullname',
|
||||
'tusuario',
|
||||
'id_user',
|
||||
$config['id_user']
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -239,8 +239,7 @@ function process_user_login_remote($login, $pass, $api=false)
|
|||
|
||||
// Unknown authentication method
|
||||
default:
|
||||
$config['auth_error'] = 'User not found in database
|
||||
or incorrect password';
|
||||
$config['auth_error'] = 'User not found in database or incorrect password';
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ class AgentWizard extends HTML
|
|||
// Check access.
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AR')) {
|
||||
if (!check_acl($config['id_user'], 0, 'AR')) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access event viewer'
|
||||
|
@ -293,6 +293,29 @@ class AgentWizard extends HTML
|
|||
$this->idAgent = get_parameter('id_agente', '');
|
||||
$this->idPolicy = get_parameter('id', '');
|
||||
$this->targetIp = get_parameter('targetIp', '');
|
||||
|
||||
if (!empty($this->idAgent)) {
|
||||
$array_aux = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT ip FROM taddress ta
|
||||
INNER JOIN taddress_agent taa ON taa.id_a = ta.id_a
|
||||
WHERE taa.id_agent = %d',
|
||||
$this->idAgent
|
||||
)
|
||||
);
|
||||
|
||||
if (!empty($array_aux)) {
|
||||
$this->datalist = [];
|
||||
foreach ($array_aux as $key => $value) {
|
||||
$this->datalist[] = $value['ip'];
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->datalist) === 1 && $this->targetIp === '') {
|
||||
$this->targetIp = $this->datalist[0];
|
||||
}
|
||||
}
|
||||
|
||||
$this->server = (int) get_parameter('server', '1');
|
||||
if ($this->server !== 0) {
|
||||
$this->serverType = (int) db_get_value(
|
||||
|
@ -563,6 +586,18 @@ class AgentWizard extends HTML
|
|||
],
|
||||
];
|
||||
|
||||
if (!empty($this->datalist)) {
|
||||
$inputs[] = [
|
||||
'id' => 'li_address_list',
|
||||
'arguments' => [
|
||||
'name' => 'address_list',
|
||||
'type' => 'datalist',
|
||||
'value' => $this->datalist,
|
||||
'return' => true,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
$inputs[] = [
|
||||
'label' => __('Target IP'),
|
||||
'id' => 'txt-targetIp',
|
||||
|
@ -573,6 +608,7 @@ class AgentWizard extends HTML
|
|||
'class' => '',
|
||||
'value' => $this->targetIp,
|
||||
'return' => true,
|
||||
'list' => 'address_list',
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -865,7 +901,6 @@ class AgentWizard extends HTML
|
|||
],
|
||||
true
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -992,10 +1027,51 @@ class AgentWizard extends HTML
|
|||
}
|
||||
|
||||
if ($this->wizardSection === 'snmp_interfaces_explorer') {
|
||||
// First, try x64 interfaces.
|
||||
// Check if thereis x64 counters.
|
||||
$snmp_tmp = '.1.3.6.1.2.1.31.1.1.1.6';
|
||||
$check_x64 = get_snmpwalk(
|
||||
$this->targetIp,
|
||||
$this->version,
|
||||
$this->community,
|
||||
$this->authUserV3,
|
||||
$this->securityLevelV3,
|
||||
$this->authMethodV3,
|
||||
$this->authPassV3,
|
||||
$this->privacyMethodV3,
|
||||
$this->privacyPassV3,
|
||||
0,
|
||||
$snmp_tmp,
|
||||
$this->targetPort,
|
||||
$this->server,
|
||||
$this->extraArguments
|
||||
);
|
||||
|
||||
if ($check_x64) {
|
||||
$this->interfacesx64 = true;
|
||||
$oidExplore = '.1.3.6.1.2.1.31.1.1.1.1';
|
||||
} else {
|
||||
$this->interfacesx64 = false;
|
||||
$oidExplore = '1.3.6.1.2.1.2.2.1.2';
|
||||
}
|
||||
|
||||
// Explore interface names.
|
||||
$oidExplore = '.1.3.6.1.2.1.31.1.1.1.1';
|
||||
$receivedOid = get_snmpwalk(
|
||||
$this->targetIp,
|
||||
$this->version,
|
||||
$this->community,
|
||||
$this->authUserV3,
|
||||
$this->securityLevelV3,
|
||||
$this->authMethodV3,
|
||||
$this->authPassV3,
|
||||
$this->privacyMethodV3,
|
||||
$this->privacyPassV3,
|
||||
0,
|
||||
$oidExplore,
|
||||
$this->targetPort,
|
||||
$this->server,
|
||||
$this->extraArguments
|
||||
);
|
||||
} else {
|
||||
// Get the device PEN.
|
||||
$oidExplore = '.1.3.6.1.2.1.1.2.0';
|
||||
|
@ -1310,7 +1386,7 @@ class AgentWizard extends HTML
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function candidateModuleToCreate(array $data):array
|
||||
public function candidateModuleToCreate(array $data): array
|
||||
{
|
||||
$modulesActivated = [];
|
||||
$generalInterface = false;
|
||||
|
@ -1391,10 +1467,16 @@ class AgentWizard extends HTML
|
|||
$result[$value]['name'] = $data['module-default_name-'.$key];
|
||||
} else if (empty(preg_match('/module-description-set/', $k)) === false) {
|
||||
$result[$value]['description'] = $data['module-default_description-'.$key];
|
||||
} else if (empty(preg_match('/module-value/', $k)) === false) {
|
||||
$result[$value]['value'] = $data['module-value-'.$key];
|
||||
}
|
||||
|
||||
preg_match('/^(.*)-.*?_(\d-\d)$/', $k, $matches);
|
||||
preg_match('/^(.*)-.*?_(\d+-\d+)$/', $k, $matches);
|
||||
$k = $matches[1].'-0_'.$matches[2];
|
||||
} else {
|
||||
if (empty(preg_match('/module-value/', $k)) === false) {
|
||||
$result[$value]['value'] = $data[$k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1418,7 +1500,7 @@ class AgentWizard extends HTML
|
|||
$result[$value]['scan_type'] = (int) $data[$k];
|
||||
} else if (empty(preg_match('/module-execution_type/', $k)) === false) {
|
||||
$result[$value]['execution_type'] = (int) $data[$k];
|
||||
} else if (empty(preg_match('/module-value/', $k)) === false) {
|
||||
} else if (($data['wizard_section'] !== 'snmp_interfaces_explorer') && (empty(preg_match('/module-value/', $k)) === false)) {
|
||||
$result[$value]['value'] = $data[$k];
|
||||
} else if (empty(preg_match('/module-macros/', $k)) === false) {
|
||||
$result[$value]['macros'] = $data[$k];
|
||||
|
@ -2261,7 +2343,7 @@ class AgentWizard extends HTML
|
|||
private function replacementMacrosPlugin(
|
||||
string $text,
|
||||
array $macros
|
||||
):string {
|
||||
): string {
|
||||
// Only agents.
|
||||
if (empty($this->idPolicy) === true) {
|
||||
// Common.
|
||||
|
@ -2308,7 +2390,7 @@ class AgentWizard extends HTML
|
|||
?string $value,
|
||||
?string $unit='',
|
||||
?int $moduleType=0
|
||||
):string {
|
||||
): string {
|
||||
if ($moduleType !== MODULE_TYPE_REMOTE_SNMP_INC
|
||||
&& $moduleType !== MODULE_TYPE_GENERIC_DATA_INC
|
||||
&& $moduleType !== MODULE_TYPE_REMOTE_TCP_INC
|
||||
|
@ -2562,7 +2644,7 @@ class AgentWizard extends HTML
|
|||
// Unpack the extra fields
|
||||
// and include with key field in a field set.
|
||||
$macros = json_decode($module['macros'], true);
|
||||
$fieldSet = [ '0' => $module['query_key_field'] ];
|
||||
$fieldSet = ['0' => $module['query_key_field']];
|
||||
foreach ($macros as $fieldKey => $fieldMacro) {
|
||||
if (preg_match('/extra_field_/', $fieldKey) !== 0) {
|
||||
$tmpKey = explode('_', $fieldKey);
|
||||
|
@ -3100,7 +3182,6 @@ class AgentWizard extends HTML
|
|||
// Add Create Modules form.
|
||||
$this->createModulesForm();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -3209,7 +3290,6 @@ class AgentWizard extends HTML
|
|||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -3306,7 +3386,7 @@ class AgentWizard extends HTML
|
|||
*
|
||||
* @return array Inputs for common data.
|
||||
*/
|
||||
private function getCommonDataInputs():array
|
||||
private function getCommonDataInputs(): array
|
||||
{
|
||||
$inputs[] = [
|
||||
'id' => 'create-modules-action',
|
||||
|
@ -4207,6 +4287,34 @@ class AgentWizard extends HTML
|
|||
],
|
||||
];
|
||||
|
||||
// Get x86 or x64 modules.
|
||||
if ($this->interfacesx64 === true) {
|
||||
$definition_temp = $this->getInterfacesModulesx64($data);
|
||||
} else {
|
||||
$definition_temp = $this->getInterfacesModulesx86($data);
|
||||
}
|
||||
|
||||
// General monitoring names.
|
||||
$general_module_names = [
|
||||
'ifInOctets / ifHCInOctets',
|
||||
'ifOutOctets / ifHCOutOctets',
|
||||
'ifInUcastPkts / ifHCInUcastPkts',
|
||||
'ifOutUcastPkts / ifHCOutUcastPkts',
|
||||
'ifInNUcastPkts / ifHCInNUcastPkts',
|
||||
'ifOutNUcastPkts / ifHCOutNUcastPkts',
|
||||
];
|
||||
|
||||
if ($name == '') {
|
||||
foreach ($definition_temp as $module => $module_def) {
|
||||
$definition_temp[$module]['module_name'] = array_shift($general_module_names);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($definition_temp) === false) {
|
||||
$definition = array_merge($definition, $definition_temp);
|
||||
}
|
||||
|
||||
// Continue with common x86 and x84 modules.
|
||||
// IfAdminStatus.
|
||||
$moduleName = $name.'ifAdminStatus';
|
||||
$definition['ifAdminStatus'] = [
|
||||
|
@ -4333,19 +4441,6 @@ class AgentWizard extends HTML
|
|||
],
|
||||
];
|
||||
|
||||
// Get x86 or x64 modules.
|
||||
if ($this->interfacesx64 === true) {
|
||||
$definitionx64 = $this->getInterfacesModulesx64($data);
|
||||
if (empty($definitionx64) === false) {
|
||||
$definition = array_merge($definition, $definitionx64);
|
||||
}
|
||||
} else {
|
||||
$definitionx86 = $this->getInterfacesModulesx86($data);
|
||||
if (empty($definitionx86) === false) {
|
||||
$definition = array_merge($definition, $definitionx86);
|
||||
}
|
||||
}
|
||||
|
||||
return $definition;
|
||||
}
|
||||
|
||||
|
@ -4815,7 +4910,7 @@ class AgentWizard extends HTML
|
|||
try {
|
||||
exec($execution, $output);
|
||||
} catch (Exception $ex) {
|
||||
$output = [ '0' => 'ERROR: Failed execution: '.(string) $ex];
|
||||
$output = ['0' => 'ERROR: Failed execution: '.(string) $ex];
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
@ -4913,7 +5008,7 @@ class AgentWizard extends HTML
|
|||
// Meta.
|
||||
var meta = "<?php echo is_metaconsole(); ?>";
|
||||
var hack_meta = '';
|
||||
if(meta){
|
||||
if (meta) {
|
||||
hack_meta = '../../';
|
||||
}
|
||||
|
||||
|
@ -4921,15 +5016,15 @@ class AgentWizard extends HTML
|
|||
showV3Form();
|
||||
|
||||
// Filter search interfaces snmp.
|
||||
$('#text-filter-search').keyup(function () {
|
||||
$('#text-filter-search').keyup(function() {
|
||||
var string = $('#text-filter-search').val();
|
||||
var regex = new RegExp(string);
|
||||
var interfaces = $('.interfaces_search');
|
||||
interfaces.each(function(){
|
||||
if(string == ''){
|
||||
interfaces.each(function() {
|
||||
if (string == '') {
|
||||
$(this).removeClass('hidden');
|
||||
} else {
|
||||
if(this.id.match(regex)) {
|
||||
if (this.id.match(regex)) {
|
||||
$(this).removeClass('hidden');
|
||||
} else {
|
||||
$(this).addClass('hidden');
|
||||
|
@ -4939,12 +5034,12 @@ class AgentWizard extends HTML
|
|||
});
|
||||
|
||||
// Loading.
|
||||
$('#submit-sub-protocol').click(function () {
|
||||
$('#submit-sub-protocol').click(function() {
|
||||
$('.wizard-result').remove();
|
||||
$('#form-create-modules').remove();
|
||||
$('.textodialogo').remove();
|
||||
$('.loading-wizard')
|
||||
.html('<center><span style="font-size:25px;">Loading...</span><img style="width:25px;heigth:25px;" src="'+hack_meta+'images/spinner.gif"></center>');
|
||||
.html('<center><span style="font-size:25px;">Loading...</span><img style="width:25px;heigth:25px;" src="' + hack_meta + 'images/spinner.gif"></center>');
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -4962,10 +5057,10 @@ class AgentWizard extends HTML
|
|||
|
||||
function showSecurityLevelForm() {
|
||||
var selector = $('#securityLevelV3').val();
|
||||
if(selector === 'authNoPriv' || selector === 'authPriv'){
|
||||
if (selector === 'authNoPriv' || selector === 'authPriv') {
|
||||
$('#txt-authMethodV3').removeClass('invisible');
|
||||
$('#txt-authPassV3').removeClass('invisible');
|
||||
if(selector === 'authPriv'){
|
||||
if (selector === 'authPriv') {
|
||||
$('#txt-privacyMethodV3').removeClass('invisible');
|
||||
$('#txt-privacyPassV3').removeClass('invisible');
|
||||
} else {
|
||||
|
@ -5015,16 +5110,13 @@ class AgentWizard extends HTML
|
|||
collision: "fit"
|
||||
},
|
||||
title: title,
|
||||
buttons: [
|
||||
{
|
||||
class:
|
||||
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
|
||||
buttons: [{
|
||||
class: "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
|
||||
text: "OK",
|
||||
click: function(e) {
|
||||
$("#msg").close();
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -5054,7 +5146,7 @@ class AgentWizard extends HTML
|
|||
});
|
||||
// Set checked.
|
||||
$("[id*=checkbox-sel_module_" + blockNumber + "]")
|
||||
.each(function(){
|
||||
.each(function() {
|
||||
$(this).prop("checked", true);
|
||||
});
|
||||
imageInfoModules.removeClass('hidden');
|
||||
|
@ -5066,15 +5158,15 @@ class AgentWizard extends HTML
|
|||
});
|
||||
// Set unchecked.
|
||||
$("[id*=checkbox-sel_module_" + blockNumber + "]")
|
||||
.each(function(){
|
||||
.each(function() {
|
||||
$(this).prop("checked", false);
|
||||
});
|
||||
imageInfoModules.addClass('hidden');
|
||||
}
|
||||
} else if (type == 'module') {
|
||||
// Getting the element.
|
||||
var thisModuleHidden = document.getElementById("hidden-module-active-"+switchName[2]+"_"+moduleNumber);
|
||||
var thisModule = $("#checkbox-sel_module_"+blockNumber+"_"+moduleNumber);
|
||||
var thisModuleHidden = document.getElementById("hidden-module-active-" + switchName[2] + "_" + moduleNumber);
|
||||
var thisModule = $("#checkbox-sel_module_" + blockNumber + "_" + moduleNumber);
|
||||
// Setting the individual field
|
||||
if (thisModule.prop('checked')) {
|
||||
thisModuleHidden.value = '1';
|
||||
|
@ -5118,7 +5210,7 @@ class AgentWizard extends HTML
|
|||
*/
|
||||
function switchBlockControlInterfaces(e) {
|
||||
var string = $('#text-filter-search').val();
|
||||
if(string == ''){
|
||||
if (string == '') {
|
||||
if (e.checked) {
|
||||
$(".interfaz_select").prop("checked", true);
|
||||
} else {
|
||||
|
@ -5127,14 +5219,14 @@ class AgentWizard extends HTML
|
|||
} else {
|
||||
var regex = new RegExp(string);
|
||||
var interfaces = $('.interfaces_search');
|
||||
interfaces.each(function(){
|
||||
if(this.id.match(regex)) {
|
||||
interfaces.each(function() {
|
||||
if (this.id.match(regex)) {
|
||||
$(this).removeClass('hidden');
|
||||
if (e.checked) {
|
||||
$("input[name='interfaz_select_"+this.id+"']")
|
||||
$("input[name='interfaz_select_" + this.id + "']")
|
||||
.prop("checked", true);
|
||||
} else {
|
||||
$("input[name='interfaz_select_"+this.id+"']")
|
||||
$("input[name='interfaz_select_" + this.id + "']")
|
||||
.prop("checked", false);
|
||||
}
|
||||
}
|
||||
|
@ -5149,7 +5241,7 @@ class AgentWizard extends HTML
|
|||
confirmDialog({
|
||||
title: "<?php echo __('Modules about to be created'); ?>",
|
||||
message: function() {
|
||||
var id = "div-"+uniqId();
|
||||
var id = "div-" + uniqId();
|
||||
var loading = "<?php echo __('Loading'); ?>" + "...";
|
||||
$.ajax({
|
||||
method: "post",
|
||||
|
@ -5165,22 +5257,22 @@ class AgentWizard extends HTML
|
|||
},
|
||||
datatype: "html",
|
||||
success: function(data) {
|
||||
$('#'+id).empty().append(data);
|
||||
$('#' + id).empty().append(data);
|
||||
},
|
||||
error: function(e) {
|
||||
showMsg(e);
|
||||
}
|
||||
});
|
||||
|
||||
return "<div id ='"+id+"'>"+loading+"</div>";
|
||||
return "<div id ='" + id + "'>" + loading + "</div>";
|
||||
},
|
||||
ok: "<?php echo __('OK'); ?>",
|
||||
cancel: "<?php echo __('Cancel'); ?>",
|
||||
onAccept: function() {
|
||||
$('#reviewed-modules').submit();
|
||||
},
|
||||
size:750,
|
||||
maxHeight:500
|
||||
size: 750,
|
||||
maxHeight: 500
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ class ConsoleSupervisor
|
|||
* NOTIF.CRON.CONFIGURED
|
||||
*/
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ((bool) enterprise_installed() === true) {
|
||||
$this->checkCronRunning();
|
||||
}
|
||||
|
||||
|
@ -212,31 +212,32 @@ class ConsoleSupervisor
|
|||
/*
|
||||
* Check if the Server and Console has
|
||||
* the same versions.
|
||||
* NOTIF.SERVER.MISALIGNED
|
||||
*/
|
||||
|
||||
$this->checkConsoleServerVersions();
|
||||
|
||||
/*
|
||||
* Check if AllowOverride is None or All.
|
||||
* NOTIF.ALLOWOVERIDE.MESSAGE
|
||||
*/
|
||||
$this->checkAllowOverrideEnabled();
|
||||
|
||||
/*
|
||||
* Check if AllowOverride is None or All.
|
||||
* NOTIF.HAMASTER.MESSAGE
|
||||
*/
|
||||
$this->checkHaStatus();
|
||||
$this->checkAllowOverrideEnabled();
|
||||
|
||||
/*
|
||||
* Check if the Pandora Console log
|
||||
* file remains in old location.
|
||||
* NOTIF.PANDORACONSOLE.LOG.OLD
|
||||
*/
|
||||
|
||||
$this->checkPandoraConsoleLogOldLocation();
|
||||
|
||||
/*
|
||||
* Check if the audit log file
|
||||
* remains in old location.
|
||||
* NOTIF.AUDIT.LOG.OLD
|
||||
*/
|
||||
|
||||
$this->checkAuditLogOldLocation();
|
||||
|
||||
}
|
||||
|
@ -432,7 +433,7 @@ class ConsoleSupervisor
|
|||
|
||||
$this->checkMinorRelease();
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if ((bool) enterprise_installed() === true) {
|
||||
// Release the lock.
|
||||
enterprise_hook('cron_supervisor_release_lock');
|
||||
}
|
||||
|
@ -463,18 +464,23 @@ class ConsoleSupervisor
|
|||
/*
|
||||
* Check if the Server and Console has
|
||||
* the same versions.
|
||||
* NOTIF.SERVER.MISALIGNED
|
||||
*/
|
||||
|
||||
$this->checkConsoleServerVersions();
|
||||
|
||||
/*
|
||||
* Check if AllowOverride is None or All.
|
||||
* NOTIF.ALLOWOVERRIDE.MESSAGE
|
||||
*/
|
||||
|
||||
$this->checkAllowOverrideEnabled();
|
||||
|
||||
/*
|
||||
* Check if HA status.
|
||||
*/
|
||||
if (enterprise_installed()) {
|
||||
|
||||
if ((bool) enterprise_installed() === true) {
|
||||
$this->checkHaStatus();
|
||||
}
|
||||
|
||||
|
@ -482,13 +488,8 @@ class ConsoleSupervisor
|
|||
* Check if the audit log file
|
||||
* remains in old location.
|
||||
*/
|
||||
|
||||
$this->checkAuditLogOldLocation();
|
||||
|
||||
/*
|
||||
Check if AllowOverride is None or All.
|
||||
*/
|
||||
$this->checkAllowOverrideEnabled();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -960,11 +961,11 @@ class ConsoleSupervisor
|
|||
{
|
||||
global $config;
|
||||
|
||||
$remote_config_dir = io_safe_output($config['remote_config']);
|
||||
$remote_config_dir = (string) io_safe_output($config['remote_config']);
|
||||
|
||||
if (enterprise_installed()
|
||||
&& isset($config['license_nms'])
|
||||
&& $config['license_nms'] != 1
|
||||
if ((bool) enterprise_installed() === true
|
||||
&& isset($config['license_nms']) === true
|
||||
&& (int) $config['license_nms'] !== 1
|
||||
) {
|
||||
if (is_readable($remote_config_dir) !== true) {
|
||||
$this->notify(
|
||||
|
@ -1200,6 +1201,8 @@ class ConsoleSupervisor
|
|||
*/
|
||||
public function checkPandoraServers()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$servers = db_get_all_rows_sql(
|
||||
'SELECT
|
||||
id_server,
|
||||
|
@ -1297,6 +1300,8 @@ class ConsoleSupervisor
|
|||
*/
|
||||
public function checkPandoraServerMasterAvailable()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$n_masters = db_get_value_sql(
|
||||
'SELECT
|
||||
count(*) as n
|
||||
|
@ -2541,7 +2546,7 @@ class ConsoleSupervisor
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Check if Pandora console log file remains in old location.
|
||||
*
|
||||
* @return void
|
||||
|
|
|
@ -547,6 +547,7 @@ class HTML
|
|||
} else {
|
||||
if ($input['arguments']['type'] != 'hidden'
|
||||
&& $input['arguments']['type'] != 'hidden_extended'
|
||||
&& $input['arguments']['type'] != 'datalist'
|
||||
) {
|
||||
if (!$direct) {
|
||||
$output .= '<li id="'.$input['id'].'" class="'.$class.'">';
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC201030';
|
||||
$build_version = 'PC201124';
|
||||
$pandora_version = 'v7.0NG.750';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -309,7 +309,7 @@ define('STATUS_ALERT_DISABLED', 'alert_disabled.png');
|
|||
// For servers.
|
||||
define('STATUS_SERVER_OK', 'server_ok.png');
|
||||
define('STATUS_SERVER_DOWN', 'server_down.png');
|
||||
|
||||
define('STATUS_SERVER_CRASH', 'server_crash.png');
|
||||
|
||||
|
||||
// Status images (ball).
|
||||
|
@ -335,6 +335,7 @@ define('STATUS_ALERT_DISABLED_BALL', 'alert_disabled_ball.png');
|
|||
// For servers.
|
||||
define('STATUS_SERVER_OK_BALL', 'server_ok_ball.png');
|
||||
define('STATUS_SERVER_DOWN_BALL', 'server_down_ball.png');
|
||||
define('STATUS_SERVER_CRASH_BALL', 'server_crash_ball.png');
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2289,13 +2289,19 @@ function check_login($output=true)
|
|||
* @param integer $id_group Agents group id to check from
|
||||
* @param string $access Access privilege
|
||||
* @param boolean $onlyOneGroup Flag to check acl for specified group only (not to roots up, or check acl for 'All' group when $id_group is 0).
|
||||
* @param boolean $cache Use cache.
|
||||
*
|
||||
* @return boolean 1 if the user has privileges, 0 if not.
|
||||
*/
|
||||
function check_acl($id_user, $id_group, $access, $onlyOneGroup=false)
|
||||
{
|
||||
function check_acl(
|
||||
$id_user,
|
||||
$id_group,
|
||||
$access,
|
||||
$onlyOneGroup=false,
|
||||
$cache=true
|
||||
) {
|
||||
if (empty($id_user)) {
|
||||
// User ID needs to be specified
|
||||
// User ID needs to be specified.
|
||||
trigger_error('Security error: check_acl got an empty string for user id', E_USER_WARNING);
|
||||
return 0;
|
||||
} else if (is_user_admin($id_user)) {
|
||||
|
@ -2305,7 +2311,15 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup=false)
|
|||
}
|
||||
|
||||
if ($id_group != 0 || $onlyOneGroup === true) {
|
||||
$groups_list_acl = users_get_groups($id_user, $access, false, true, null);
|
||||
$groups_list_acl = users_get_groups(
|
||||
$id_user,
|
||||
$access,
|
||||
false,
|
||||
true,
|
||||
null,
|
||||
'id_grupo',
|
||||
$cache
|
||||
);
|
||||
} else {
|
||||
$groups_list_acl = get_users_acl($id_user);
|
||||
}
|
||||
|
@ -2333,13 +2347,14 @@ function check_acl($id_user, $id_group, $access, $onlyOneGroup=false)
|
|||
* @param string $id_user to check the ACL
|
||||
* @param array $groups. All groups to check
|
||||
* @param string $access. Profile to check
|
||||
* @param boolean $cache Use cached group information.
|
||||
*
|
||||
* @return boolean True if at least one of this groups check the ACL
|
||||
*/
|
||||
function check_acl_one_of_groups($id_user, $groups, $access)
|
||||
function check_acl_one_of_groups($id_user, $groups, $access, $cache=true)
|
||||
{
|
||||
foreach ($groups as $group) {
|
||||
if (check_acl($id_user, $group, $access)) {
|
||||
if (check_acl($id_user, $group, $access, false, $cache)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2872,7 +2872,7 @@ function alerts_get_agent_modules(
|
|||
$agent_modules = db_get_all_rows_sql($sql);
|
||||
} else {
|
||||
$groups = groups_get_children_ids($id_grupo, true);
|
||||
if (count($groups) > 1) {
|
||||
if (empty($groups) === false) {
|
||||
$sql = sprintf(
|
||||
'SELECT distinct(atm.id_agent_module)
|
||||
FROM talert_template_modules atm
|
||||
|
|
|
@ -1553,25 +1553,17 @@ function events_get_event($id, $fields=false, $meta=false, $history=false)
|
|||
* Retrieve all events ungrouped.
|
||||
*
|
||||
* @param string $sql_post Sql_post.
|
||||
* @param integer $offset Offset.
|
||||
* @param integer $pagination Pagination.
|
||||
* @param boolean $meta Meta.
|
||||
* @param boolean $history History.
|
||||
* @param boolean $total Total.
|
||||
* @param boolean $history_db History_db.
|
||||
* @param string $order Order.
|
||||
* @param boolean $returnSql Only Query.
|
||||
*
|
||||
* @return mixed Array of events or false.
|
||||
*/
|
||||
function events_get_events_no_grouped(
|
||||
$sql_post,
|
||||
$offset=0,
|
||||
$pagination=1,
|
||||
$meta=false,
|
||||
$history=false,
|
||||
$total=false,
|
||||
$history_db=false,
|
||||
$order='ASC'
|
||||
$returnSql=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
|
@ -1581,7 +1573,11 @@ function events_get_events_no_grouped(
|
|||
$sql .= events_get_secondary_groups_left_join($table);
|
||||
$sql .= $sql_post;
|
||||
|
||||
$events = db_get_all_rows_sql($sql, $history_db);
|
||||
if ($returnSql === true) {
|
||||
return $sql;
|
||||
}
|
||||
|
||||
$events = db_get_all_rows_sql($sql, $history);
|
||||
|
||||
return $events;
|
||||
}
|
||||
|
@ -1634,29 +1630,59 @@ function events_get_events_grouped(
|
|||
$event_lj = events_get_secondary_groups_left_join($table);
|
||||
if ($total) {
|
||||
$sql = "SELECT COUNT(*) FROM (SELECT id_evento
|
||||
FROM $table te $event_lj
|
||||
WHERE 1=1 ".$sql_post.'
|
||||
FROM $table te $event_lj ".$sql_post.'
|
||||
GROUP BY estado, evento, id_agente, id_agentmodule'.$groupby_extra.') AS t';
|
||||
} else {
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento,
|
||||
GROUP_CONCAT(DISTINCT user_comment SEPARATOR '<br>') AS user_comment,
|
||||
GROUP_CONCAT(DISTINCT id_evento SEPARATOR ',') AS similar_ids,
|
||||
$sql = sprintf(
|
||||
'SELECT *,
|
||||
MAX(id_evento) AS id_evento,
|
||||
GROUP_CONCAT(
|
||||
DISTINCT user_comment SEPARATOR "<br>"
|
||||
) AS user_comment,
|
||||
GROUP_CONCAT(
|
||||
DISTINCT id_evento SEPARATOR ","
|
||||
) AS similar_ids,
|
||||
COUNT(id_evento) AS event_rep, MAX(utimestamp) AS timestamp_rep,
|
||||
MIN(utimestamp) AS timestamp_rep_min,
|
||||
(SELECT owner_user FROM $table WHERE id_evento = MAX(te.id_evento)) owner_user,
|
||||
(SELECT id_usuario FROM $table WHERE id_evento = MAX(te.id_evento)) id_usuario,
|
||||
(SELECT id_agente FROM $table WHERE id_evento = MAX(te.id_evento)) id_agente,
|
||||
(SELECT criticity FROM $table WHERE id_evento = MAX(te.id_evento)) AS criticity,
|
||||
(SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp,
|
||||
(SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = te.id_agentmodule) AS module_name
|
||||
FROM $table te $event_lj
|
||||
WHERE 1=1 ".$sql_post.'
|
||||
GROUP BY estado, evento, id_agente, id_agentmodule'.$groupby_extra;
|
||||
$sql .= ' '.events_get_sql_order($sort_field, $order, 2);
|
||||
$sql .= ' LIMIT '.$offset.','.$pagination;
|
||||
(SELECT owner_user
|
||||
FROM %s
|
||||
WHERE id_evento = MAX(te.id_evento)) AS owner_user,
|
||||
(SELECT id_usuario
|
||||
FROM %s
|
||||
WHERE id_evento = MAX(te.id_evento)) AS id_usuario,
|
||||
(SELECT id_agente
|
||||
FROM %s
|
||||
WHERE id_evento = MAX(te.id_evento)) AS id_agente,
|
||||
(SELECT criticity
|
||||
FROM %s
|
||||
WHERE id_evento = MAX(te.id_evento)) AS criticity,
|
||||
(SELECT ack_utimestamp
|
||||
FROM %s
|
||||
WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp,
|
||||
(SELECT nombre
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = te.id_agentmodule) AS module_name
|
||||
FROM %s te %s
|
||||
%s
|
||||
GROUP BY estado, evento, id_agente, id_agentmodule %s
|
||||
%s
|
||||
LIMIT %d, %d',
|
||||
$table,
|
||||
$table,
|
||||
$table,
|
||||
$table,
|
||||
$table,
|
||||
$table,
|
||||
$event_lj,
|
||||
$sql_post,
|
||||
$groupby_extra,
|
||||
events_get_sql_order($sort_field, $order, 2),
|
||||
$offset,
|
||||
$pagination
|
||||
);
|
||||
}
|
||||
|
||||
// Extract the events by filter (or not) from db
|
||||
// Extract the events by filter (or not) from db.
|
||||
$events = db_get_all_rows_sql($sql, $history_db);
|
||||
|
||||
if ($total) {
|
||||
|
@ -2971,7 +2997,8 @@ function events_get_agent(
|
|||
$type = [];
|
||||
foreach ($filter_event_type as $event_type) {
|
||||
if ($event_type != '') {
|
||||
// If normal, warning, could be several (going_up_warning, going_down_warning... too complex.
|
||||
// If normal, warning, could be several
|
||||
// (going_up_warning, going_down_warning... too complex.
|
||||
// Shown to user only "warning, critical and normal".
|
||||
if ($event_type == 'warning' || $event_type == 'critical' || $event_type == 'normal') {
|
||||
$type[] = " event_type LIKE '%".$event_type."%' ";
|
||||
|
@ -2991,10 +3018,10 @@ function events_get_agent(
|
|||
}
|
||||
|
||||
if ($events_group) {
|
||||
$sql_where .= sprintf(
|
||||
$secondary_groups = sprintf(
|
||||
' INNER JOIN tgrupo tg
|
||||
ON (te.id_grupo = tg.id_grupo AND tg.id_grupo = %s)
|
||||
OR (tg.id_grupo = tasg.id_group AND tasg.id_group = %s)
|
||||
ON (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s))
|
||||
OR (tg.id_grupo = tasg.id_group AND tasg.id_group IN (%s))
|
||||
WHERE utimestamp > %d
|
||||
AND utimestamp <= %d ',
|
||||
join(',', $id_group),
|
||||
|
@ -3002,7 +3029,11 @@ function events_get_agent(
|
|||
$datelimit,
|
||||
$date
|
||||
);
|
||||
} else if ($events_module) {
|
||||
$sql_where = $secondary_groups.' '.$sql_where;
|
||||
} else {
|
||||
$sql_where = ' WHERE 1=1 '.$sql_where;
|
||||
|
||||
if ($events_module) {
|
||||
$sql_where .= sprintf(
|
||||
' AND id_agentmodule = %d AND utimestamp > %d
|
||||
AND utimestamp <= %d ',
|
||||
|
@ -3019,6 +3050,7 @@ function events_get_agent(
|
|||
$date
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() && $id_server) {
|
||||
$sql_where .= ' AND server_id = '.$id_server;
|
||||
|
@ -3037,11 +3069,7 @@ function events_get_agent(
|
|||
} else {
|
||||
return events_get_events_no_grouped(
|
||||
$sql_where,
|
||||
0,
|
||||
1000,
|
||||
(is_metaconsole() && $id_server) ? true : false,
|
||||
false,
|
||||
false,
|
||||
$history
|
||||
);
|
||||
}
|
||||
|
@ -4673,16 +4701,24 @@ function events_page_general($event)
|
|||
$table_general->data[] = $data;
|
||||
|
||||
// If event is validated, show who and when acknowleded it.
|
||||
$table_general->cellclass[8][1] = 'general_acknowleded';
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Acknowledged by');
|
||||
|
||||
if ($event['estado'] == 1) {
|
||||
$user_ack = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
|
||||
if (empty($user_ack)) {
|
||||
$user_ack = db_get_value(
|
||||
'fullname',
|
||||
'tusuario',
|
||||
'id_user',
|
||||
$event['id_usuario']
|
||||
);
|
||||
|
||||
if (empty($user_ack) === true) {
|
||||
$user_ack = $event['id_usuario'];
|
||||
}
|
||||
|
||||
$date_ack = date($config['date_format'], $event['ack_utimestamp']);
|
||||
$date_ack = io_safe_output($event['ack_utimestamp']);
|
||||
$data[1] = $user_ack.' ('.$date_ack.')';
|
||||
} else {
|
||||
$data[1] = '<i>'.__('N/A').'</i>';
|
||||
|
|
|
@ -2541,13 +2541,9 @@ function graphic_agentaccess(
|
|||
} else {
|
||||
$options['generals']['pdf']['width'] = 350;
|
||||
$options['generals']['pdf']['height'] = 125;
|
||||
if (!empty($data_array)) {
|
||||
$imgbase64 = '<img src="data:image/jpg;base64,';
|
||||
$imgbase64 .= vbar_graph($data_array, $options, 2);
|
||||
$imgbase64 .= '" />';
|
||||
} else {
|
||||
$imgbase64 .= vbar_graph($data_array, $options, 2);
|
||||
}
|
||||
|
||||
return $imgbase64;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ function groups_check_used($idGroup)
|
|||
|
||||
if ($numRows > 0) {
|
||||
$return['return'] = true;
|
||||
$return['tables'][] = __('Recon task');
|
||||
$return['tables'][] = __('Discovery task');
|
||||
}
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
|
|
|
@ -2032,6 +2032,7 @@ function html_print_input_text_extended(
|
|||
'required',
|
||||
'autocomplete',
|
||||
'form',
|
||||
'list',
|
||||
];
|
||||
|
||||
$output = '<input '.($password ? 'type="password" autocomplete="'.$autocomplete.'" ' : 'type="text" ');
|
||||
|
@ -2257,7 +2258,8 @@ function html_print_input_text(
|
|||
$onKeyDown='',
|
||||
$formTo='',
|
||||
$onKeyUp='',
|
||||
$disabled=false
|
||||
$disabled=false,
|
||||
$list=''
|
||||
) {
|
||||
if ($maxlength == 0) {
|
||||
$maxlength = 255;
|
||||
|
@ -2302,6 +2304,10 @@ function html_print_input_text(
|
|||
$attr['form'] = $formTo;
|
||||
}
|
||||
|
||||
if ($list != '') {
|
||||
$attr['list'] = $list;
|
||||
}
|
||||
|
||||
return html_print_input_text_extended(
|
||||
$name,
|
||||
$value,
|
||||
|
@ -4234,7 +4240,9 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
((isset($data['autofocus']) === true) ? $data['autofocus'] : false),
|
||||
((isset($data['onKeyDown']) === true) ? $data['onKeyDown'] : ''),
|
||||
((isset($data['form']) === true) ? $data['form'] : ''),
|
||||
((isset($data['onKeyUp']) === true) ? $data['onKeyUp'] : '')
|
||||
((isset($data['onKeyUp']) === true) ? $data['onKeyUp'] : ''),
|
||||
((isset($data['disabled']) === true) ? $data['disabled'] : false),
|
||||
((isset($data['list']) === true) ? $data['list'] : '')
|
||||
);
|
||||
break;
|
||||
|
||||
|
@ -4731,6 +4739,14 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
$output .= html_print_select_multiple_modules_filtered($data);
|
||||
break;
|
||||
|
||||
case 'datalist':
|
||||
$output .= html_print_datalist(
|
||||
$data['name'],
|
||||
$data['value'],
|
||||
((isset($data['return']) === true) ? $data['return'] : true)
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Ignore.
|
||||
break;
|
||||
|
@ -4911,3 +4927,32 @@ function html_print_tabs(array $tabs)
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a datalist.
|
||||
*
|
||||
* @param string $id Use custom id.
|
||||
* @param string $values Input values.
|
||||
* @param string $returnparam Whether to return an output string or echo now (optional, echo by default).
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
function html_print_datalist(
|
||||
$id,
|
||||
$values,
|
||||
$return=false
|
||||
) {
|
||||
$result = '<datalist id="'.$id.'">';
|
||||
foreach ($values as $key => $value) {
|
||||
$result .= '<option value="'.$value.'">';
|
||||
}
|
||||
|
||||
$result .= '</datalist>';
|
||||
|
||||
if ($return) {
|
||||
return $result;
|
||||
} else {
|
||||
echo $result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,6 +116,13 @@ function io_safe_input($value)
|
|||
// TICKET: 1223
|
||||
$valueHtmlEncode = str_replace('°', '°', $valueHtmlEncode);
|
||||
|
||||
// Fixed the ¿ charater.
|
||||
$valueHtmlEncode = str_replace('¿', '¿', $valueHtmlEncode);
|
||||
// Fixed the ¡ charater.
|
||||
$valueHtmlEncode = str_replace('¡', '¡', $valueHtmlEncode);
|
||||
// Fixed the € charater.
|
||||
$valueHtmlEncode = str_replace('€', '€', $valueHtmlEncode);
|
||||
|
||||
// Replace some characteres for html entities
|
||||
for ($i = 0; $i < 33; $i++) {
|
||||
$valueHtmlEncode = str_ireplace(
|
||||
|
|
|
@ -2494,6 +2494,8 @@ function modules_get_color_status($status, $force_module=false)
|
|||
case STATUS_AGENT_CRITICAL:
|
||||
case STATUS_MODULE_CRITICAL_BALL:
|
||||
case STATUS_AGENT_CRITICAL_BALL:
|
||||
case STATUS_SERVER_CRASH:
|
||||
case STATUS_SERVER_CRASH_BALL:
|
||||
return COL_CRITICAL;
|
||||
|
||||
case AGENT_MODULE_STATUS_WARNING:
|
||||
|
|
|
@ -2957,7 +2957,7 @@ function reporting_group_report($report, $content)
|
|||
if (empty($id_group)) {
|
||||
$events = [];
|
||||
} else {
|
||||
$sql_where = sprintf(' AND id_grupo IN (%s) AND estado<>1 ', implode(',', $id_group));
|
||||
$sql_where = sprintf(' WHERE id_grupo IN (%s) AND estado<>1 ', implode(',', $id_group));
|
||||
$events = events_get_events_grouped(
|
||||
$sql_where,
|
||||
0,
|
||||
|
|
|
@ -1492,7 +1492,7 @@ function reporting_html_inventory_changes($table, $item, $pdf=0)
|
|||
function reporting_html_inventory($table, $item, $pdf=0)
|
||||
{
|
||||
$return_pdf = '';
|
||||
if (!empty($item['failed'])) {
|
||||
if (empty($item['failed']) === false) {
|
||||
if ($pdf === 0) {
|
||||
$table->colspan['failed']['cell'] = 3;
|
||||
$table->cellstyle['failed']['cell'] = 'text-align: center;';
|
||||
|
@ -1501,55 +1501,71 @@ function reporting_html_inventory($table, $item, $pdf=0)
|
|||
$return_pdf .= $item['failed'];
|
||||
}
|
||||
} else {
|
||||
foreach ($item['data'] as $module_item) {
|
||||
// Grouped type inventory.
|
||||
$type_modules = array_reduce(
|
||||
$item['data'],
|
||||
function ($carry, $it) {
|
||||
$carry[$it['name']][] = $it;
|
||||
return $carry;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
if (isset($type_modules) === true
|
||||
&& is_array($type_modules) === true
|
||||
) {
|
||||
foreach ($type_modules as $key_type_module => $type_module) {
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '99%';
|
||||
|
||||
$first = reset($module_item['data']);
|
||||
$count_columns = count($first);
|
||||
|
||||
$table1->cellstyle[0][0] = 'background: #373737; color: #FFF;';
|
||||
$table1->data[0][0] = $module_item['agent_name'];
|
||||
if ($count_columns == 1) {
|
||||
$table1->colspan[0][0] = ($count_columns + 1);
|
||||
} else {
|
||||
$table1->colspan[0][0] = $count_columns;
|
||||
$table1->data = [];
|
||||
$table1->head = [];
|
||||
$table1->cellstyle = [];
|
||||
$table1->headstyle = [];
|
||||
if (isset($type_module) === true
|
||||
&& is_array($type_module) === true
|
||||
) {
|
||||
foreach ($type_module as $key_type => $module) {
|
||||
if (isset($module['data']) === true
|
||||
&& is_array($module['data']) === true
|
||||
) {
|
||||
array_pop($module['data']);
|
||||
foreach ($module['data'] as $k_module => $v_module) {
|
||||
$str_key = $key_type_module.'-'.$key_type.'-'.$k_module;
|
||||
$table1->head[0] = __('Agent');
|
||||
$table1->head[1] = __('Module');
|
||||
$table1->head[2] = __('Date');
|
||||
$table1->headstyle[0] = 'text-align: left';
|
||||
$table1->headstyle[1] = 'text-align: left';
|
||||
$table1->headstyle[2] = 'text-align: left';
|
||||
$table1->cellstyle[$str_key][0] = 'text-align: left;';
|
||||
$table1->cellstyle[$str_key][1] = 'text-align: left;';
|
||||
$table1->cellstyle[$str_key][2] = 'text-align: left;';
|
||||
$table1->data[$str_key][0] = $module['agent_name'];
|
||||
$table1->data[$str_key][1] = $key_type_module;
|
||||
$dateModule = explode(' ', $module['timestamp']);
|
||||
$table1->data[$str_key][2] = $dateModule[0];
|
||||
if (isset($v_module) === true
|
||||
&& is_array($v_module) === true
|
||||
) {
|
||||
foreach ($v_module as $k => $v) {
|
||||
$table1->head[$k] = $k;
|
||||
$table1->headstyle[$k] = 'text-align: left';
|
||||
$table1->cellstyle[$str_key][$k] = 'text-align: left;';
|
||||
$table1->data[$str_key][$k] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$table1->cellstyle[1][0] = 'background: #373737; color: #FFF;';
|
||||
$table1->cellstyle[1][1] = 'background: #373737; color: #FFF;';
|
||||
$table1->data[1][0] = $module_item['name'];
|
||||
if (($count_columns - 1) > 0) {
|
||||
$table1->colspan[1][0] = ($count_columns - 1);
|
||||
}
|
||||
|
||||
$table1->data[1][1] = $module_item['timestamp'];
|
||||
|
||||
$table1->cellstyle[2] = array_pad(
|
||||
[],
|
||||
$count_columns,
|
||||
'background: #373737; color: #FFF;'
|
||||
);
|
||||
$table1->data[2] = array_keys($first);
|
||||
if (($count_columns - 1) == 0) {
|
||||
$table1->colspan[2][0] = ($count_columns + 1);
|
||||
}
|
||||
|
||||
$table1->data = array_merge(
|
||||
$table1->data,
|
||||
$module_item['data']
|
||||
);
|
||||
|
||||
if ($pdf === 0) {
|
||||
$table->colspan[$module_item['name'].'_'.$module_item['id_agente']]['cell'] = 3;
|
||||
$table->data[$module_item['name'].'_'.$module_item['id_agente']]['cell'] = html_print_table(
|
||||
$table->colspan[$key_type_module]['cell'] = 3;
|
||||
$table->data[$key_type_module]['cell'] = html_print_table(
|
||||
$table1,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$table1->title = $item['title'];
|
||||
$table1->titleclass = 'title_table_pdf';
|
||||
$table1->titlestyle = 'text-align:left;';
|
||||
$return_pdf .= html_print_table(
|
||||
$table1,
|
||||
true
|
||||
|
@ -1557,6 +1573,7 @@ function reporting_html_inventory($table, $item, $pdf=0)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($pdf !== 0) {
|
||||
return $return_pdf;
|
||||
|
|
|
@ -537,15 +537,30 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
|
||||
// Check all groups
|
||||
$groups = agents_get_all_groups_agent($id_agente, $agent['id_grupo']);
|
||||
if (! check_acl_one_of_groups($config['id_user'], $groups, 'AR') && ! check_acl_one_of_groups($config['id_user'], $groups, 'AW') && !$is_extra) {
|
||||
|
||||
if (is_metaconsole()) {
|
||||
if (! check_acl_one_of_groups($config['id_user'], $groups, 'AR', false)
|
||||
&& ! check_acl_one_of_groups($config['id_user'], $groups, 'AW', false)
|
||||
) {
|
||||
$grants_on_node = false;
|
||||
} else {
|
||||
$grants_on_node = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
if (! check_acl_one_of_groups($config['id_user'], $groups, 'AR', false)
|
||||
&& ! check_acl_one_of_groups($config['id_user'], $groups, 'AW', false)
|
||||
&& !$is_extra
|
||||
) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access Agent General Information'
|
||||
);
|
||||
include_once 'general/noaccess.php';
|
||||
if (!empty($server_data) && is_metaconsole()) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -586,7 +601,11 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
$hashdata = md5($hashdata);
|
||||
$url = $server_data['server_url'].'/index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$agent['id_agente'].'&'.'loginhash=auto&'."loginhash_data=$hashdata&".'loginhash_user='.str_rot13($user);
|
||||
|
||||
if ($grants_on_node) {
|
||||
$cellName .= '<a href="'.$url.'">'.'<b><span style="font-weight:bold;text-transform:uppercase;" title="'.$agent['nombre'].'">'.$agent['alias'].'</span></b></a>';
|
||||
} else {
|
||||
$cellName .= '<b><span style="font-weight:bold;text-transform:uppercase;" title="'.$agent['nombre'].'">'.$agent['alias'].'</span></b>';
|
||||
}
|
||||
} else {
|
||||
$url = ui_get_full_url(
|
||||
'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente']
|
||||
|
@ -802,7 +821,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
$events_graph = '<div style="width: 100%; height: 90px; display: flex; flex-direction: row; justify-content: center;">';
|
||||
$events_graph .= graph_graphic_agentevents(
|
||||
$id_agente,
|
||||
'385px;',
|
||||
'340px;margin:0',
|
||||
45,
|
||||
SECONDS_1DAY,
|
||||
'',
|
||||
|
|
|
@ -2041,6 +2041,10 @@ function ui_pagination(
|
|||
'disable_user',
|
||||
'delete_user',
|
||||
];
|
||||
|
||||
// Check if url has   blankspace and replace it.
|
||||
preg_replace('/\ /', '%20', $url);
|
||||
|
||||
$url = explode('&', $url);
|
||||
|
||||
$finalUrl = [];
|
||||
|
@ -2118,7 +2122,7 @@ function ui_pagination(
|
|||
$output .= "<a class='pagination-arrows ".$other_class." offset_0'
|
||||
href='javascript: ".$script_modified.";'>".html_print_image('images/go_first_g.png', true, ['class' => 'bot']).'</a>';
|
||||
} else {
|
||||
$output .= "<a class='pagination-arrows ".$other_class." offset_0' href='".$url.'&'.$offset_name."=0'>".html_print_image('images/go_first_g.png', true, ['class' => 'bot']).'</a>';
|
||||
$output .= "<a class='pagination-arrows ".$other_class." offset_0' href='".io_safe_output($url).'&'.$offset_name."=0'>".html_print_image('images/go_first_g.png', true, ['class' => 'bot']).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2762,6 +2766,7 @@ function get_shape_status_set($type)
|
|||
// Small squares.
|
||||
case STATUS_SERVER_OK:
|
||||
case STATUS_SERVER_DOWN:
|
||||
case STATUS_SERVER_CRASH:
|
||||
$return = ['class' => 'status_small_squares'];
|
||||
break;
|
||||
|
||||
|
@ -2773,6 +2778,9 @@ function get_shape_status_set($type)
|
|||
case STATUS_AGENT_OK_BALL:
|
||||
case STATUS_AGENT_NO_DATA_BALL:
|
||||
case STATUS_AGENT_NO_MONITORS_BALL:
|
||||
case STATUS_SERVER_OK_BALL:
|
||||
case STATUS_SERVER_DOWN_BALL:
|
||||
case STATUS_SERVER_CRASH_BALL:
|
||||
$return = ['class' => 'status_balls'];
|
||||
break;
|
||||
|
||||
|
@ -4005,7 +4013,7 @@ function ui_get_url_refresh($params=false, $relative=true, $add_post=true)
|
|||
$url .= $key.'['.$k.']='.$v.'&';
|
||||
}
|
||||
} else {
|
||||
$url .= $key.'='.io_safe_input($value).'&';
|
||||
$url .= $key.'='.io_safe_input(rawurlencode($value)).'&';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6124,3 +6132,29 @@ function ui_print_message_dialog($title, $text, $id='', $img='', $text_button=''
|
|||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a button for reveal the content of the password field.
|
||||
*
|
||||
* @param string $name Name of the field.
|
||||
* @param boolean $return If true, return the string with the formed element.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function ui_print_reveal_password(string $name, bool $return=false)
|
||||
{
|
||||
if (is_metaconsole()) {
|
||||
$imagePath = '../../images/';
|
||||
} else {
|
||||
$imagePath = 'images/';
|
||||
}
|
||||
|
||||
$output = ' <img class="clickable forced_title" id="reveal_password_'.$name.'" src="'.$imagePath.'eye_show.png" onclick="reveal_password(\''.$name.'\')" data-use_title_for_force_title="1" data-title="'.__('Show password').'">';
|
||||
|
||||
if ($return === true) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
echo $output;
|
||||
}
|
||||
|
|
|
@ -73,6 +73,24 @@ function update_manager_verify_trial()
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the trial license is not expired.
|
||||
*
|
||||
* @return boolean true if the trial license is expired, false otherwise.
|
||||
*/
|
||||
function update_manager_verify_license_expired()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$current_date = date('Ymd');
|
||||
if (isset($config['license_expiry_date']) && $current_date >= $config['license_expiry_date']) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parses responses from configuration wizard.
|
||||
*
|
||||
|
@ -454,13 +472,20 @@ function registration_wiz_process()
|
|||
function registration_wiz_modal(
|
||||
$return=false,
|
||||
$launch=true,
|
||||
$callback=false
|
||||
$callback=false,
|
||||
$return_message=false
|
||||
) {
|
||||
global $config;
|
||||
$output = '';
|
||||
|
||||
// Do not show the wizard for trial licenses.
|
||||
if (update_manager_verify_trial()) {
|
||||
ui_print_info_message('Your license is trial. Please contact Artica at info@artica.es for a valid license', '', $return_message);
|
||||
return '';
|
||||
}
|
||||
|
||||
if (update_manager_verify_license_expired()) {
|
||||
ui_print_error_message('The license has expired. Please contact Artica at info@artica.es', '', $return_message);
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
|
@ -230,21 +230,6 @@ function pandoraFlotPieCustom(
|
|||
);
|
||||
}
|
||||
var legends = $("#" + graph_id + " .legendLabel");
|
||||
var j = 0;
|
||||
legends.each(function() {
|
||||
//$(this).css("width", $(this).width());
|
||||
$(this).css("font-size", font_size + "pt");
|
||||
$(this).removeClass("legendLabel");
|
||||
$(this).addClass(font);
|
||||
$(this).text(legend[j]);
|
||||
j++;
|
||||
});
|
||||
|
||||
if ($('input[name="custom_graph"]').val()) {
|
||||
$(".legend>div").css("right", $(".legend>div").height() * -1);
|
||||
$(".legend>table").css("right", $(".legend>div").height() * -1);
|
||||
}
|
||||
//$('.legend>table').css('border',"1px solid #E2E2E2");
|
||||
|
||||
if (background_color == "transparent") {
|
||||
$(".legend>table").css("background-color", "");
|
||||
|
|
|
@ -346,13 +346,7 @@ function menu_graph(
|
|||
$threshold = true;
|
||||
}
|
||||
|
||||
$return .= "<div id='general_menu_$graph_id' class='menu_graph' style='
|
||||
width: 20px;
|
||||
height: 150px;
|
||||
left:100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
background-color: tranparent;'>";
|
||||
$return .= "<div id='general_menu_$graph_id' class='menu_graph'>";
|
||||
$return .= "<div id='menu_$graph_id' "."style='display: none; ".'text-align: center;'.'position: relative;'."border-bottom: 0px;'>
|
||||
<a href='javascript:'><img id='menu_cancelzoom_$graph_id' src='".$params['homeurl']."images/zoom_cross_grey.disabled.png' alt='".__('Cancel zoom')."' title='".__('Cancel zoom')."'></a>";
|
||||
if ($threshold) {
|
||||
|
@ -745,13 +739,12 @@ function flot_slicesbar_graph(
|
|||
|
||||
// Set some containers to legend, graph, timestamp tooltip, etc.
|
||||
$height = ((int) $height + 15);
|
||||
if ($stat_win) {
|
||||
$return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'%; height: '.$height."px; display: inline-block;'></div>";
|
||||
} else {
|
||||
$return = "<div id='$graph_id' class='noresizevc graph $adapt_key' style='width: ".$width.'%; height: '.$height."px;'></div>";
|
||||
}
|
||||
|
||||
$return .= "<div id='value_$graph_id' style='display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px'></div>";
|
||||
$style = 'width:'.$width.'%;';
|
||||
$style .= 'height:'.$height.'px;';
|
||||
$return = "<div id='".$graph_id."' class='noresizevc graph ".$adapt_key."' style='".$style."'></div>";
|
||||
|
||||
$return .= "<div id='value_".$graph_id."' style='display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px'></div>";
|
||||
|
||||
// Set a weird separator to serialize and unserialize
|
||||
// passing data from php to javascript.
|
||||
|
|
|
@ -0,0 +1,170 @@
|
|||
/**
|
||||
* -------------------------------------
|
||||
* Connection Check
|
||||
* --------------------------------------
|
||||
*/
|
||||
|
||||
checkConnection(1);
|
||||
|
||||
/**
|
||||
* Performs connection tests every minutes and add connection listeners
|
||||
* @param {integer} time in minutes
|
||||
*/
|
||||
|
||||
function checkConnection(minutes) {
|
||||
var cicle = minutes * 60 * 1000;
|
||||
var checkConnection = setInterval(handleConnection, cicle);
|
||||
|
||||
// Connection listeters.
|
||||
window.addEventListener("online", handleConnection);
|
||||
window.addEventListener("offline", handleConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle connection status test.
|
||||
*
|
||||
* Test conectivity with server and shows modal message.
|
||||
*/
|
||||
function handleConnection() {
|
||||
var connected;
|
||||
var msg = "online";
|
||||
|
||||
if (navigator.onLine) {
|
||||
isReachable(getServerUrl())
|
||||
.then(function(online) {
|
||||
if (online) {
|
||||
// handle online status
|
||||
connected = true;
|
||||
showConnectionMessage(connected, msg);
|
||||
} else {
|
||||
connected = false;
|
||||
msg = "No connectivity with server";
|
||||
showConnectionMessage(connected, msg);
|
||||
}
|
||||
})
|
||||
.catch(function(err) {
|
||||
connected = false;
|
||||
msg = err;
|
||||
showConnectionMessage(connected, msg);
|
||||
});
|
||||
} else {
|
||||
// handle offline status
|
||||
connected = false;
|
||||
msg = "Connection offline";
|
||||
showConnectionMessage(connected, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test server reachibilty and get response.
|
||||
*
|
||||
* @param {String} url
|
||||
*
|
||||
* Return {promise}
|
||||
*/
|
||||
function isReachable(url) {
|
||||
/**
|
||||
* Note: fetch() still "succeeds" for 404s on subdirectories,
|
||||
* which is ok when only testing for domain reachability.
|
||||
*
|
||||
* Example:
|
||||
* https://google.com/noexist does not throw
|
||||
* https://noexist.com/noexist does throw
|
||||
*/
|
||||
return fetch(url, { method: "HEAD", mode: "no-cors" })
|
||||
.then(function(resp) {
|
||||
return resp && (resp.ok || resp.type === "opaque");
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.warn("[conn test failure]:", error);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets server origin url
|
||||
*/
|
||||
function getServerUrl() {
|
||||
var server_url;
|
||||
|
||||
server_url = window.location.origin;
|
||||
|
||||
return server_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows or hide connection infoMessage.
|
||||
*
|
||||
* @param {bool} conn
|
||||
* @param {string} msg
|
||||
*/
|
||||
function showConnectionMessage(conn = true, msg = "") {
|
||||
var data = {};
|
||||
if (conn) {
|
||||
$("div#message_dialog_connection")
|
||||
.closest(".ui-dialog-content")
|
||||
.dialog("close");
|
||||
} else {
|
||||
data.title = "Connection with server has been lost";
|
||||
data.text = "Connection status: " + msg;
|
||||
|
||||
infoMessage(data, "message_dialog_connection");
|
||||
}
|
||||
}
|
||||
|
||||
function infoMessage(data, idMsg) {
|
||||
var title = data.title;
|
||||
var err_messge = data.text;
|
||||
|
||||
if (idMsg == null) {
|
||||
idMsg = uniqId();
|
||||
}
|
||||
|
||||
if ($("#" + idMsg).length === 0) {
|
||||
$("body").append('<div title="' + title + '" id="' + idMsg + '"></div>');
|
||||
$("#" + idMsg).empty();
|
||||
}
|
||||
|
||||
$("#err_msg").empty();
|
||||
$("#err_msg").html("\n\n" + err_messge);
|
||||
|
||||
$("#" + idMsg)
|
||||
.dialog({
|
||||
height: 250,
|
||||
width: 528,
|
||||
opacity: 1,
|
||||
modal: true,
|
||||
position: {
|
||||
my: "center",
|
||||
at: "center",
|
||||
of: window,
|
||||
collision: "fit"
|
||||
},
|
||||
title: data.title,
|
||||
buttons: [
|
||||
{
|
||||
class:
|
||||
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
|
||||
text: "Retry",
|
||||
click: function(e) {
|
||||
handleConnection();
|
||||
}
|
||||
},
|
||||
{
|
||||
class:
|
||||
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-cancel",
|
||||
text: "Close",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
open: function(event, ui) {
|
||||
$(".ui-widget-overlay").addClass("error-modal-opened");
|
||||
},
|
||||
close: function(event, ui) {
|
||||
$(".ui-widget-overlay").removeClass("error-modal-opened");
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
|
@ -1930,120 +1930,3 @@ function ajaxRequest(id, settings) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* -------------------------------------
|
||||
* Connection Check
|
||||
* --------------------------------------
|
||||
*/
|
||||
|
||||
checkConnection(1);
|
||||
|
||||
/**
|
||||
* Performs connection tests every minutes and add connection listeners
|
||||
* @param {integer} time in minutes
|
||||
*/
|
||||
|
||||
function checkConnection(minutes) {
|
||||
var cicle = minutes * 60 * 1000;
|
||||
var checkConnection = setInterval(handleConnection, cicle);
|
||||
|
||||
// Connection listeters.
|
||||
window.addEventListener("online", handleConnection);
|
||||
window.addEventListener("offline", handleConnection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle connection status test.
|
||||
*
|
||||
* Test conectivity with server and shows modal message.
|
||||
*/
|
||||
function handleConnection() {
|
||||
var connected;
|
||||
var msg = "online";
|
||||
|
||||
if (navigator.onLine) {
|
||||
isReachable(getServerUrl())
|
||||
.then(function(online) {
|
||||
if (online) {
|
||||
// handle online status
|
||||
connected = true;
|
||||
showConnectionMessage(connected, msg);
|
||||
} else {
|
||||
connected = false;
|
||||
msg = "No connectivity with server";
|
||||
showConnectionMessage(connected, msg);
|
||||
}
|
||||
})
|
||||
.catch(function(err) {
|
||||
connected = false;
|
||||
msg = err;
|
||||
showConnectionMessage(connected, msg);
|
||||
});
|
||||
} else {
|
||||
// handle offline status
|
||||
connected = false;
|
||||
msg = "Connection offline";
|
||||
showConnectionMessage(connected, msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test server reachibilty and get response.
|
||||
*
|
||||
* @param {String} url
|
||||
*
|
||||
* Return {promise}
|
||||
*/
|
||||
function isReachable(url) {
|
||||
/**
|
||||
* Note: fetch() still "succeeds" for 404s on subdirectories,
|
||||
* which is ok when only testing for domain reachability.
|
||||
*
|
||||
* Example:
|
||||
* https://google.com/noexist does not throw
|
||||
* https://noexist.com/noexist does throw
|
||||
*/
|
||||
return fetch(url, { method: "HEAD", mode: "no-cors" })
|
||||
.then(function(resp) {
|
||||
return resp && (resp.ok || resp.type === "opaque");
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.warn("[conn test failure]:", error);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets server origin url
|
||||
*/
|
||||
function getServerUrl() {
|
||||
var server_url;
|
||||
|
||||
try {
|
||||
server_url = get_php_value("homeurl");
|
||||
} catch (SyntaxError) {
|
||||
console.warn("Pandora homeurl cannot be found.");
|
||||
server_url = $("#hidden-homeurl").val();
|
||||
}
|
||||
return server_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows or hide connection infoMessage.
|
||||
*
|
||||
* @param {bool} conn
|
||||
* @param {string} msg
|
||||
*/
|
||||
function showConnectionMessage(conn = true, msg = "") {
|
||||
var data = {};
|
||||
if (conn) {
|
||||
$("div#message_dialog_connection")
|
||||
.closest(".ui-dialog-content")
|
||||
.dialog("close");
|
||||
} else {
|
||||
data.title = "Connection with server has been lost";
|
||||
data.text = "Connection status: " + msg;
|
||||
|
||||
infoMessage(data, "message_dialog_connection");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,7 +453,6 @@ function perform_response_massive(response, response_id, out_iterator) {
|
|||
// Change the status of an event to new, in process or validated.
|
||||
function event_change_status(event_ids) {
|
||||
var new_status = $("#estado").val();
|
||||
var event_id = $("#hidden-id_event").val();
|
||||
var meta = $("#hidden-meta").val();
|
||||
var history = $("#hidden-history").val();
|
||||
|
||||
|
@ -472,7 +471,7 @@ function event_change_status(event_ids) {
|
|||
type: "POST",
|
||||
url: $("#hidden-ajax_file").val(),
|
||||
async: true,
|
||||
dataType: "html",
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#button-status_button").removeAttr("disabled");
|
||||
$("#response_loading").hide();
|
||||
|
@ -485,11 +484,20 @@ function event_change_status(event_ids) {
|
|||
$("#notification_status_error").hide();
|
||||
}
|
||||
|
||||
if (data == "status_ok") {
|
||||
if (data.status == "status_ok") {
|
||||
if (typeof dt_events !== "undefined") {
|
||||
dt_events.draw(false);
|
||||
}
|
||||
$("#notification_status_success").show();
|
||||
if (new_status == 1) {
|
||||
$("#extended_event_general_page table td.general_acknowleded").text(
|
||||
data.user
|
||||
);
|
||||
} else {
|
||||
$("#extended_event_general_page table td.general_acknowleded").text(
|
||||
"N/A"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$("#notification_status_error").show();
|
||||
}
|
||||
|
@ -942,7 +950,6 @@ function execute_event_response(event_list_btn) {
|
|||
});
|
||||
break;
|
||||
case "delete_selected":
|
||||
console.log($(this));
|
||||
$(".chk_val:checked").each(function() {
|
||||
execute_delete_event_reponse(
|
||||
dt_events,
|
||||
|
|
|
@ -552,3 +552,23 @@ function infoMessage(data, idMsg) {
|
|||
})
|
||||
.show();
|
||||
}
|
||||
|
||||
function reveal_password(name) {
|
||||
var passwordElement = $("#password-" + name);
|
||||
var revealElement = $("#reveal_password_" + name);
|
||||
var imagesPath = "";
|
||||
|
||||
if ($("#hidden-metaconsole_activated").val() == 1) {
|
||||
imagesPath = "../../images/";
|
||||
} else {
|
||||
imagesPath = "images/";
|
||||
}
|
||||
|
||||
if (passwordElement.attr("type") == "password") {
|
||||
passwordElement.attr("type", "text");
|
||||
revealElement.attr("src", imagesPath + "eye_hide.png");
|
||||
} else {
|
||||
passwordElement.attr("type", "password");
|
||||
revealElement.attr("src", imagesPath + "eye_show.png");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
/*global $, _*/
|
||||
|
||||
var TreeController = {
|
||||
controllers: [],
|
||||
getController: function() {
|
||||
|
@ -38,12 +40,35 @@ var TreeController = {
|
|||
return;
|
||||
}
|
||||
|
||||
function _recursiveGroupsCount(elements, childGroupsLength) {
|
||||
if (typeof childGroupsLength === "undefined") {
|
||||
childGroupsLength = 0;
|
||||
}
|
||||
|
||||
_.each(elements, function(element) {
|
||||
if (typeof element.children !== "undefined") {
|
||||
childGroupsLength = _recursiveGroupsCount(
|
||||
element.children,
|
||||
childGroupsLength
|
||||
);
|
||||
childGroupsLength += element.children.length;
|
||||
}
|
||||
});
|
||||
return childGroupsLength;
|
||||
}
|
||||
|
||||
// Load branch
|
||||
function _processGroup(container, elements, rootGroup) {
|
||||
var $group = $("<ul></ul>");
|
||||
var childGroupsLength = _recursiveGroupsCount(elements);
|
||||
|
||||
// First group
|
||||
// First group.
|
||||
if (typeof rootGroup != "undefined" && rootGroup == true) {
|
||||
var messageLength = controller.tree.length;
|
||||
if (childGroupsLength > 0) {
|
||||
messageLength = childGroupsLength + controller.tree.length;
|
||||
}
|
||||
|
||||
$group
|
||||
.addClass("tree-root")
|
||||
.hide()
|
||||
|
@ -54,13 +79,12 @@ var TreeController = {
|
|||
'images/pandora.png" />' +
|
||||
"<span class='margin-left-1'>" +
|
||||
(controller.tree.length > 0
|
||||
? controller.foundMessage + ": " + controller.tree.length
|
||||
? controller.foundMessage + ": " + messageLength
|
||||
: "") +
|
||||
"</div>"
|
||||
);
|
||||
}
|
||||
// Normal group
|
||||
else {
|
||||
} else {
|
||||
// Normal group.
|
||||
$group.addClass("tree-group").hide();
|
||||
}
|
||||
|
||||
|
|
|
@ -64,14 +64,23 @@ function pandora_session_close()
|
|||
function pandora_session_read($session_id)
|
||||
{
|
||||
$session_id = addslashes($session_id);
|
||||
$session_data = db_get_value(
|
||||
'data',
|
||||
'tsessions_php',
|
||||
'id_session',
|
||||
|
||||
// Do not use SQL cache here.
|
||||
$session_data = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT data
|
||||
FROM `tsessions_php` WHERE id_session="%s"',
|
||||
$session_id
|
||||
),
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
if (!empty($session_data)) {
|
||||
if (is_array($session_data) === true) {
|
||||
$session_data = $session_data[0]['data'];
|
||||
}
|
||||
|
||||
if (empty($session_data) === false) {
|
||||
return $session_data;
|
||||
} else {
|
||||
return '';
|
||||
|
@ -90,7 +99,6 @@ function pandora_session_read($session_id)
|
|||
function pandora_session_write($session_id, $data)
|
||||
{
|
||||
$session_id = addslashes($session_id);
|
||||
|
||||
if (is_ajax()) {
|
||||
// Avoid session upadte while processing ajax responses - notifications.
|
||||
if (get_parameter('check_new_notifications', false)) {
|
||||
|
@ -101,18 +109,22 @@ function pandora_session_write($session_id, $data)
|
|||
$values = [];
|
||||
$values['last_active'] = time();
|
||||
|
||||
if (!empty($data)) {
|
||||
if (empty($data) === false) {
|
||||
$values['data'] = addslashes($data);
|
||||
}
|
||||
|
||||
$session_exists = (bool) db_get_value(
|
||||
'COUNT(id_session)',
|
||||
'tsessions_php',
|
||||
'id_session',
|
||||
// Do not use SQL cache here.
|
||||
$session_exists = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT id_session
|
||||
FROM `tsessions_php` WHERE id_session="%s"',
|
||||
$session_id
|
||||
),
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
if (!$session_exists) {
|
||||
if ($session_exists === false) {
|
||||
$values['id_session'] = $session_id;
|
||||
$retval_write = db_process_sql_insert('tsessions_php', $values);
|
||||
} else {
|
||||
|
@ -198,11 +210,69 @@ function pandora_session_gc($max_lifetime=300)
|
|||
}
|
||||
|
||||
|
||||
$result_handler = session_set_save_handler(
|
||||
/**
|
||||
* Enables custom session handlers.
|
||||
*
|
||||
* @return boolean Context changed or not.
|
||||
*/
|
||||
function enable_session_handlers()
|
||||
{
|
||||
global $config;
|
||||
|
||||
if ($config['_using_pandora_sessionhandlers'] !== true) {
|
||||
if (session_status() !== PHP_SESSION_NONE) {
|
||||
// Close previous version.
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
$sesion_handler = session_set_save_handler(
|
||||
'pandora_session_open',
|
||||
'pandora_session_close',
|
||||
'pandora_session_read',
|
||||
'pandora_session_write',
|
||||
'pandora_session_destroy',
|
||||
'pandora_session_gc'
|
||||
);
|
||||
);
|
||||
|
||||
session_start();
|
||||
|
||||
// Restore previous session.
|
||||
$config['_using_pandora_sessionhandlers'] = true;
|
||||
return $sesion_handler;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Disables custom session handlers.
|
||||
*
|
||||
* @param string|null $id_session Force swap to target session.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function disable_session_handlers($id_session=null)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (session_status() !== PHP_SESSION_NONE) {
|
||||
// Close previous version.
|
||||
session_write_close();
|
||||
}
|
||||
|
||||
$ss = new SessionHandler();
|
||||
session_set_save_handler($ss, true);
|
||||
|
||||
if ($id_session !== null) {
|
||||
session_id($id_session);
|
||||
}
|
||||
|
||||
session_start();
|
||||
|
||||
$config['_using_pandora_sessionhandlers'] = false;
|
||||
}
|
||||
|
||||
|
||||
// Always enable session handler.
|
||||
$result_handler = enable_session_handlers();
|
||||
|
|
|
@ -462,6 +462,10 @@ select:-internal-list-box {
|
|||
width: 120px;
|
||||
max-width: 120px;
|
||||
}
|
||||
.w200px {
|
||||
width: 200px;
|
||||
max-width: 200px;
|
||||
}
|
||||
.w240px {
|
||||
width: 240px;
|
||||
max-width: 240px;
|
||||
|
@ -3074,6 +3078,12 @@ div#stat-win-module-graph div.nodata_container {
|
|||
}
|
||||
|
||||
.menu_graph {
|
||||
width: 30px;
|
||||
height: 150px;
|
||||
left: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
background-color: transparent;
|
||||
-moz-border-top-right-radius: 6px;
|
||||
-webkit-border-top-right-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
|
@ -5866,7 +5876,7 @@ table.table_modal_alternate tr td:first-child {
|
|||
}
|
||||
|
||||
.flot-text {
|
||||
width: 101%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*Font header feedback*/
|
||||
|
|
|
@ -222,7 +222,7 @@ echo '<head>'."\n";
|
|||
ob_start('ui_process_page_head');
|
||||
|
||||
// Enterprise main.
|
||||
enterprise_include('index.php');
|
||||
enterprise_include_once('index.php');
|
||||
|
||||
echo '<script type="text/javascript">';
|
||||
echo 'var dispositivo = navigator.userAgent.toLowerCase();';
|
||||
|
@ -273,6 +273,7 @@ if (strlen($search) > 0) {
|
|||
}
|
||||
|
||||
// Login process.
|
||||
enterprise_include_once('include/auth/saml.php');
|
||||
if (! isset($config['id_user'])) {
|
||||
// Clear error messages.
|
||||
unset($_COOKIE['errormsg']);
|
||||
|
@ -395,24 +396,33 @@ if (! isset($config['id_user'])) {
|
|||
$nick_in_db = $_SESSION['prepared_login_da']['id_user'];
|
||||
$expired_pass = false;
|
||||
} else if (($config['auth'] == 'saml') && ($login_button_saml)) {
|
||||
$saml_configured = include_once $config['homedir'].'/'.ENTERPRISE_DIR.'/include/auth/saml.php';
|
||||
|
||||
if (!$saml_configured) {
|
||||
include_once 'general/noaccesssaml.php';
|
||||
}
|
||||
|
||||
$saml_user_id = saml_process_user_login();
|
||||
|
||||
$saml_user_id = enterprise_hook('saml_process_user_login');
|
||||
if (!$saml_user_id) {
|
||||
include_once 'general/noaccesssaml.php';
|
||||
$login_failed = true;
|
||||
include_once 'general/login_page.php';
|
||||
while (@ob_end_flush()) {
|
||||
// Dumping...
|
||||
continue;
|
||||
}
|
||||
|
||||
exit('</html>');
|
||||
}
|
||||
|
||||
$nick_in_db = $saml_user_id;
|
||||
if (!$nick_in_db) {
|
||||
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
|
||||
$as = new SimpleSAML_Auth_Simple($config['saml_source']);
|
||||
$as->logout();
|
||||
if ($config['auth'] === 'saml') {
|
||||
enterprise_hook('saml_logout');
|
||||
}
|
||||
|
||||
if (session_status() !== PHP_SESSION_NONE) {
|
||||
$_SESSION = [];
|
||||
session_destroy();
|
||||
header_remove('Set-Cookie');
|
||||
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
||||
}
|
||||
|
||||
// Process logout.
|
||||
include 'general/logoff.php';
|
||||
}
|
||||
} else {
|
||||
// process_user_login is a virtual function which should be defined in each auth file.
|
||||
|
@ -735,7 +745,7 @@ if (! isset($config['id_user'])) {
|
|||
|
||||
exit('</html>');
|
||||
}
|
||||
} else {
|
||||
} else if (isset($_GET['bye']) === false) {
|
||||
// There is no user connected.
|
||||
if ($config['enterprise_installed']) {
|
||||
enterprise_include_once('include/functions_reset_pass.php');
|
||||
|
@ -750,7 +760,17 @@ if (! isset($config['id_user'])) {
|
|||
$pass2 = get_parameter_post('pass2');
|
||||
$id_user = get_parameter_post('id_user');
|
||||
|
||||
if ($correct_pass_change && !empty($pass1) && !empty($pass2) && !empty($id_user)) {
|
||||
if ($reset_hash != '') {
|
||||
$hash_data = explode(':::', $reset_hash);
|
||||
$id_user = $hash_data[0];
|
||||
$codified_hash = $hash_data[1];
|
||||
|
||||
$db_reset_pass_entry = db_get_value_filter('reset_time', 'treset_pass', ['id_user' => $id_user, 'cod_hash' => $id_user.':::'.$codified_hash]);
|
||||
}
|
||||
|
||||
if ($correct_pass_change && !empty($pass1) && !empty($pass2) && !empty($id_user) && $db_reset_pass_entry) {
|
||||
delete_reset_pass_entry($id_user);
|
||||
|
||||
$correct_reset_pass_process = '';
|
||||
$process_error_message = '';
|
||||
|
||||
|
@ -787,21 +807,14 @@ if (! isset($config['id_user'])) {
|
|||
include_once 'general/login_page.php';
|
||||
} else {
|
||||
if ($reset_hash != '') {
|
||||
$hash_data = explode(':::', $reset_hash);
|
||||
$id_user = $hash_data[0];
|
||||
$codified_hash = $hash_data[1];
|
||||
|
||||
$db_reset_pass_entry = db_get_value_filter('reset_time', 'treset_pass', ['id_user' => $id_user, 'cod_hash' => $id_user.':::'.$codified_hash]);
|
||||
$process_error_message = '';
|
||||
|
||||
if ($db_reset_pass_entry) {
|
||||
if (($db_reset_pass_entry + SECONDS_2HOUR) < time()) {
|
||||
register_pass_change_try($id_user, 0);
|
||||
$process_error_message = __('Too much time since password change request');
|
||||
delete_reset_pass_entry($id_user);
|
||||
include_once 'general/login_page.php';
|
||||
} else {
|
||||
delete_reset_pass_entry($id_user);
|
||||
include_once 'enterprise/include/process_reset_pass.php';
|
||||
}
|
||||
} else {
|
||||
|
@ -950,6 +963,10 @@ if (! isset($config['id_user'])) {
|
|||
}
|
||||
|
||||
exit('</html>');
|
||||
} else {
|
||||
if ($config['auth'] === 'saml') {
|
||||
enterprise_hook('saml_login_status_verifier');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -961,19 +978,19 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
|||
|
||||
// Log off.
|
||||
if (isset($_GET['bye'])) {
|
||||
include 'general/logoff.php';
|
||||
$iduser = $_SESSION['id_usuario'];
|
||||
|
||||
if ($config['auth'] === 'saml') {
|
||||
enterprise_hook('saml_logout');
|
||||
}
|
||||
|
||||
$_SESSION = [];
|
||||
session_destroy();
|
||||
header_remove('Set-Cookie');
|
||||
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
||||
|
||||
if ($config['auth'] == 'saml') {
|
||||
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
|
||||
$as = new SimpleSAML_Auth_Simple('PandoraFMS');
|
||||
$as->logout();
|
||||
}
|
||||
// Process logout.
|
||||
include 'general/logoff.php';
|
||||
|
||||
while (@ob_end_flush()) {
|
||||
// Dumping...
|
||||
|
@ -1252,8 +1269,8 @@ echo '</div>';
|
|||
echo '<div id="um_msg_receiver">';
|
||||
echo '</div>';
|
||||
|
||||
|
||||
// Connection lost alert.
|
||||
ui_require_javascript_file('connection_check');
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.750';
|
||||
$build = '201030';
|
||||
$build = '201124';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -731,7 +731,7 @@ class Events
|
|||
$system = System::getInstance();
|
||||
|
||||
// --------------Fill the SQL POST-------------------------------
|
||||
$sql_post = '';
|
||||
$sql_post = ' WHERE 1=1 ';
|
||||
|
||||
switch ($this->status) {
|
||||
case 0:
|
||||
|
|
|
@ -313,7 +313,7 @@ if ($not_found) {
|
|||
$table->data[6][1] = html_print_input_text('scale_z', $scale_z, '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true);
|
||||
|
||||
$table->data['source'][0] = __('Source');
|
||||
$table->data['source'][1] = html_print_radio_button('source', 'group', __('Group'), $source, true, $disabled_source).html_print_radio_button('source', 'recon_task', __('Recon task'), $source, true, $disabled_source).html_print_radio_button('source', 'ip_mask', __('CIDR IP mask'), $source, true, $disabled_source);
|
||||
$table->data['source'][1] = html_print_radio_button('source', 'group', __('Group'), $source, true, $disabled_source).html_print_radio_button('source', 'recon_task', __('Discovery task'), $source, true, $disabled_source).html_print_radio_button('source', 'ip_mask', __('CIDR IP mask'), $source, true, $disabled_source);
|
||||
|
||||
$table->data['source_data_recon_task'][0] = __('Source from recon task');
|
||||
$table->data['source_data_recon_task'][0] .= ui_print_help_tip(
|
||||
|
|
|
@ -35,6 +35,7 @@ require_once $config['homedir'].'/include/functions_graph.php';
|
|||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
require_once $config['homedir'].'/include/functions_tags.php';
|
||||
require_once $config['homedir'].'/include/php_to_js_values.php';
|
||||
enterprise_include_once('include/functions_agents.php');
|
||||
|
||||
check_login();
|
||||
|
@ -85,6 +86,7 @@ ui_require_css_file('register', 'include/styles/', true);
|
|||
// Connection lost alert.
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_require_javascript_file('connection_check');
|
||||
ui_print_message_dialog(
|
||||
$conn_title,
|
||||
$conn_text,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
|
||||
|
||||
// This file is an example on how things must NEVER be done.
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
||||
|
@ -41,7 +40,7 @@ if (! defined('METACONSOLE')) {
|
|||
|
||||
$buttons['fields'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=view&sec2=operation/agentes/status_monitor&section=fields">'.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'</a>',
|
||||
'text' => '<a href="index.php?sec=view&sec2=operation/agentes/status_monitor§ion=fields">'.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'</a>',
|
||||
'operation' => true,
|
||||
];
|
||||
|
||||
|
@ -79,6 +78,11 @@ if (! defined('METACONSOLE')) {
|
|||
ui_meta_print_header(__('Monitor view'));
|
||||
}
|
||||
|
||||
$recursion = get_parameter_switch('recursion', false);
|
||||
if ($recursion === false) {
|
||||
$recursion = get_parameter('recursion', false);
|
||||
}
|
||||
|
||||
$ag_freestring = (string) get_parameter('ag_freestring');
|
||||
$moduletype = (string) get_parameter('moduletype');
|
||||
$datatype = (string) get_parameter('datatype');
|
||||
|
@ -89,10 +93,10 @@ $status = (int) get_parameter('status', 4);
|
|||
$modulegroup = (int) get_parameter('modulegroup', -1);
|
||||
$tag_filter = (int) get_parameter('tag_filter', 0);
|
||||
$min_hours_status = (string) get_parameter('min_hours_status', '');
|
||||
// Sort functionality
|
||||
// Sort functionality.
|
||||
$sortField = get_parameter('sort_field');
|
||||
$sort = get_parameter('sort', 'none');
|
||||
// When the previous page was a visualmap and show only one module
|
||||
// When the previous page was a visualmap and show only one module.
|
||||
$id_module = (int) get_parameter('id_module', 0);
|
||||
$ag_custom_fields = (array) get_parameter('ag_custom_fields', []);
|
||||
$module_option = (int) get_parameter('module_option', 1);
|
||||
|
@ -161,11 +165,22 @@ if (is_numeric($ag_group)) {
|
|||
// Agent group selector
|
||||
if (!is_metaconsole()) {
|
||||
if ($ag_group > 0 && check_acl($config['id_user'], $ag_group, 'AR')) {
|
||||
if ($recursion) {
|
||||
$all_groups = groups_get_children_ids($ag_group, true);
|
||||
|
||||
// User has explicit permission on group 1 ?
|
||||
$sql_conditions_group = sprintf(
|
||||
' AND (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s)) ',
|
||||
implode(',', $all_groups),
|
||||
implode(',', $all_groups)
|
||||
);
|
||||
} else {
|
||||
$sql_conditions_group = sprintf(
|
||||
' AND (tagente.id_grupo = %d OR tasg.id_group = %d)',
|
||||
$ag_group,
|
||||
$ag_group
|
||||
);
|
||||
}
|
||||
} else if ($user_groups != '') {
|
||||
// User has explicit permission on group 1 ?
|
||||
$sql_conditions_group = ' AND (
|
||||
|
@ -175,11 +190,22 @@ if (!is_metaconsole()) {
|
|||
}
|
||||
} else {
|
||||
if (((int) $ag_group !== 0) && (check_acl($config['id_user'], $id_ag_group, 'AR'))) {
|
||||
if ($recursion) {
|
||||
$all_groups = groups_get_children_ids($ag_group, true);
|
||||
|
||||
// User has explicit permission on group 1 ?
|
||||
$sql_conditions_group = sprintf(
|
||||
' AND (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s)) ',
|
||||
implode(',', $all_groups),
|
||||
implode(',', $all_groups)
|
||||
);
|
||||
} else {
|
||||
$sql_conditions_group = sprintf(
|
||||
' AND (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))',
|
||||
$ag_group,
|
||||
$ag_group
|
||||
);
|
||||
}
|
||||
} else if ($user_groups != '') {
|
||||
// User has explicit permission on group 1 ?
|
||||
$sql_conditions_group = ' AND (
|
||||
|
@ -355,7 +381,8 @@ $table->style[3] = 'font-weight: bold;';
|
|||
$table->style[4] = 'font-weight: bold;';
|
||||
|
||||
$table->data[0][0] = __('Group');
|
||||
$table->data[0][1] = html_print_select_groups(
|
||||
$table->data[0][1] = '<div class="flex flex-row-vcenter w290px"><div class="w200px">';
|
||||
$table->data[0][1] .= html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'AR',
|
||||
true,
|
||||
|
@ -375,6 +402,18 @@ $table->data[0][1] = html_print_select_groups(
|
|||
'id_grupo',
|
||||
false
|
||||
);
|
||||
$table->data[0][1] .= '</div><div>';
|
||||
$table->data[0][1] .= html_print_input(
|
||||
[
|
||||
'type' => 'checkbox',
|
||||
'name' => 'recursion',
|
||||
'return' => true,
|
||||
'checked' => $recursion,
|
||||
'value' => 1,
|
||||
]
|
||||
);
|
||||
$table->data[0][1] .= __('Recursion');
|
||||
$table->data[0][1] .= '</div></div>';
|
||||
|
||||
$fields = [];
|
||||
$fields[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
|
||||
|
@ -701,8 +740,7 @@ foreach ($custom_fields as $custom_field) {
|
|||
$table_custom_fields->data[] = $row;
|
||||
}
|
||||
|
||||
|
||||
$filters = '<form method="post" action="index.php?sec=view&sec2=operation/agentes/status_monitor&refr='.$refr.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&module_option='.$module_option.'&ag_modulename='.$ag_modulename.'&moduletype='.$moduletype.'&datatype='.$datatype.'&status='.$status.'&sort_field='.$sortField.'&sort='.$sort.'&pure='.$config['pure'].$ag_custom_fields_params.'">';
|
||||
$filters = '<form method="post" action="index.php?sec=view&sec2=operation/agentes/status_monitor&refr='.$refr.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&module_option='.$module_option.'&ag_modulename='.$ag_modulename.'&moduletype='.$moduletype.'&datatype='.$datatype.'&status='.$status.'&sort_field='.$sortField.'&sort='.$sort.'&pure='.$config['pure'].$ag_custom_fields_params.'">';
|
||||
if (is_metaconsole()) {
|
||||
$table->colspan[4][0] = 7;
|
||||
$table->cellstyle[4][0] = 'padding: 10px;';
|
||||
|
@ -1014,6 +1052,7 @@ $sql = 'SELECT
|
|||
ORDER BY '.$order['field'].' '.$order['order'].'
|
||||
LIMIT '.$offset.','.$limit_sql;
|
||||
|
||||
|
||||
// We do not show the modules until the user searches with the filter
|
||||
if ($autosearch) {
|
||||
if (! defined('METACONSOLE')) {
|
||||
|
@ -1102,17 +1141,51 @@ if (($config['dbtype'] == 'oracle') && ($result !== false)) {
|
|||
|
||||
|
||||
// Urls to sort the table.
|
||||
$url_agent_name = 'index.php?sec=view&sec2=operation/agentes/status_monitor&refr='.$refr.'&datatype='.$datatype.'&moduletype='.$moduletype.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=agent_alias&sort=';
|
||||
$url_type = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=type&sort=';
|
||||
$url_module_name = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=module_name&sort=';
|
||||
$url_server_type = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=moduletype&sort=';
|
||||
$url_interval = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=interval&sort=';
|
||||
$url_status = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=status&sort=';
|
||||
$url_status = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=last_status_change&sort=';
|
||||
$url_data = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=data&sort=';
|
||||
$url_timestamp_up = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=timestamp&sort=up';
|
||||
$url_timestamp_down = 'index.php?sec=view&sec2=operation/agentes/status_monitor&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params.'&sort_field=timestamp&sort=down';
|
||||
$url_agent_name = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_type = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_module_name = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_server_type = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_interval = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_status = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_status = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_data = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_timestamp_up = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
$url_timestamp_down = 'index.php?sec=view&sec2=operation/agentes/status_monitor';
|
||||
|
||||
$url_agent_name .= '&refr='.$refr.'&datatype='.$datatype.'&moduletype='.$moduletype.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_type .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_module_name .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_server_type .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_interval .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_status .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_status .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_data .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_timestamp_up .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
$url_timestamp_down .= '&datatype='.$datatype.'&moduletype='.$moduletype.'&refr='.$refr.'&modulegroup='.$modulegroup.'&offset='.$offset.'&ag_group='.$ag_group.'&ag_freestring='.$ag_freestring.'&ag_modulename='.$ag_modulename.'&status='.$status.$ag_custom_fields_params;
|
||||
|
||||
// Holy god...
|
||||
$url_agent_name .= '&recursion='.$recursion;
|
||||
$url_type .= '&recursion='.$recursion;
|
||||
$url_module_name .= '&recursion='.$recursion;
|
||||
$url_server_type .= '&recursion='.$recursion;
|
||||
$url_interval .= '&recursion='.$recursion;
|
||||
$url_status .= '&recursion='.$recursion;
|
||||
$url_status .= '&recursion='.$recursion;
|
||||
$url_data .= '&recursion='.$recursion;
|
||||
$url_timestamp_up .= '&recursion='.$recursion;
|
||||
$url_timestamp_down .= '&recursion='.$recursion;
|
||||
|
||||
|
||||
$url_agent_name .= '&sort_field=agent_alias&sort=';
|
||||
$url_type .= '&sort_field=type&sort=';
|
||||
$url_module_name .= '&sort_field=module_name&sort=';
|
||||
$url_server_type .= '&sort_field=moduletype&sort=';
|
||||
$url_interval .= '&sort_field=interval&sort=';
|
||||
$url_status .= '&sort_field=status&sort=';
|
||||
$url_status .= '&sort_field=last_status_change&sort=';
|
||||
$url_data .= '&sort_field=data&sort=';
|
||||
$url_timestamp_up .= '&sort_field=timestamp&sort=up';
|
||||
$url_timestamp_down .= '&sort_field=timestamp&sort=down';
|
||||
|
||||
// Start Build List Result
|
||||
if (!empty($result)) {
|
||||
|
@ -1276,9 +1349,9 @@ if (!empty($result)) {
|
|||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$data[0] = '<a href="?sec=gmodules&sec2=advanced/policymanager&id='.$policyInfo['id_policy'].'">'.html_print_image($img, true, ['title' => $title]).'</a>';
|
||||
$data[0] = '<a href="?sec=gmodules&sec2=advanced/policymanager&id='.$policyInfo['id_policy'].'">'.html_print_image($img, true, ['title' => $title]).'</a>';
|
||||
} else {
|
||||
$data[0] = '<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&id='.$policyInfo['id_policy'].'">'.html_print_image($img, true, ['title' => $title]).'</a>';
|
||||
$data[0] = '<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&id='.$policyInfo['id_policy'].'">'.html_print_image($img, true, ['title' => $title]).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1293,7 +1366,7 @@ if (!empty($result)) {
|
|||
|
||||
// TODO: Calculate hash access before to use it more simply like other sections. I.E. Events view
|
||||
if (defined('METACONSOLE')) {
|
||||
$agent_link = '<a href="'.$row['server_url'].'index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$row['id_agent'].'&'.'loginhash=auto&'.'loginhash_data='.$row['hashdata'].'&'.'loginhash_user='.str_rot13($row['user']).'">';
|
||||
$agent_link = '<a href="'.$row['server_url'].'index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$row['id_agent'].'&'.'loginhash=auto&'.'loginhash_data='.$row['hashdata'].'&'.'loginhash_user='.str_rot13($row['user']).'">';
|
||||
$agent_alias = ui_print_truncate_text(
|
||||
$agent_alias,
|
||||
'agent_small',
|
||||
|
@ -1309,7 +1382,7 @@ if (!empty($result)) {
|
|||
$data[1] = $agent_alias;
|
||||
}
|
||||
} else {
|
||||
$data[1] = '<strong><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agent'].'">';
|
||||
$data[1] = '<strong><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agent'].'">';
|
||||
$data[1] .= ui_print_truncate_text($agent_alias, 'agent_medium', false, true, false, '[…]', 'font-size:7.5pt;');
|
||||
$data[1] .= '</a></strong>';
|
||||
}
|
||||
|
@ -1325,9 +1398,9 @@ if (!empty($result)) {
|
|||
$show_edit_icon = false;
|
||||
}
|
||||
|
||||
$url_edit_module = $row['server_url'].'index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1'.'&loginhash=auto&loginhash_data='.$row['hashdata'].'&loginhash_user='.str_rot13($row['user']);
|
||||
$url_edit_module = $row['server_url'].'index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1'.'&loginhash=auto&loginhash_data='.$row['hashdata'].'&loginhash_user='.str_rot13($row['user']);
|
||||
} else {
|
||||
$url_edit_module = 'index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1';
|
||||
$url_edit_module = 'index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1';
|
||||
}
|
||||
|
||||
if ($show_edit_icon) {
|
||||
|
@ -1750,24 +1823,13 @@ if (!empty($result)) {
|
|||
|
||||
// End Build List Result.
|
||||
echo "<div id='monitor_details_window'></div>";
|
||||
// Strict user hidden.
|
||||
echo '<div id="strict_hidden" style="display:none;">';
|
||||
html_print_input_text('strict_user_hidden', $strict_user);
|
||||
echo '</div>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
||||
ui_require_javascript_file('pandora_modules');
|
||||
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
$(document).ready (function () {
|
||||
if ($('#ag_group').val() != 0) {
|
||||
$('#tag_filter').css('display', 'none');
|
||||
$('#tag_td').css('display', 'none');
|
||||
}
|
||||
});
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#moduletype').click(function() {
|
||||
jQuery.get (
|
||||
|
@ -1789,17 +1851,6 @@ $('#moduletype').click(function() {
|
|||
return false;
|
||||
});
|
||||
|
||||
$('#ag_group').change (function () {
|
||||
strict_user = $('#text-strict_user_hidden').val();
|
||||
|
||||
if (($('#ag_group').val() != 0) && (strict_user != 0)) {
|
||||
$('#tag_filter').css('display', 'none');
|
||||
$('#tag_td').css('display', 'none');
|
||||
} else {
|
||||
$('#tag_filter').css('display', '');
|
||||
$('#tag_td').css('display', '');
|
||||
}
|
||||
});
|
||||
|
||||
function toggle_full_value(id) {
|
||||
text = $('#hidden_value_module_' + id).html();
|
||||
|
|
|
@ -444,7 +444,7 @@ $user_filter = db_get_row_sql(
|
|||
)
|
||||
);
|
||||
|
||||
// Do not load the user filter if we come from the 24h event graph
|
||||
// Do not load the user filter if we come from the 24h event graph.
|
||||
$from_event_graph = get_parameter('filter[from_event_graph]', $filter['from_event_graph']);
|
||||
if ($user_filter !== false && $from_event_graph != 1) {
|
||||
$filter = events_get_event_filter($user_filter['id_filter']);
|
||||
|
@ -457,6 +457,13 @@ if ($user_filter !== false && $from_event_graph != 1) {
|
|||
$text_agent = $filter['text_agent'];
|
||||
$id_agent = $filter['id_agent'];
|
||||
$id_agent_module = $filter['id_agent_module'];
|
||||
$text_module = io_safe_output(
|
||||
db_get_value_filter(
|
||||
'nombre',
|
||||
'tagente_modulo',
|
||||
['id_agente_modulo' => $filter['id_agent_module']]
|
||||
)
|
||||
);
|
||||
$pagination = $filter['pagination'];
|
||||
$event_view_hr = $filter['event_view_hr'];
|
||||
$id_user_ack = $filter['id_user_ack'];
|
||||
|
@ -893,13 +900,17 @@ if (is_metaconsole() !== true) {
|
|||
*/
|
||||
|
||||
// Group.
|
||||
if ($id_group_filter === null) {
|
||||
$id_group_filter = 0;
|
||||
}
|
||||
|
||||
$data = html_print_input(
|
||||
[
|
||||
'name' => 'id_group_filter',
|
||||
'returnAllGroup' => true,
|
||||
'privilege' => 'AR',
|
||||
'type' => 'select_groups',
|
||||
'selected' => (defined($id_group_filter) ? $id_group_filter : 0),
|
||||
'selected' => $id_group_filter,
|
||||
'nothing' => false,
|
||||
'return' => true,
|
||||
'size' => '80%',
|
||||
|
@ -2019,6 +2030,9 @@ function process_datatables_item(item) {
|
|||
|
||||
/* Group name */
|
||||
if (item.id_grupo == "0") {
|
||||
var severity_value = "<?php echo $severity; ?>";
|
||||
const multiple = severity_value.split(",");
|
||||
$("#severity").val(multiple);
|
||||
item.id_grupo = "<?php echo __('All'); ?>";
|
||||
} else {
|
||||
item.id_grupo = item.group_name;
|
||||
|
@ -2343,8 +2357,7 @@ $(document).ready( function() {
|
|||
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
|
||||
data: {
|
||||
page: 'include/ajax/events',
|
||||
load_filter_modal: 1,
|
||||
current_filter: $('#latest_filter_id').val()
|
||||
load_filter_modal: 1
|
||||
},
|
||||
success: function (data){
|
||||
$('#load-modal-filter')
|
||||
|
|
|
@ -311,7 +311,7 @@ if ($user_filter != 0 && empty($id_name) && !$update_from_filter_table) {
|
|||
}
|
||||
|
||||
// Build the condition of the events query.
|
||||
$sql_post = '';
|
||||
$sql_post = ' WHERE 1=1 ';
|
||||
|
||||
$id_user = $config['id_user'];
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ if ($group_rep == 0) {
|
|||
$sql = 'SELECT COUNT(DISTINCT id_evento)
|
||||
FROM $event_table te
|
||||
$event_lj
|
||||
WHERE 1=1 $sql_post';
|
||||
$sql_post';
|
||||
$total_events = (int) db_get_sql($sql);
|
||||
} else if ($group_rep == 1) {
|
||||
$total_events = events_get_events_grouped(
|
||||
|
@ -1477,7 +1477,8 @@ $(document).ready( function() {
|
|||
$("#text-id_extra").val(val);
|
||||
if (i == 'user_comment')
|
||||
$("#text-user_comment").val(val);
|
||||
|
||||
if (i == 'module_search')
|
||||
$("#text-module_search").val(val);
|
||||
if(i == 'id_source_event')
|
||||
$("#text-id_source_event").val(val);
|
||||
}
|
||||
|
|
|
@ -61,6 +61,13 @@ echo '</head>';
|
|||
echo "<body style='background-color: #494949; max-width: 550px; max-height: 400px; margin-top:40px;'>";
|
||||
echo "<h1 class='modalheaderh1'>".__('Sound console').'</h1>';
|
||||
|
||||
// Connection lost alert.
|
||||
ui_require_css_file('register', 'include/styles/', true);
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_require_javascript_file('connection_check');
|
||||
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
|
||||
|
||||
$table = new StdClass;
|
||||
$table->width = '100%';
|
||||
$table->styleTable = 'padding-left:16px; padding-right:16px; padding-top:16px;';
|
||||
|
@ -77,7 +84,7 @@ $table->data[0][2] = __('Type');
|
|||
$table->data[0][3] = html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();').__('Alert fired').'<br />'.html_print_checkbox('critical', 'critical', true, true, false, 'changeType();').__('Monitor critical').'<br />'.html_print_checkbox('unknown', 'unknown', true, true, false, 'changeType();').__('Monitor unknown').'<br />'.html_print_checkbox('warning', 'warning', true, true, false, 'changeType();').__('Monitor warning').'<br />';
|
||||
|
||||
$table->data[1][0] = __('Agent');
|
||||
$table->data[1][1] = html_print_select($agents, 'id_agents[]', true, false, '', '', true, true, '', '', '', 'width:120px; height:100px', '', false, '', '', true);
|
||||
$table->data[1][1] = html_print_select($agents, 'id_agents[]', true, false, '', '', true, true, '', '', '', 'max-width:200px; height:100px', '', false, '', '', true);
|
||||
|
||||
$table->data[1][2] = __('Event');
|
||||
$table->data[1][3] = html_print_textarea('events_fired', 200, 20, '', 'readonly="readonly" style="max-height:100px; background: #ddd; resize:none;"', true);
|
||||
|
@ -152,10 +159,26 @@ function changeGroup() {
|
|||
}
|
||||
|
||||
function changeType() {
|
||||
alert_fired = $("input[name=alert_fired]").attr('checked');
|
||||
critical = $("input[name=critical]").attr('checked');
|
||||
warning = $("input[name=warning]").attr('checked');
|
||||
unknown = $("input[name=unknown]").attr('checked');
|
||||
alert_fired = false;
|
||||
critical = false;
|
||||
warning = false;
|
||||
unknown = false;
|
||||
|
||||
if($("input[name=alert_fired]").is(':checked') ) {
|
||||
alert_fired = true;
|
||||
}
|
||||
|
||||
if($("input[name=critical]").is(':checked') ) {
|
||||
critical = true;
|
||||
}
|
||||
|
||||
if($("input[name=warning]").is(':checked') ) {
|
||||
warning = true;
|
||||
}
|
||||
|
||||
if($("input[name=unknown]").is(':checked') ) {
|
||||
unknown = true;
|
||||
}
|
||||
}
|
||||
|
||||
function toggleButton() {
|
||||
|
@ -256,9 +279,6 @@ $(document).ready (function () {
|
|||
setInterval("check_event()", (10 * 1000)); //10 seconds between ajax request
|
||||
$("#table1").css("background-color", "#fff");
|
||||
$("#table2").css("background-color", "#fff");
|
||||
|
||||
group_width = $("#group").width();
|
||||
$("#id_agents").width(group_width + 9);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -273,8 +273,10 @@ if ($layers != false) {
|
|||
gis_activate_ajax_refresh($layers, $timestampLastOperation, 1, $idMap);
|
||||
|
||||
// Connection lost alert.
|
||||
ui_require_css_file('register', 'include/styles/', true);
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_require_javascript_file('connection_check');
|
||||
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
|
||||
}
|
||||
|
||||
|
|
|
@ -294,8 +294,6 @@ enterprise_hook('close_meta_frame');
|
|||
|
||||
$(".loading_tree").show();
|
||||
|
||||
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = "include/ajax/tree.ajax";
|
||||
parameters['getChildren'] = 1;
|
||||
|
@ -339,13 +337,35 @@ enterprise_hook('close_meta_frame');
|
|||
success: function(data) {
|
||||
if (data.success) {
|
||||
$(".loading_tree").hide();
|
||||
var foundMessage = '';
|
||||
switch (parameters['type']) {
|
||||
case 'policies':
|
||||
foundMessage = "<?php echo __('Policies found'); ?>";
|
||||
break;
|
||||
case 'os':
|
||||
foundMessage = "<?php echo __('Operating systems found'); ?>";
|
||||
break;
|
||||
case 'tag':
|
||||
foundMessage = "<?php echo __('Tags found'); ?>";
|
||||
break;
|
||||
case 'module_group':
|
||||
foundMessage = "<?php echo __('Module Groups found'); ?>";
|
||||
break;
|
||||
case 'module':
|
||||
foundMessage = "<?php echo __('Modules found'); ?>";
|
||||
break;
|
||||
case 'group':
|
||||
default:
|
||||
foundMessage = "<?php echo __('Groups found'); ?>";
|
||||
break;
|
||||
}
|
||||
|
||||
treeController.init({
|
||||
recipient: $("div#tree-controller-recipient"),
|
||||
detailRecipient: $.fixedBottomBox({ width: 400, height: window.innerHeight * 0.9 }),
|
||||
page: parameters['page'],
|
||||
emptyMessage: "<?php echo __('No data found'); ?>",
|
||||
foundMessage: "<?php echo __('Groups found'); ?>",
|
||||
foundMessage: foundMessage,
|
||||
tree: data.tree,
|
||||
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
|
||||
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
|
|
|
@ -48,6 +48,7 @@ html_print_input_hidden('homeurl', $config['homeurl']);
|
|||
$url_css_modal = ui_get_full_url('include/styles/register.css', false, false, false);
|
||||
echo '<link rel="stylesheet" href="'.$url_css_modal.'" type="text/css" />';
|
||||
// Connection lost alert.
|
||||
ui_require_javascript_file('connection_check', 'include/javascript/', true);
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
|
||||
|
@ -157,10 +158,6 @@ echo '<div style="display: none;" id="qrcode_container" title="'.__('QR code of
|
|||
echo '<div id="qrcode_container_image"></div>';
|
||||
echo '</div>';
|
||||
|
||||
// Connection lost alert.
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_print_message_alert($conn_title, $conn_text, 'connection', '/images/error_1.png');
|
||||
|
||||
ui_require_jquery_file('countdown', 'include/javascript/', true);
|
||||
ui_require_javascript_file('wz_jsgraphics', 'include/javascript/', true);
|
||||
|
|
|
@ -29,11 +29,10 @@ if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) {
|
|||
require_once $config['homedir'].'/vendor/autoload.php';
|
||||
|
||||
ui_require_css_file('visual_maps');
|
||||
ui_require_css_file('register');
|
||||
|
||||
html_print_input_hidden('homeurl', $config['homeurl']);
|
||||
ui_require_css_file('register', 'include/styles/', true);
|
||||
|
||||
// Connection lost alert.
|
||||
ui_require_javascript_file('connection_check', 'include/javascript/', true);
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
|
||||
|
@ -140,10 +139,6 @@ echo '<div style="display: none;" id="qrcode_container" title="'.__('QR code of
|
|||
echo '<div id="qrcode_container_image"></div>';
|
||||
echo '</div>';
|
||||
|
||||
// Connection lost alert.
|
||||
$conn_title = __('Connection with server has been lost');
|
||||
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
|
||||
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/error_1.png');
|
||||
|
||||
// Check groups can access user.
|
||||
$aclUserGroups = [];
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.750
|
||||
%define release 201030
|
||||
%define release 201124
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.750
|
||||
%define release 201030
|
||||
%define release 201124
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.750
|
||||
%define release 201030
|
||||
%define release 201124
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.750-201030
|
||||
Version: 7.0NG.750-201124
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.750-201030"
|
||||
pandora_version="7.0NG.750-201124"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -771,7 +771,7 @@ sub main() {
|
|||
die("Server thread crashed.") unless (check_server_threads() == 1);
|
||||
|
||||
db_do ($DBH,
|
||||
"UPDATE tserver SET status = 0
|
||||
"UPDATE tserver SET status = -1
|
||||
WHERE UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(keepalive) > 2*server_keepalive"
|
||||
);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.750";
|
||||
my $pandora_build = "201030";
|
||||
my $pandora_build = "201124";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -498,7 +498,7 @@ sub exec_network_module ($$$$) {
|
|||
$module_data = pandora_ping_latency ($pa_config, $ip_target, $timeout, $retries);
|
||||
|
||||
if (defined($module_data)) {
|
||||
$module_result = 0; # Successful
|
||||
$module_result = 1; # Unsuccessful
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.750";
|
||||
my $pandora_build = "201030";
|
||||
my $pandora_build = "201124";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -856,6 +856,24 @@ sub clean_blank {
|
|||
return $input;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Erase blank spaces before and after the string
|
||||
################################################################################
|
||||
sub trim {
|
||||
my $string = shift;
|
||||
if (is_empty($string)){
|
||||
return "";
|
||||
}
|
||||
|
||||
$string =~ s/\r//g;
|
||||
|
||||
chomp($string);
|
||||
$string =~ s/^\s+//g;
|
||||
$string =~ s/\s+$//g;
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# sub sqlWrap(texto)
|
||||
# Elimina comillas y caracteres problematicos y los sustituye por equivalentes
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.750
|
||||
%define release 201030
|
||||
%define release 201124
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.750
|
||||
%define release 201030
|
||||
%define release 201124
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.750"
|
||||
PI_BUILD="201030"
|
||||
PI_BUILD="201124"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
@ -262,6 +262,7 @@ install () {
|
|||
ln -s /usr/local/bin/pandora_server $DESTDIR$PREFIX/bin
|
||||
ln -s /usr/local/bin/pandora_exec $DESTDIR$PREFIX/bin
|
||||
ln -s /usr/local/bin/tentacle_server $DESTDIR$PREFIX/bin
|
||||
ln -s /usr/local/bin/tentacle_client $DESTDIR$PREFIX/bin
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -495,7 +496,9 @@ uninstall () {
|
|||
rm -f $DESTDIR$PANDORA_SERVER 2> /dev/null
|
||||
rm -f $DESTDIR$PREFIX/bin/pandora_server 2> /dev/null
|
||||
rm -f $DESTDIR$PREFIX/bin/pandora_exec 2> /dev/null
|
||||
rm -f $DESTDIR$PREFIX/bin/tentacle_server 2> /dev/null
|
||||
# Do not remove tentacle files if agent is still installed...
|
||||
[ -e $DESTDIR$PREFIX/bin/pandora_agent ] || rm -f $DESTDIR$PREFIX/bin/tentacle_server 2> /dev/null
|
||||
[ -e $DESTDIR$PREFIX/bin/pandora_agent ] || rm -f $DESTDIR$PREFIX/bin/tentacle_client 2> /dev/null
|
||||
rm -Rf $DESTDIR$PANDORA_HOME
|
||||
rm -f $DESTDIR/etc/cron.hourly/pandora_db
|
||||
rm -f $DESTDIR/etc/logrotate.d/pandora_server
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.750 PS201030";
|
||||
my $version = "7.0NG.750 PS201124";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.750 PS201030";
|
||||
my $version = "7.0NG.750 PS201124";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue