Merge remote-tracking branch 'origin/develop' into temp

This commit is contained in:
alejandro.campos@artica.es 2021-03-12 12:34:47 +01:00
commit 3c5bf3eeef
420 changed files with 11700 additions and 4766 deletions

View File

@ -71,7 +71,7 @@ check_pre_pandora () {
check_repo_connection () {
execute_cmd "ping -c 2 8.8.8.8" "Checking internet connection"
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo"
execute_cmd "ping -c 2 support.artica.es" "Checking Enterprise repo"
execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo"
}
check_root_permissions () {

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.752-210304
Version: 7.0NG.752-210312
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -1016,7 +1016,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.752';
use constant AGENT_BUILD => '210304';
use constant AGENT_BUILD => '210312';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.752"
PI_BUILD="210304"
PI_BUILD="210312"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{210304}
{210312}
ViewReadme
{Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.752-210304
Version: 7.0NG.752-210312
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -360,14 +360,14 @@ function mainAgentsModules()
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} else if ($full_modules_selected[0] && $full_agents_id[0]) {
$full_modules = urlencode(implode(';', $full_modules_selected));
$full_agents = urlencode(implode(';', $full_agents_id));
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
@ -437,15 +437,15 @@ function mainAgentsModules()
// Header.
ui_print_page_header(
__('Agents/Modules'),
'images/module_mc.png',
'images/module.png',
false,
'',
false,
$updated_time
);
echo '<table style="width:100%;">';
echo '<table class="w100p">';
echo '<tr>';
echo "<td> <span style='float: right;'>".$fullscreen['text'].'</span> </td>';
echo "<td> <span class='float-right'>".$fullscreen['text'].'</span> </td>';
echo '</tr>';
echo '</table>';
} else {
@ -461,7 +461,7 @@ function mainAgentsModules()
}
// Floating menu - Start.
echo '<div id="vc-controls" style="z-index: 999">';
echo '<div id="vc-controls" class="zindex999">';
echo '<div id="menu_tab">';
echo '<ul class="mn">';
@ -469,14 +469,21 @@ function mainAgentsModules()
// Quit fullscreen.
echo '<li class="nomn">';
echo '<a target="_top" href="'.$url.'">';
echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]);
echo html_print_image(
'images/normal_screen.png',
true,
[
'title' => __('Back to normal mode'),
'class' => 'invert_filter',
]
);
echo '</a>';
echo '</li>';
// Countdown.
echo '<li class="nomn">';
echo '<div class="vc-refr">';
echo '<div class="vc-countdown style="display: inline;"></div>';
echo '<div class="vc-countdown inline_line"></div>';
echo '<div id="vc-refr-form">';
echo __('Refresh').':';
echo html_print_select(
@ -511,8 +518,8 @@ function mainAgentsModules()
}
if ($config['pure'] != 1) {
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" style="width:100%;">';
$show_filters .= '<table class="white_table" cellpadding="0" cellspacing="0" border="0" style="width:100%; border:none;">';
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" class="w100p">';
$show_filters .= '<table class="white_table w100p no-border" cellpadding="0" cellspacing="0" border="0">';
$show_filters .= '<tr>';
$show_filters .= '<td>'.$filter_groups_label.'</td>';
$show_filters .= '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
@ -530,7 +537,7 @@ function mainAgentsModules()
$show_filters .= '<td>'.$filter_modules.'</td>';
$show_filters .= '</tr>';
$show_filters .= '<tr>';
$show_filters .= "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</span></td>';
$show_filters .= "<td colspan=6 ><span class='right pdd_r_20px'>".$filter_update.'</span></td>';
$show_filters .= '</tr>';
$show_filters .= '</table>';
$show_filters .= '</form>';
@ -675,15 +682,15 @@ function mainAgentsModules()
return;
}
echo '<table cellpadding="4" cellspacing="4" border="0" style="width:100%;" class="agents_modules_table">';
echo '<table cellpadding="4" cellspacing="4" border="0" class="agents_modules_table w100p">';
echo '<tr>';
echo "<th width='140px' style='text-align: right !important; padding-right:13px;'>".__('Agents').' / '.__('Modules').'</th>';
echo "<th width='140px' class='right pdd_r_10px'>".__('Agents').' / '.__('Modules').'</th>';
if ($hor_offset > 0) {
$new_hor_offset = ($hor_offset - $block);
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&refr=0&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
echo "<th width='20px' class='vertical_middle center' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&refr=0&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
'images/arrow_left_green.png',
true,
['title' => __('Previous modules')]
@ -701,15 +708,15 @@ function mainAgentsModules()
$text = ui_print_truncate_text(io_safe_output($module['name']), 'module_small');
echo '<th align="center" width="20px" id="th_module_r_'.$nmodules.'" class="th_class_module_r">
<div style="width: 30px;">
<div id="div_module_r_'.$nmodules.'" style="display: none;padding-left:10px" class="rotate_text_module">'.$text.'</div>
<div class="w30px">
<div id="div_module_r_'.$nmodules.'" class="rotate_text_module invisible padding-lft-10">'.$text.'</div>
</div>
</th>';
}
if (($hor_offset + $block) < $nmodules) {
$new_hor_offset = ($hor_offset + $block);
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
echo "<th width='20px' class='vertical_middle center' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
'images/arrow_right_green.png',
true,
['title' => __('More modules')]
@ -767,7 +774,7 @@ function mainAgentsModules()
break;
}
echo "<tr style='height: 25px;'>";
echo "<tr class='height_25px'>";
echo "<td class='$rowcolor'>
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>".$alias['alias'].'</a></td>';
@ -787,7 +794,7 @@ function mainAgentsModules()
foreach ($module['id'] as $module_id) {
if (!$match && array_key_exists($module_id, $agent_modules)) {
$status = modules_get_agentmodule_status($module_id);
echo "<td style='text-align: center;'>";
echo "<td class='center'>";
$win_handle = dechex(crc32($module_id.$module['name']));
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id));
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."', 800, 480)";
@ -844,18 +851,18 @@ function mainAgentsModules()
echo '</table>';
$show_legend = "<div class='legend_white'>";
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></div>".__('Orange cell when the module has fired alerts').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></div>".__('Red cell when the module has a critical status').'
</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></div>".__('Yellow cell when the module has a warning status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></div>".__('Green cell when the module has a normal status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></div>".__('Grey cell when the module has an unknown status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></div>".__("Cell turns blue when the module is in 'not initialize' status").'</div>';
$show_legend .= '</div>';
ui_toggle($show_legend, __('Legend'));

View File

@ -187,7 +187,7 @@ function extension_api_checker()
$row = [];
$row[] = __('Raw URL');
$row[] = html_print_input_text('url', $url, '', 150, 2048, true);
$row[] = html_print_input_text('url', $url, '', 50, 2048, true);
$table3->data[] = $row;
echo "<form method='post'>";
@ -200,9 +200,7 @@ function extension_api_checker()
echo '<legend>'.__('Call parameters').' '.ui_print_help_tip(__('Action: get Operation: module_last_value id: 63'), true).'</legend>';
html_print_table($table2);
echo '</fieldset>';
echo "<div style='text-align: right;'>";
html_print_input_hidden('api_execute', 1);
html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"');
echo "<div class='right'>";
echo '</div>';
echo '</form>';
@ -212,7 +210,7 @@ function extension_api_checker()
html_print_table($table3);
echo '</fieldset>';
echo "<div style='text-align: right;'>";
echo "<div class='right'>";
html_print_input_hidden('api_execute', 1);
html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"');
echo '</div>';

View File

@ -67,7 +67,7 @@ function extension_db_status()
html_print_table($table);
echo '</fieldset>';
echo "<div style='text-align: right;'>";
echo "<div class='right'>";
html_print_input_hidden('db_status_execute', 1);
html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub next"');
echo '</div>';

View File

@ -119,7 +119,7 @@ function dbmgr_extension_main()
echo "<form method='post' action=''>";
html_print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES));
echo '<br />';
echo '<div class="action-buttons" style="width: 100%">';
echo '<div class="action-buttons w100p">';
echo '<br />';
html_print_submit_button(__('Execute SQL'), '', false, 'class="sub next"');
echo '</div>';
@ -156,7 +156,7 @@ function dbmgr_extension_main()
return;
}
echo "<div style='overflow: auto;'>";
echo "<div class='overflow'>";
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';

View File

@ -25,12 +25,19 @@ function load_matrix_console()
if (! $pure) {
$title_menu = __('Matrix events');
$fullscreen['text'] = '<a href="index.php?extension_in_menu=eventos&sec=extensions&sec2=extensions/matrix_events&pure=1">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
$fullscreen['text'] = '<a href="index.php?extension_in_menu=eventos&sec=extensions&sec2=extensions/matrix_events&pure=1">'.html_print_image(
'images/full_screen.png',
true,
[
'title' => __('Full screen mode'),
'class' => 'invert_filter',
]
).'</a>';
$onheader = ['fullscreen' => $fullscreen];
ui_print_page_header($title_menu, 'images/op_monitoring.png', false, '', false, $onheader);
}
echo '<canvas id="matrix-terminal" style="display:block;"></canvas>';
echo '<canvas id="matrix-terminal" class="visible"></canvas>';
?>
<script language="javascript" type="text/javascript">

View File

@ -84,7 +84,7 @@ function extension_uploader_extensions()
echo "<form method='post' enctype='multipart/form-data'>";
html_print_table($table);
echo "<div style='text-align: right; width: ".$table->width."'>";
echo "<div class='right' style='width: ".$table->width."'>";
html_print_input_hidden('upload', 1);
html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"');
echo '</div>';

View File

@ -111,25 +111,25 @@ function pandora_files_repo_godmode()
return;
}
// Header tabs
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view')]).'</a>';
// Header tabs.
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view'), 'class' => 'invert_filter']).'</a>';
$godmode['godmode'] = 1;
$godmode['active'] = 1;
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/operation.png', true, ['title' => __('Operation view')]).'</a>';
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/eye_show.png', true, ['title' => __('Operation view'), 'class' => 'invert_filter']).'</a>';
$operation['operation'] = 1;
$onheader = [
'godmode' => $godmode,
'operation' => $operation,
];
// Header
// Header.
ui_print_page_header(__('Files repository manager'), 'images/extensions.png', false, '', true, $onheader);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';
// Directory files_repo check
// Directory files_repo check.
if (!files_repo_check_directory(true)) {
return;
}
@ -139,19 +139,19 @@ function pandora_files_repo_godmode()
$server_content_length = $_SERVER['CONTENT_LENGTH'];
}
// Check for an anoying error that causes the $_POST and $_FILES arrays
// were empty if the file is larger than the post_max_size
// Check for an anoying error that causes the $_POST and $_FILES arrays.
// were empty if the file is larger than the post_max_size.
if (intval($server_content_length) > 0 && empty($_POST)) {
ui_print_error_message(__('The file exceeds the maximum size'));
}
// GET and POST parameters
// GET and POST parameters.
$file_id = (int) get_parameter('file_id');
$add_file = (bool) get_parameter('add_file');
$update_file = (bool) get_parameter('update_file');
$delete_file = (bool) get_parameter('delete');
// File add or update
// File add or update.
if ($add_file || ($update_file && $file_id > 0)) {
$groups = get_parameter('groups', []);
$public = (bool) get_parameter('public');
@ -174,7 +174,7 @@ function pandora_files_repo_godmode()
}
}
// File delete
// File delete.
if ($delete_file && $file_id > 0) {
$result = files_repo_delete_file($file_id);
if ($result !== -1) {
@ -184,10 +184,10 @@ function pandora_files_repo_godmode()
$file_id = 0;
}
// FORM
// FORM.
include $full_extensions_dir.'files_repo/files_repo_form.php';
if (!$file_id) {
// LIST
// LIST.
$manage = true;
include $full_extensions_dir.'files_repo/files_repo_list.php';
}
@ -198,13 +198,13 @@ function pandora_files_repo_operation()
{
global $config;
// Header tabs
// Header tabs.
$onheader = [];
if (check_acl($config['id_user'], 0, 'PM')) {
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view')]).'</a>';
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view'), 'class' => 'invert_filter']).'</a>';
$godmode['godmode'] = 1;
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/operation.png', true, ['title' => __('Operation view')]).'</a>';
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/eye_show.png', true, ['title' => __('Operation view'), 'class' => 'invert_filter']).'</a>';
$operation['operation'] = 1;
$operation['active'] = 1;
@ -214,18 +214,18 @@ function pandora_files_repo_operation()
];
}
// Header
// Header.
ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';
// Directory files_repo check
// Directory files_repo check.
if (!files_repo_check_directory(true)) {
return;
}
// LIST
// LIST.
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include $full_extensions_dir.'files_repo/files_repo_list.php';
@ -237,5 +237,4 @@ extensions_add_main_function('pandora_files_repo_operation');
extensions_add_godmode_menu_option(__('Files repository manager'), 'PM', null, null, 'v1r1');
extensions_add_godmode_function('pandora_files_repo_godmode');
// pandora_files_repo_uninstall();
pandora_files_repo_install();

View File

@ -82,7 +82,7 @@ $table->colspan[][1] = 3;
$row = [];
$row[0] = __('Description');
$row[0] .= ui_print_help_tip(__('Only 200 characters are permitted'), true);
$row[1] = html_print_textarea('description', 3, 20, $file['description'], 'style="min-height: 40px; max-height: 40px; width: 98%;"', true);
$row[1] = html_print_textarea('description', 3, 20, $file['description'], 'class="file_repo_description"', true);
$table->data[] = $row;
$table->colspan[][1] = 3;
@ -90,7 +90,7 @@ $table->colspan[][1] = 3;
$row = [];
// Public checkbox
$checkbox = html_print_checkbox('public', 1, (bool) !empty($file['hash']), true);
$style = 'style="padding: 2px 10px; display: inline-block;"';
$style = 'class="inline padding-2-10"';
$row[0] = __('File');
if ($file_id > 0) {

View File

@ -16,6 +16,8 @@ global $config;
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
require_once $full_extensions_dir.'files_repo/functions_files_repo.php';
$offset = (int) get_parameter('offset');
$filter = [];
$filter['limit'] = $config['block_size'];
@ -61,19 +63,34 @@ if (!empty($files)) {
$data = [];
// Prepare the filename for the get_file.php script
$document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT']));
$file['location'] = str_replace('\\', '/', io_safe_output($file['location']));
$document_root = str_replace(
'\\',
'/',
io_safe_output($_SERVER['DOCUMENT_ROOT'])
);
$file['location'] = str_replace(
'\\',
'/',
io_safe_output($file['location'])
);
$relative_path = str_replace($document_root, '', $file['location']);
$file_name = explode('/', $file['location']);
$file_decoded = $file_name[(count($file_name) - 1)];
$file_path = base64_encode($file_decoded);
$hash = md5($file_path.$config['dbpass']);
$url = ui_get_full_url('include/get_file.php?file='.urlencode($file_path).'&hash='.$hash);
$url = ui_get_full_url(
'include/get_file.php?file='.urlencode($file_path).'&hash='.$hash
);
$date_format = ($config['date_format']) ? io_safe_output($config['date_format']) : 'F j, Y - H:m';
$data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>';
// Name
$data[1] = ui_print_truncate_text($file['description'], 'description', true, true);
$data[1] = ui_print_truncate_text(
$file['description'],
'description',
true,
true
);
// Description
$data[2] = ui_format_filesize($file['size']);
// Size
@ -83,30 +100,58 @@ if (!empty($files)) {
$data[4] = '';
$table->cellclass[][4] = 'action_buttons';
if (!empty($file['hash'])) {
$public_url = ui_get_full_url(EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']);
$public_url = ui_get_full_url(
EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']
);
$message = __('Copy to clipboard').': Ctrl+C -> Enter';
$action = "window.prompt('$message', '$public_url');";
$data[4] .= "<a href=\"javascript:;\" onclick=\"$action\">";
$data[4] .= html_print_image('images/world.png', true, ['title' => __('Public link')]);
$data[4] .= html_print_image(
'images/world.png',
true,
['title' => __('Public link')]
);
// Public link image
$data[4] .= '</a> ';
}
$data[4] .= "<a href=\"$url\" target=\"_blank\">";
$data[4] .= html_print_image('images/download.png', true, ['title' => __('Download'), 'style' => 'padding:3px' ]);
$data[4] .= html_print_image(
'images/download.png',
true,
[
'title' => __('Download'),
'style' => 'padding:3px',
]
);
// Download image
$data[4] .= '</a>';
if ($manage) {
$config_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id=$file_id");
$data[4] .= " <a href=\"$config_url\">";
$data[4] .= html_print_image('images/config.png', true, ['title' => __('Edit')]);
$config_url = ui_get_full_url(
'index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id='.$file_id
);
$data[4] .= '<a href=\"$config_url\">';
$data[4] .= html_print_image(
'images/config.png',
true,
['title' => __('Edit')]
);
// Edit image
$data[4] .= '</a>';
$delete_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&delete=1&file_id=$file_id");
$delete_url = ui_get_full_url(
'index.php?sec=godmode/extensions&sec2=extensions/files_repo&delete=1&file_id='.$file_id
);
$data[4] .= " <a href=\"$delete_url\" onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\">";
$data[4] .= html_print_image('images/cross.png', true, ['title' => __('Delete')]);
$data[4] .= html_print_image(
'images/cross.png',
true,
[
'title' => __('Delete'),
'class' => 'invert_filter',
]
);
// Delete image
$data[4] .= '</a>';
}

View File

@ -137,7 +137,7 @@ function mainInsertData()
}
}
echo '<div class="notify" style="margin-bottom:15px;">';
echo '<div class="notify mrg_btt_15">';
echo sprintf(
__('Please check that the directory "%s" is writeable by the apache user. <br /><br />The CSV file format is date;value&lt;newline&gt;date;value&lt;newline&gt;... The date in CSV is in format Y/m/d H:i:s.'),
$config['remote_config']
@ -200,7 +200,7 @@ function mainInsertData()
html_print_table($table);
echo "<div style='text-align: right; width: ".$table->width."'>";
echo "<div class='right' style='width: ".$table->width."'>";
html_print_input_hidden('save', 1);
html_print_submit_button(__('Save'), 'submit', ($id_agent === ''), 'class="sub next"');
echo '</div>';

View File

@ -254,7 +254,7 @@ function mainModuleGroups()
''
);
echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
echo "<table cellpadding='4' cellspacing='4' class='databox filters bolder margin-bottom-10' width='100%'>
<tr>";
echo "<form method='post'
action='index.php?sec=view&sec2=extensions/module_groups'>";
@ -336,7 +336,7 @@ function mainModuleGroups()
}
$data[$i][$j] = "<div style='".$cell_style.'background:'.$color.";'>";
$data[$i][$j] .= "<a class='info_cell' rel='$rel' href='$url' style='color:white;font-size: 18px;'>";
$data[$i][$j] .= "<a class='info_cell white font_18px' rel='$rel' href='$url'>";
$data[$i][$j] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '</a></div>';
} else {
@ -349,7 +349,7 @@ function mainModuleGroups()
}
} else {
foreach ($value['gm'] as $k => $v) {
$data[$i][$j] = "<div style='background:".$background_color."; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] = "<div class='module_gm_groups' style='background:".$background_color."'>";
$data[$i][$j] .= 0;
$data[$i][$j] .= '</div>';
$j++;
@ -365,15 +365,15 @@ function mainModuleGroups()
ui_pagination($counter);
echo "<div style='width:100%; overflow-x:auto;'>";
echo "<div class='w100p' style='overflow-x:auto;'>";
html_print_table($table);
echo '</div>';
ui_pagination($counter);
echo "<div class='legend_basic' style='width: 98.6%'>";
echo "<div class='legend_basic w99p'>";
echo '<table >';
echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>".__('Legend').'</b></td></tr>';
echo "<tr><td colspan='2' class='pdd_b_10px'><b>".__('Legend').'</b></td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module group and agent have at least one alarm fired.').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'</td></tr>';

View File

@ -317,7 +317,7 @@ function main_net_tools()
);
if ($ips == '') {
echo "<div class='error' style='margin-top:5px'>".__('The agent hasn\'t got IP').'</div>';
echo "<div class='error mrgn_top_5'>".__('The agent hasn\'t got IP').'</div>';
return;
}
@ -392,7 +392,7 @@ function main_net_tools()
echo __('SNMP Community').'&nbsp;';
html_print_input_text('community', $community);
echo '</td><td>';
echo "<input style='margin:0px;' name=submit type=submit class='sub next' value='".__('Execute')."'>";
echo "<input name=submit type=submit class='sub next mrgn_0px' value='".__('Execute')."'>";
echo '</td>';
echo '</tr></table>';
echo '</form>';

View File

@ -36,14 +36,14 @@ function view_logfile($file_name)
} else if ($file_size > ($config['max_log_size'] * 1000)) {
$data = file_get_contents($file_name, false, null, ($file_size - ($config['max_log_size'] * 1000)));
echo "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).' </h2>';
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
echo "<textarea class='pandora_logs' name='$file_name'>";
echo '... ';
echo $data;
echo '</textarea><br><br>';
} else {
$data = file_get_contents($file_name);
echo "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).' </h2>';
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
echo "<textarea class='pandora_logs' name='$file_name'>";
echo $data;
echo '</textarea><br><br>';
}

View File

@ -207,7 +207,7 @@ function pandora_realtime_graphs()
'reset',
false,
'javascript:realtimeGraphs.clearGraph();',
'class="sub delete" style="margin-top:0px;"',
'class="sub delete mgn_tp_0" ',
true
);
$table->data[] = $data;
@ -230,7 +230,7 @@ function pandora_realtime_graphs()
'custom_action',
urlencode(
base64_encode(
'&nbsp;<a href="javascript:realtimeGraphs.setOID();"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" style="vertical-align: middle;"></img></a>'
'&nbsp;<a href="javascript:realtimeGraphs.setOID();"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" class="vertical_middle"></img></a>'
)
),
false

View File

@ -12,4 +12,6 @@
#graph_container {
width: 800px;
margin: 20px auto;
background-color: white;
border-radius: 3px;
}

View File

@ -30,7 +30,7 @@ function users_extension_main_god($god=true)
if ($god) {
$image = 'images/gm_users.png';
} else {
$image = 'images/op_workspace.png';
$image = 'images/user.png';
}
// Header
@ -98,13 +98,45 @@ function users_extension_main_god($god=true)
$table->head = [];
$table->head[0] = __('User');
$table->head[1] = __('Date');
$table->head[1] = __('IP');
$table->head[2] = __('Last login');
$table->head[3] = __('Last contact');
$rowPair = true;
$iterator = 0;
// Get data
foreach ($rows as $row) {
// Get data of user's last login.
switch ($config['dbtype']) {
case 'mysql':
case 'postgresql':
$last_login_data = db_get_row_sql(
sprintf(
"SELECT ip_origen, utimestamp
FROM tsesion
WHERE id_usuario = '%s'
AND descripcion = '".io_safe_input('Logged in')."'
ORDER BY fecha DESC",
$row['id_user']
)
);
break;
case 'oracle':
$last_login_data = db_get_row_sql(
sprintf(
"SELECT ip_origen, utimestamp
FROM tsesion
WHERE id_usuario = '%s'
AND to_char(descripcion) = '".io_safe_input('Logged in')."'
ORDER BY fecha DESC",
$row['id_user']
)
);
break;
}
if ($rowPair) {
$table->rowclass[$iterator] = 'rowPair';
} else {
@ -116,7 +148,9 @@ function users_extension_main_god($god=true)
$data = [];
$data[0] = '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$row['id_user'].'">'.$row['id_user'].'</a>';
$data[1] = date($config['date_format'], $row['last_connect']);
$data[1] = $last_login_data['ip_origin'];
$data[2] = date($config['date_format'], $last_login_data['utimestamp']);
$data[3] = date($config['date_format'], $row['last_connect']);
array_push($table->data, $data);
}
@ -125,7 +159,6 @@ function users_extension_main_god($god=true)
}
extensions_add_godmode_menu_option(__('Users connected'), 'UM', 'gusuarios', 'users/icon.png', 'v1r1');
extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', '', 'UM');
extensions_add_godmode_function('users_extension_main_god');

View File

@ -1,6 +1,7 @@
operation/servers/recon_view.php
operation/users/webchat.php
operation/events/event_statistics.php
operation/events/events_marquee.php
include/javascript/webchat.js
attachment/pandora_chat.log.json.txt
attachment/pandora_chat.user_list.json.txt
@ -71,4 +72,4 @@ enterprise/extensions/ipam/ipam_action.php
enterprise/extensions/ipam.php
enterprise/extensions/ipam
enterprise/extensions/disabled/visual_console_manager.php
enterprise/extensions/visual_console_manager.php
enterprise/extensions/visual_console_manager.php

View File

@ -1,6 +1,11 @@
START TRANSACTION;
ALTER TABLE `talert_actions` ADD COLUMN `create_wu_integria` TINYINT(1) default NULL;
ALTER TABLE `treport_content` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER TABLE `tinventory_alert` ADD COLUMN `alert_groups` TEXT NOT NULL;
UPDATE `tinventory_alert` t1 INNER JOIN `tinventory_alert` t2 ON t1.id = t2.id SET t1.alert_groups = t2.id_group;

View File

@ -865,6 +865,7 @@ ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) D
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0',
MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0',
@ -1727,6 +1728,7 @@ ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
ALTER TABLE `treport_content` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0',

View File

@ -29,7 +29,7 @@ if (check_login()) {
}
echo "</span>
<img class='modalclosex cerrar' src='".$config['homeurl']."images/icono_cerrar.png'>
<img class='modalclosex cerrar' src='".$config['homeurl'].'images/icono_cerrar.png'."'>
</div>
<div class='modalcontent'>
@ -105,7 +105,7 @@ if (check_login()) {
echo __(
"This is the online help for %s console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use %s. Official documentation of %s is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.<br><br>
<a href='%s' target='_blanck' class='pandora_green_text' style='font-size: 10pt; text-decoration: underline;'>Download the official documentation</a>",
<a href='%s' target='_blanck' class='pandora_green_text font_10 underline'>Download the official documentation</a>",
get_product_name(),
get_product_name(),
get_product_name(),
@ -136,7 +136,7 @@ if (check_login()) {
case 'modulemodal':
echo __(
"The community version doesn't have the ability to define your own library of local modules, or distribute it to remote agents. You need to make those changes individually on each agent which is possible by using external tools and time and effort. Nor can it distribute local plugins, or have access to the library of enterprise plugins to monitor applications such as VMWare, RHEV or Informix between others. The Enterprise version will have all this, plus the ability to distribute and manage your own local modules on your systems, individually or through policies.
<br><br><img style='width:105px' src='".$config['homeurl']."images/logo_oracle.png'><img style='width:105px' src='".$config['homeurl']."images/logo_citrix.png'><img style='width:105px' src='".$config['homeurl']."images/logo_sap.png'><img style='width:105px' src='".$config['homeurl']."images/logo_exchange.png'><br><br><span style='font-style:italic;'>* Todos los logotipos pertenecen a marcas registradas</span>"
<br><br><img class='w105px' src='".$config['homeurl'].'images/logo_oracle.png'."'><img class='w105px' src='".$config['homeurl'].'images/logo_citrix.png'."'><img class='w105px' src='".$config['homeurl'].'images/logo_sap.png'."'><img class='w105px' src='".$config['homeurl'].'images/logo_exchange.png'."'><br><br><span class='italic'>* Todos los logotipos pertenecen a marcas registradas</span>"
);
break;
@ -192,7 +192,7 @@ if (check_login()) {
echo "
</div>
<div style='float:right;width:100%;height:30px;'>
<div class='right height_30px'>
</div>
<div class='modalokbutton cerrar'>
<span class='modalokbuttontext'>OK</span>

View File

@ -53,10 +53,10 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clus
<?php
if (check_acl($config['id_user'], 0, 'PM')) {
echo "<div id='create_master_window' style='display:none;'></div>";
echo "<div id='msg' style='display:none;'></div>";
echo "<div id='create_master_window' class='invisible'></div>";
echo "<div id='msg' class='invisible'></div>";
?>
<input style="margin-bottom:20px;" onclick="show_create_ha_cluster();" type="submit" class="button_task" value="<?php echo __('Add new node'); ?>" />
<input onclick="show_create_ha_cluster();" type="submit" class="button_task ui_toggle" value="<?php echo __('Add new node'); ?>" />
<?php
}
?>

View File

@ -53,7 +53,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no cluster
?>
<form action='index.php?sec=estado&sec2=enterprise/operation/cluster/cluster&op=new' method="post">
<input style="margin-bottom:20px;" type="submit" class="button_task" value="<?php echo __('Create Cluster'); ?>" />
<input type="submit" class="button_task ui_toggle" value="<?php echo __('Create Cluster'); ?>" />
</form>
<?php

View File

@ -21,7 +21,8 @@ ui_require_css_file('order_interpreter');
// Check permissions
// Global errors/warnings checking.
config_check();
config_check();
if ($config['menu_type'] == 'classic') {
@ -76,9 +77,9 @@ if ($config['menu_type'] == 'classic') {
if ($check_minor_release_available) {
if (users_is_admin($config['id_user'])) {
if ($config['language'] == 'es') {
set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Actualizacion#Versi.C3.B3n_7.0NG_.28_Rolling_Release_.29">'.__('Sobre actualización de revisión menor').'</a>', 'Revisión/es menor/es disponible/s');
set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. <a id="aviable_updates" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Actualizacion#Versi.C3.B3n_7.0NG_.28_Rolling_Release_.29">'.__('Sobre actualización de revisión menor').'</a>', 'Revisión/es menor/es disponible/s');
} else {
set_pandora_error_for_header('There are one or more minor releases waiting for update. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_Upgrade#Version_7.0NG_.28_Rolling_Release_.29">'.__('About minor release update').'</a>', 'minor release/s available');
set_pandora_error_for_header('There are one or more minor releases waiting for update. <a id="aviable_updates" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_Upgrade#Version_7.0NG_.28_Rolling_Release_.29">'.__('About minor release update').'</a>', 'minor release/s available');
}
}
}
@ -97,8 +98,8 @@ if ($config['menu_type'] == 'classic') {
if ($acl_head_search) {
// Search bar.
$search_bar = '<form autocomplete="off" method="get" style="display: inline;" name="quicksearch" action="">';
'<input autocomplete="false" name="hidden" type="text" style="display:none;">';
$search_bar = '<form autocomplete="off" method="get" class="display_in" name="quicksearch" action="">';
'<input autocomplete="false" name="hidden" type="text" class="invisible">';
if (!isset($config['search_keywords'])) {
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
} else {
@ -256,7 +257,7 @@ if ($config['menu_type'] == 'classic') {
$ignored_params['refr'] = '';
$values = get_refresh_time_array();
$autorefresh_additional = '<span id="combo_refr" style="display: none;">';
$autorefresh_additional = '<span id="combo_refr" class="invisible">';
$autorefresh_additional .= html_print_select(
$values,
'ref',
@ -292,7 +293,15 @@ if ($config['menu_type'] == 'classic') {
$autorefresh_link_close = '</a>';
$display_counter = 'display:block';
} else {
$autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]);
$autorefresh_img = html_print_image(
'images/header_refresh_disabled_gray.png',
true,
[
'class' => 'bot autorefresh_disabled invert_filter',
'alt' => 'lightning',
'title' => __('Disabled autorefresh'),
]
);
$ignored_params['refr'] = false;
@ -307,7 +316,7 @@ if ($config['menu_type'] == 'classic') {
'images/header_refresh_disabled_gray.png',
true,
[
'class' => 'bot autorefresh_disabled',
'class' => 'bot autorefresh_disabled invert_filter',
'alt' => 'lightning',
'title' => __('Disabled autorefresh'),
]
@ -339,10 +348,10 @@ if ($config['menu_type'] == 'classic') {
// Button for feedback pandora.
if (enterprise_installed()) {
$header_feedback = '<div id="feedback-icon-header">';
$header_feedback .= '<div id="modal-feedback-form" style="display:none;"></div>';
$header_feedback .= '<div id="msg-header" style="display: none"></div>';
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
$header_feedback .= '<div id="msg-header" class="invisible"></div>';
$header_feedback .= html_print_image(
'/images/feedback-header.png',
'images/feedback-header.png',
true,
[
'title' => __('Feedback'),
@ -364,13 +373,29 @@ if ($config['menu_type'] == 'classic') {
$header_support = '<div id="header_support">';
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">';
$header_support .= html_print_image('/images/header_support.png', true, ['title' => __('Go to support'), 'class' => 'bot', 'alt' => 'user']);
$header_support .= html_print_image(
'images/header_support.png',
true,
[
'title' => __('Go to support'),
'class' => 'bot invert_filter',
'alt' => 'user',
]
);
$header_support .= '</a></div>';
// Documentation.
$header_docu = '<div id="header_docu">';
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
$header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']);
$header_docu .= html_print_image(
'images/header_docu.png',
true,
[
'title' => __('Go to documentation'),
'class' => 'bot invert_filter',
'alt' => 'user',
]
);
$header_docu .= '</a></div>';
@ -397,7 +422,7 @@ if ($config['menu_type'] == 'classic') {
);
}
$header_user = '<div id="header_user"><a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$header_user.'<span> ('.$config['id_user'].')</span></a></div>';
$header_user = '<div id="header_user"><a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$header_user.'<span id="user_name_header"> ('.$config['id_user'].')</span></a></div>';
// Logout.
$header_logout = '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">';
@ -406,7 +431,7 @@ if ($config['menu_type'] == 'classic') {
true,
[
'alt' => __('Logout'),
'class' => 'bot',
'class' => 'bot invert_filter',
'title' => __('Logout'),
]
);
@ -421,10 +446,10 @@ if ($config['menu_type'] == 'classic') {
<!-- Notifications content wrapper-->
<div id='notification-content' style='display:none;' /></div>
<div id='notification-content' class='invisible'/></div>
<!-- Old style div wrapper -->
<div id="alert_messages" style="display: none"></div>
<div id="alert_messages" class="invisible"></div>
<script type="text/javascript">
/* <![CDATA[ */

View File

@ -18,6 +18,8 @@
global $config;
if (is_ajax()) {
$skip_login_help = get_parameter('skip_login_help', 0);
@ -34,9 +36,9 @@ if (is_ajax()) {
}
// Prints help dialog information
echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name()).'" style="">';
echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name()).'" >';
echo '<div style="font-size: 10pt; margin: 20px;">';
echo '<div id="help_dialog">';
echo __(
"If this is your first time using %s, we suggest a few links that'll help you learn more about the software. Monitoring can be overwhelming, but take your time to learn how to harness the power of %s!",
get_product_name(),
@ -44,11 +46,11 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
);
echo '</div>';
echo '<div style="">';
echo '<table cellspacing=0 cellpadding=0 style="border:1px solid #FFF; width:100%; height: 100%">';
echo '<div>';
echo '<table cellspacing=0 cellpadding=0 class="border_solid_white w100p h100p">';
echo '<tr>';
echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank" style="text-decoration:none;">'.html_print_image(
echo '<td class="border_solid_white center">';
echo '<a href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank" class="no_decoration">'.html_print_image(
'images/online_help.png',
true,
[
@ -56,12 +58,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank">'.__('Online help').'</a>';
echo '<br id="br_mb_40" />';
echo '<a class="font_9pt" href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank">'.__('Online help').'</a>';
echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="http://pandorafms.com/" target="_blank" style="text-decoration:none;">'.html_print_image(
echo '<td class="border_solid_white center">';
echo '<a href="http://pandorafms.com/" target="_blank" class="no_decoration">'.html_print_image(
'images/enterprise_version.png',
true,
[
@ -69,12 +71,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="http://pandorafms.com/" target="_blank">'.__('Enterprise version').'</a>';
echo '<br id="br_mb_40" />';
echo '<a class="font_9pt" href="http://pandorafms.com/" target="_blank">'.__('Enterprise version').'</a>';
echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="https://pandorafms.com/forums" target="_blank" style="text-decoration:none;">'.html_print_image(
echo '<td class="border_solid_white center">';
echo '<a href="https://pandorafms.com/forums" target="_blank" class="no_decoration">'.html_print_image(
'images/support.png',
true,
[
@ -82,12 +84,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="https://pandorafms.com/forums" target="_blank">'.__('Support').' / '.__('Forums').'</a>';
echo '<br id="br_mb_40" />';
echo '<a class="font_9pt" href="https://pandorafms.com/forums" target="_blank">'.__('Support').' / '.__('Forums').'</a>';
echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank" style="text-decoration:none;">'.html_print_image(
echo '<td class="border_solid_white center">';
echo '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank" class="no_decoration">'.html_print_image(
'images/documentation.png',
true,
[
@ -95,20 +97,20 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;"href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Documentation').'</span></a>';
echo '<br id="br_mb_40" />';
echo '<a clas="font_9pt" href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Documentation').'</span></a>';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; top: 240px; right: 10px; border: 1px solid #FFF; width: 570px">';
echo '<div style="float: left; margin-top: 3px; margin-left: 0px; width: 80%; text-align: left;">';
echo '<div class="absolute help_dialog_login" ">';
echo '<div class="skip_help_login">';
html_print_checkbox('skip_login_help', 1, false, false, false, 'cursor: \'pointer\'');
echo '&nbsp;<span style="font-size: 12px;">'.__("Click here to don't show again this message").'</span>';
echo '&nbsp;<span class="font_12pt">'.__("Click here to don't show again this message").'</span>';
echo '</div>';
echo '<div style="float: right; width: 20%;">';
html_print_submit_button('Ok', 'hide-login-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '<div class="float-right w20p">';
html_print_submit_button('Ok', 'hide-login-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok w100p"');
echo '</div>';
echo '</div>';

View File

@ -17,6 +17,10 @@ if (isset($config['homedir'])) {
$homedir = '';
}
global $config;
ui_require_css_file('login', 'include/styles/', true);
require_once __DIR__.'/../include/functions_ui.php';
@ -146,8 +150,8 @@ if (isset($config['custom_support_url'])) {
echo '<li>'.__('Support').'</li>';
}
} else if (!$custom_conf_enabled) {
echo '<li id="li_margin_left"><a href="https://support.artica.es" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
echo '<li><a href="https://support.artica.es" target="_blank">'.__('Docs').'</li>';
echo '<li id="li_margin_left"><a href="https://support.pandorafms.com" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
echo '<li><a href="https://support.pandorafms.com" target="_blank">'.__('Docs').'</li>';
}
echo '</ul></div>';
@ -197,9 +201,6 @@ if (is_metaconsole() === true) {
} else {
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
// I comment this in case in the future we put a logo without text.
// echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";.
}
echo '</a></div>';
@ -214,7 +215,7 @@ switch ($login_screen) {
}
if ($config['auth'] == 'saml') {
echo '<div id="log_nick" class="login_nick" style="display: none;">';
echo '<div id="log_nick" class="login_nick invisible" >';
html_print_input_text_extended(
'nick',
'',
@ -228,7 +229,7 @@ switch ($login_screen) {
);
echo '</div>';
echo '<div id="log_pass" class="login_pass" style="display: none;">';
echo '<div id="log_pass" class="login_pass invisible">';
html_print_input_text_extended(
'pass',
'',
@ -244,7 +245,7 @@ switch ($login_screen) {
);
echo '</div>';
echo '<div id="log_button" class="login_button" style="display: none;">';
echo '<div id="log_button" class="login_button invisible">';
html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="next_login"');
echo '</div>';

View File

@ -15,9 +15,9 @@
<div class='databox' id='login'>
<div id='login_f' class='databox'>
<h1 id="log_f" style='margin-top: 0px;' class="error"><?php echo __('Authentication error'); ?></h1>
<h1 id="log_f" class="error mgn_tp_0"><?php echo __('Authentication error'); ?></h1>
<div style='width: 350px'>
<div class='w350px'>
<a href="index.php"><img src="images/pandora_logo.png" border="0"></a><br>
<?php echo $pandora_version; ?>
</div>

View File

@ -38,17 +38,17 @@ if (!empty($news)) {
}
// Prints news dialog template
echo '<div id="news_dialog" title="" style="display: none;">';
echo '<div id="news_dialog" class="invisible">';
echo '<div style="position:absolute; top:30px; left: 10px; text-align: left; right:0%; height:70px; min-width:560px; width: 95%; margin: 0 auto; line-height: 19px;">';
echo '<span style="display: block; height: 260px; overflow: auto; text-align: justify; padding: 5px 15px 4px 10px; background: #ECECEC; border-radius: 4px;" id="new_text"></span>';
echo '<span style="font-size: 12px; display: block; margin-top: 20px;" id="new_author"></span>';
echo '<span style="font-size: 12px; display: block; font-style: italic;" id="new_timestamp"></span>';
echo '<div class="parent_new_dialog_tmplt">';
echo '<span id="new_text"></span>';
echo '<span id="new_author"></span>';
echo '<span id="new_timestamp"></span>';
echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; top: 340px; right: 10px; width: 570px">';
echo '<div style="float: right; width: 20%;">';
html_print_submit_button('Ok', 'hide-news-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '<div id="div_btn_new_dialog">';
echo '<div class="float-right w20p">';
html_print_submit_button('Ok', 'hide-news-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok w100px";"');
echo '</div>';
echo '</div>';

View File

@ -11,6 +11,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
if (file_exists('images/grafico_llave.png')) {
ui_print_page_header(__('You don\'t have access to this page'), '', false, '', true);
} else {
@ -18,17 +19,17 @@ if (file_exists('images/grafico_llave.png')) {
}
?>
<div id="noaccess" style="width: 500px; height:180px;">
<div id="noaccess-title" style=" height: 20px; width: 98%;"><?php echo __('Access to this page is restricted'); ?></div>
<div id="noaccess">
<div id="noaccess-title"><?php echo __('Access to this page is restricted'); ?></div>
<div>
<div id="noaccess-image" style="width: 15%;">
<div id="noaccess-image">
<?php
if (file_exists('images/grafico_llave.png')) {
echo html_print_image('images/grafico_llave.png', true, ['alt' => __('No access')]);
}
?>
</div>
<div id="noaccess-text" style="width: 70%;">
<div id="noaccess-text">
<?php
echo __(
'Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br/> <br/>

View File

@ -18,7 +18,7 @@ require_once '../include/config.php';
require_once '../include/functions.php';
require_once '../include/functions_html.php';
?>
<html style="height:100%; margin-top: 25px; margin-left: 15px; margin-right: 15px; background-color: #333;"><head><title>
<html class="help_pname"><head><title>
<?php
echo __('%s help system', get_product_name());
?>
@ -26,7 +26,7 @@ echo __('%s help system', get_product_name());
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<?php echo '<link rel="stylesheet" href="../include/styles/'.$config['style'].'.css" type="text/css">'; ?>
<body style="height: 100%;background-color: #333">
<body class="height_100p bg_333">
<?php
$id = get_parameter('id');
$id_user = get_parameter('id_user');
@ -59,30 +59,30 @@ foreach ($files as $file) {
$logo = ui_get_custom_header_logo(true);
if (! $id || ! file_exists($help_file)) {
echo '<div id="main_help" style="background-color: #fff;text-align:center; padding-top: 15px; padding-bottom: 15px; ">';
echo '<div id="main_help">';
if (!is_metaconsole()) {
echo html_print_image($logo, true, ['border' => '0']);
}
echo '</div>';
echo '<div style="font-family: verdana, arial; font-size: 11px; text-align:left; background-color: #fff;">';
echo '<div style="font-size: 12px; background-color: #fff; ;border:0px;" class="databox">';
echo '<HR style="margin-top: 0px;">';
echo '<h1 style="padding-left: 30px">';
echo '<div id="parent_dic">';
echo '<div class="databox bg-white font_12px no_border">';
echo '<hr class="mgn_tp_0">';
echo '<h1 class="pdd_l_30px">';
echo __('Help system error');
echo '</h1>';
echo "<div style='text-align: center; background-color: #fff'>";
echo "<div class='center bg-white'>";
echo '</div>';
echo '<div class="msg" style="padding-left: 30px;padding-right: 30px;padding-bottom: 15px;">'.__("%s help system has been called with a help reference that currently don't exist. There is no help content to show.", get_product_name()).'</div></div></div>';
echo '<div class="msg msg_pandora_help">'.__("%s help system has been called with a help reference that currently don't exist. There is no help content to show.", get_product_name()).'</div></div></div>';
echo '<br /><br />';
echo '<div style="text-align: center; padding: 5px; font-family: verdana, arial; font-size: 11px;">';
echo '<div id="footer_help">';
include 'footer.php';
return;
}
// Show help
echo '<div id="main_help_new" style="background-color: #fff">';
echo '<div id="main_help_new">';
if (!empty($config['enterprise_installed']) && is_metaconsole()) {
echo '<img src="'.$config['homeurl'].$logo.'">';
} else {
@ -90,7 +90,7 @@ if (!empty($config['enterprise_installed']) && is_metaconsole()) {
}
echo '</div>';
echo '<div id="main_help_new_content" style="height: auto ! important;overfloat: auto;">';
echo '<div id="main_help_new_content">';
ob_start();
require_once $help_file;
$help = ob_get_contents();

View File

@ -25,19 +25,19 @@ if ($config['language'] == 'es') {
}
// Prints help dialog information
echo '<div id="login_help_dialog" title="PHP UPDATE REQUIRED" style="display: none;">';
echo '<div style="width:70%; font-size: 10pt; margin: 20px; float:left">';
echo "<p><b style='font-size: 10pt;'>".__('For a correct operation of PandoraFMS, PHP must be updated to version 7.0 or higher.').'</b></p>';
echo "<p style='font-size: 10pt;'><b>".__('Otherwise, functionalities will be lost.').'</b></p>';
echo '<div id="login_help_dialog" title="PHP UPDATE REQUIRED" class="invisible">';
echo '<div class="login_help_dialog">';
echo "<p><b class='font_10'>".__('For a correct operation of PandoraFMS, PHP must be updated to version 7.0 or higher.').'</b></p>';
echo "<p class='font_10'><b>".__('Otherwise, functionalities will be lost.').'</b></p>';
echo '<ul>';
echo "<li style='padding:5px;'>".__('Report download in PDF format').'</li>';
echo "<li style='padding:5px;'>".__('Emails Sending').'</li>';
echo "<li style='padding:5px;'>".__('Metaconsole Collections').'</li>';
echo "<li style='padding:5px;'>".'...'.'</li>';
echo "<li class='pdd_5px'>".__('Report download in PDF format').'</li>';
echo "<li class='pdd_5px'>".__('Emails Sending').'</li>';
echo "<li class='pdd_5px'>".__('Metaconsole Collections').'</li>';
echo "<li class='pdd_5px'>".'...'.'</li>';
echo '</ul>';
echo '<p><a target="blank" href="'.$url_help.'"><b>'.__('Access Help').'</b></a></p>';
echo '</div>';
echo "<div style='margin-top: 80px;'>";
echo "<div class='mrg_top_80'>";
echo html_print_image('images/icono_warning_mr.png', true, ['alt' => __('Warning php version'), 'border' => 0]);
echo '</div>';
echo '</div>';

View File

@ -192,7 +192,7 @@ if (!$double_auth_enabled && $config['2FA_all_users'] != ''
&& $config['2Fa_auth'] != '1'
&& $config['double_auth_enabled']
) {
echo '<div id="doble_auth_window" style="display: none"; >';
echo '<div id="doble_auth_window" class="invisible"; >';
?>
<script type="text/javascript">
var userID = "<?php echo $config['id_user']; ?>";
@ -234,8 +234,8 @@ if (!$double_auth_enabled && $config['2FA_all_users'] != ''
}
});
$("div#doble_auth_window").dialog({
<?php config_update_value('2Fa_auth', ''); ?>
$("div#doble_auth_window").dialog({
resizable: true,
draggable: true,
modal: true,
@ -247,12 +247,6 @@ if (!$double_auth_enabled && $config['2FA_all_users'] != ''
width: 500,
height: 400,
close: function (event, ui) {
<?php
if (!$double_auth_enabled) {
config_update_value('2Fa_auth', '1');
}
?>
// Abort the ajax request
if (typeof request != 'undefined'){
request.abort();
@ -263,7 +257,11 @@ if (!$double_auth_enabled && $config['2FA_all_users'] != ''
//document.location.reload();
}
})
.show(); </script>
.show();
// Don't allow close the dialog with X button
$('.ui-dialog-titlebar-close').css('display', 'none');
</script>
<?php
echo '</div>';
}

View File

@ -142,7 +142,7 @@ unset($filter['offset']);
if (! is_ajax()) {
echo '<div id="agents_loading" class="loading invisible">';
echo html_print_image('images/spinner.png', true);
echo html_print_image('images/spinner.gif', true);
echo __('Loading').'&hellip;';
echo '</div>';
}

View File

@ -35,8 +35,21 @@ $filter_ip = (string) get_parameter('filter_ip');
$filter_query = '&filter_type='.$filter_type.'&filter_user='.$filter_user.'&filter_text='.$filter_text.'&filter_period='.$filter_period.'&filter_ip='.$filter_ip;
$csv_url = ui_get_full_url(false, false, false, false).'index.php?sec=gextensions&sec2=godmode/audit_log_csv'.$filter_query;
$csv_img = html_print_image('images/csv_mc.png', true, ['title' => __('Export to CSV')]);
$csv_url = ui_get_full_url(
false,
false,
false,
false
).'index.php?sec=gextensions&sec2=godmode/audit_log_csv'.$filter_query;
$csv_img = html_print_image(
'images/csv.png',
true,
[
'title' => __(
'Export to CSV'
),'class' => 'invert_filter',
]
);
$header_buttons = [
'csv' => [
'active' => false,

View File

@ -22,7 +22,7 @@ require_once 'include/functions_agents.php';
ui_require_javascript_file('openlayers.pandora');
echo "<div style='margin-bottom: 10px;'></div>";
echo "<div class='margin-bottom-10'></div>";
$agentData = gis_get_data_last_position_agent($id_agente);
$updateGisData = db_get_value('update_gis_data', 'tagente', 'id_agente', $id_agente);
@ -32,7 +32,7 @@ $agent_name = agents_get_name($id_agente);
$agent_name = md5($agent_name);
// Map with the current position
echo '<div id="'.$agent_name.'_agent_map" style="border:1px solid black; width:100%; height: 30em;"></div>';
echo '<div id="'.$agent_name.'_agent_map" class="agent_map"></div>';
if (!gis_get_agent_map($id_agente, '500px', '100%', false)) {
ui_print_error_message(__('There is no default map. Please go to the setup for to set a default map.'));
@ -122,15 +122,15 @@ $table->data[2][1] = html_print_input_text_extended(
);
$table->data[2][2] = __('Ignore new GIS data:');
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente;
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();'>";
html_print_input_hidden('update_gis', 1);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'; float: left;">';
echo '<div class="action-buttons float-left" style="width: '.$table->width.';">';
html_print_submit_button(__('Update'), '', false, 'class="sub upd"');
echo '</div>';
echo '</form>';

View File

@ -135,4 +135,4 @@ echo '</div>';
unset($table);
echo '<br><br>';
echo '<div style="clear:both">&nbsp;</div>';
echo '<div id="both">&nbsp;</div>';

View File

@ -147,6 +147,8 @@ if (is_ajax()) {
return;
}
ui_require_javascript_file('openlayers.pandora');
$new_agent = (empty($id_agente)) ? true : false;
@ -207,11 +209,11 @@ $custom_id_div .= html_print_input_text(
if (!$new_agent && $alias != '') {
$table_agent_name = '<div class="label_select"><p class="input_label">'.__('Agent name').'</p>';
$table_agent_name .= '<div class="label_select_parent">';
$table_agent_name .= '<div class="label_select_child_left" style="width: 60%;">'.html_print_input_text('agente', $nombre_agente, '', 50, 100, true).'</div>';
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name" style="width: 70%;">';
$table_agent_name .= '<div class="label_select_child_left w60p">'.html_print_input_text('agente', $nombre_agente, '', 50, 100, true).'</div>';
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name w70p">';
if ($id_agente) {
$table_agent_name .= '<label>'.__('ID').'</label><input style="width: 50%;" type="text" readonly value="'.$id_agente.'" />';
$table_agent_name .= '<label>'.__('ID').'</label><input class="w50p" type="text" readonly value="'.$id_agente.'" />';
$table_agent_name .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
$table_agent_name .= html_print_image(
'images/zoom.png',
@ -219,6 +221,7 @@ if (!$new_agent && $alias != '') {
[
'border' => 0,
'title' => __('Agent detail'),
'class' => 'invert_filter',
]
);
$table_agent_name .= '</a>';
@ -228,7 +231,14 @@ if (!$new_agent && $alias != '') {
// Delete link from here.
if (!is_central_policies_on_node()) {
$table_agent_name .= "<a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=".$id_agente."&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
$table_agent_name .= "<a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=".$id_agente."&search=&offset=0&sort_field=&sort=none'>".html_print_image(
'images/cross.png',
true,
[
'title' => __('Delete agent'),
'class' => 'invert_filter',
]
).'</a>';
}
// Remote configuration available.
@ -245,6 +255,7 @@ if (!$new_agent && $alias != '') {
[
'border' => 0,
'title' => __('This agent can be remotely configured'),
'class' => 'invert_filter',
]
);
$table_agent_name .= '</a>';
@ -578,6 +589,7 @@ if (enterprise_installed()) {
[
'title' => __('Delete remote configuration file'),
'style' => 'vertical-align: middle;',
'class' => 'invert_filter',
]
).'</a>';
$table_adv_remote .= '</a>';
@ -736,11 +748,11 @@ $table_adv_agent_icon = '<div class="label_select"><p class="input_label">'.__('
if ($icon_path == '') {
$display_icons = 'none';
// Hack to show no icon. Use any given image to fix not found image errors.
$path_without = 'images/spinner.png';
$path_default = 'images/spinner.png';
$path_ok = 'images/spinner.png';
$path_bad = 'images/spinner.png';
$path_warning = 'images/spinner.png';
$path_without = 'images/spinner.gif';
$path_default = 'images/spinner.gif';
$path_ok = 'images/spinner.gif';
$path_bad = 'images/spinner.gif';
$path_warning = 'images/spinner.gif';
} else {
$display_icons = '';
$path_without = $path.$icon_path.'.default.png';
@ -794,7 +806,7 @@ if ($config['activate_gis']) {
if (enterprise_installed()) {
$advanced_div = '<div class="secondary_groups_list">';
} else {
$advanced_div = '<div class="secondary_groups_list" style="display: none">';
$advanced_div = '<div class="secondary_groups_list invisible" >';
}
// General display distribution.
@ -913,7 +925,7 @@ foreach ($fields as $field) {
2,
65,
$custom_value,
'style="min-height: 30px;"',
'class="min-height-30px',
true
);
}
@ -988,18 +1000,18 @@ if (enterprise_installed()) {
);
}
echo '<div class="action-buttons" style="display: flex; justify-content: flex-end; align-items: center; width: '.$table->width.'">';
echo '<div class="action-buttons agent_manager" style="width: '.$table->width.'">';
echo '</div>';
}
echo '<div class="action-buttons" style="display: flex; justify-content: flex-end; align-items: center; width: '.$table->width.'">';
echo '<div class="action-buttons agent_manager" style="width: '.$table->width.'">';
// The context help about the learning mode.
if ($modo == 0) {
echo "<span id='modules_not_learning_mode_context_help' style='padding-right:8px;'>";
echo "<span id='modules_not_learning_mode_context_help pdd_r_10px' '>";
} else {
echo "<span id='modules_not_learning_mode_context_help' style='display: none;'>";
echo "<span id='modules_not_learning_mode_context_help invisible'>";
}
echo clippy_context_help('modules_not_learning_mode');

View File

@ -179,11 +179,11 @@ foreach ($nps as $row) {
}
echo '<table width="100%" cellpadding="0" cellspacing="0" class="databox filters" >';
echo "<tr><td class='datos' style='width:50%'>";
echo "<tr><td class='datos w50p'>";
html_print_select($select, 'template_id', '', '', '', 0, false, false, true, '', false, 'max-width: 200px !important');
echo '</td>';
echo '<td class="datos">';
html_print_submit_button(__('Assign'), 'crt', false, 'class="sub next" style="margin-top:0px;"');
html_print_submit_button(__('Assign'), 'crt', false, 'class="sub next mgn_tp_0"');
echo '</td>';
echo '</tr>';
echo '</form>';
@ -246,7 +246,7 @@ foreach ($result as $row) {
$data[0] = '<span>'.$row['nombre'];
if ($row['id_tipo_modulo'] > 0) {
$data[1] = html_print_image('images/'.modules_show_icon_type($row['id_tipo_modulo']), true, ['border' => '0']);
$data[1] = html_print_image('images/'.modules_show_icon_type($row['id_tipo_modulo']), true, ['border' => '0', 'class' => 'invert_filter']);
} else {
$data[1] = '';
}
@ -254,8 +254,8 @@ foreach ($result as $row) {
$data[2] = mb_substr($row['descripcion'], 0, 60);
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update')]).'</a>';
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter', 'border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['class' => 'invert_filter', 'border' => '0', 'alt' => __('Update')]).'</a>';
array_push($table->data, $data);
}

View File

@ -366,7 +366,14 @@ $img_style = [
if ($id_agente) {
// View tab.
$viewtab['text'] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">'.html_print_image('images/operation.png', true, ['title' => __('View')]).'</a>';
$viewtab['text'] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/operation.png',
true,
[
'title' => __('View'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'view') {
$viewtab['active'] = true;
@ -377,7 +384,14 @@ if ($id_agente) {
$viewtab['operation'] = 1;
// Main tab.
$maintab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=main&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup')]).'</a>';
$maintab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=main&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/gm_setup.png',
true,
[
'title' => __('Setup'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'main') {
$maintab['active'] = true;
} else {
@ -385,7 +399,14 @@ if ($id_agente) {
}
// Module tab.
$moduletab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=module&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_modules.png', true, ['title' => __('Modules')]).'</a>';
$moduletab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=module&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/module.png',
true,
[
'title' => __('Modules'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'module') {
$moduletab['active'] = true;
@ -394,7 +415,14 @@ if ($id_agente) {
}
// Alert tab.
$alerttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=alert&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_alerts.png', true, ['title' => __('Alerts')]).'</a>';
$alerttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=alert&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/bell.png',
true,
[
'title' => __('Alerts'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'alert') {
$alerttab['active'] = true;
@ -403,7 +431,14 @@ if ($id_agente) {
}
// Template tab.
$templatetab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=template&amp;id_agente='.$id_agente.'">'.html_print_image('images/templates.png', true, ['title' => __('Module templates')]).'</a>';
$templatetab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=template&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/templates.png',
true,
[
'title' => __('Module templates'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'template') {
$templatetab['active'] = true;
@ -446,7 +481,14 @@ if ($id_agente) {
}
// Group tab.
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image('images/group.png', true, [ 'title' => __('Group')]).'</a>';
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image(
'images/group.png',
true,
[
'title' => __('Group'),
'class' => 'invert_filter',
]
).'</a>';
$grouptab['active'] = false;
@ -454,7 +496,14 @@ if ($id_agente) {
// GIS tab.
if ($config['activate_gis']) {
$gistab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente.'">'.html_print_image('images/gm_gis.png', true, [ 'title' => __('GIS data')]).'</a>';
$gistab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente.'">'.html_print_image(
'images/gm_gis.png',
true,
[
'title' => __('GIS data'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'gis') {
$gistab['active'] = true;
@ -464,18 +513,46 @@ if ($id_agente) {
}
// Agent wizard tab.
$agent_wizard['text'] = '<a href="javascript:" class="agent_wizard_tab">'.html_print_image('images/wand_agent.png', true, [ 'title' => __('Agent wizard')]).'</a>';
$agent_wizard['text'] = '<a href="javascript:" class="agent_wizard_tab">'.html_print_image(
'images/wand_agent.png',
true,
[
'title' => __('Agent wizard'),
'class' => 'invert_filter',
]
).'</a>';
// Hidden subtab layer.
$agent_wizard['sub_menu'] = '<ul class="mn subsubmenu" style="display:none; float:none;">';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">'.html_print_image('images/wand_snmp.png', true, [ 'title' => __('SNMP Wizard')]).'</a>';
$agent_wizard['sub_menu'] = '<ul class="mn subsubmenu invisible float-none">';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode center">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">'.html_print_image(
'images/wand_snmp.png',
true,
[
'title' => __('SNMP Wizard'),
'class' => 'invert_filter',
]
).'</a>';
$agent_wizard['sub_menu'] .= '</li>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente='.$id_agente.'">'.html_print_image('images/wand_interfaces.png', true, [ 'title' => __('SNMP Interfaces wizard')]).'</a>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode center">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente='.$id_agente.'">'.html_print_image(
'images/wand_interfaces.png',
true,
[
'title' => __('SNMP Interfaces wizard'),
'class' => 'invert_filter',
]
).'</a>';
$agent_wizard['sub_menu'] .= '</li>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente='.$id_agente.'">'.html_print_image('images/wand_wmi.png', true, [ 'title' => __('WMI Wizard')]).'</a>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode center" >';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente='.$id_agente.'">'.html_print_image(
'images/wand_wmi.png',
true,
[
'title' => __('WMI Wizard'),
'class' => 'invert_filter',
]
).'</a>';
$agent_wizard['sub_menu'] .= '</li>';
$agent_wizard['sub_menu'] .= '</ul>';
@ -495,7 +572,10 @@ if ($id_agente) {
$remote_configuration_tab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=remote_configuration&amp;id_agente='.$id_agente.'&amp;disk_conf='.$agent_md5.'">'.html_print_image(
'images/remote_configuration.png',
true,
['title' => __('Remote configuration')]
[
'title' => __('Remote configuration'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'remote_configuration') {
$remote_configuration_tab['active'] = true;
@ -706,7 +786,7 @@ if ($id_agente) {
// Create agent.
ui_print_page_header(
__('Agent manager'),
'images/bricks.png',
'images/agent.png',
false,
'create_agent',
true,
@ -2383,7 +2463,7 @@ switch ($tab) {
width: 600,
title: 'Changing the module name of a satellite agent',
open: function(){
$('#dialog').html('<br><table><tr><td><img src="images/icono-warning-triangulo.png" style="float:left;margin-left:25px;"></td><td><p style="float:right;font-style:nunito;font-size:11pt;margin-right:50px;margin-left:40px;"><span style="font-weight:bold;font-size:12pt;">Warning</span> <br>The names of the modules of a satellite should not be altered manually. Unless you are absolutely certain of the process, do not alter these names.</p></td></tr></table>');
$('#dialog').html('<br><table><tr><td><img src="images/icono-warning-triangulo.png" class="float-left mrgn_lft_25px"></td><td><p id="p_configurar_agente" ><span class="font_bold font_12pt">Warning</span> <br>The names of the modules of a satellite should not be altered manually. Unless you are absolutely certain of the process, do not alter these names.</p></td></tr></table>');
},
buttons: [{
text: "Ok",
@ -2417,7 +2497,7 @@ switch ($tab) {
width: 650,
title: 'Changing snmp module name',
open: function(){
$('#dialog').html('<br><table><tr><td><img src="images/icono-warning-triangulo.png" style="float:left;margin-left:25px;margin-top:30px;"></td><td><p style="float:right;font-style:nunito;font-size:11pt;margin-right:50px;margin-left:40px;"><span style="font-weight:bold;font-size:12pt;">Warning</span> <br> If you change the name of this module, various features associated with this module, such as network maps, interface graphs or other network modules, may no longer work. If you are not completely sure of the process, please do not change the name of the module. </p></td></tr></table>');
$('#dialog').html('<br><table><tr><td><img src="images/icono-warning-triangulo.png" class="warning_triangulo"></td><td><p id="p_configurar_agente"><span class="font_bold font_12pt">Warning</span> <br> If you change the name of this module, various features associated with this module, such as network maps, interface graphs or other network modules, may no longer work. If you are not completely sure of the process, please do not change the name of the module. </p></td></tr></table>');
},
buttons: [{
text: "Ok",

View File

@ -49,20 +49,20 @@ $table->style[2] = 'font-weight: bold';
$table->style[4] = 'font-weight: bold';
$table->style[6] = 'font-weight: bold';
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
echo '</div>';
echo "<div id='message_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot unset the enable combo until you clear the combo values and click on update.').'</p>';
echo "<div id='message_set_combo' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('You cannot unset the enable combo until you clear the combo values and click on update.').'</p>';
echo '</div>';
echo "<div id='message_no_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Enabled combo the Password type will be disabled.').'</p>';
echo "<div id='message_no_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('If you select Enabled combo the Password type will be disabled.').'</p>';
echo '</div>';
echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>';

View File

@ -141,14 +141,18 @@ foreach ($fields as $field) {
$data[1] = '<b>'.$field['name'].'</b>';
if ($field['display_on_front']) {
$data[2] = html_print_image('images/tick.png', true);
$data[2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} else {
$data[2] = html_print_image('images/icono_stop.png', true, ['style' => 'width:21px;height:21px;']);
$data[2] = html_print_image(
'images/icono_stop.png',
true,
['style' => 'width:21px;height:21px;']
);
}
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">'.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0']).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).'</a>';
$data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">'.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0', 'class' => 'invert_filter']).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0', 'class' => 'invert_filter']).'</a>';
array_push($table->data, $data);
}

View File

@ -32,7 +32,16 @@ if (($ag_group == -1) && ($group_id != 0)) {
$ag_group = $group_id;
}
if (! check_acl($config['id_user'], 0, 'AW') && ! check_acl($config['id_user'], 0, 'AD')) {
if (! check_acl(
$config['id_user'],
0,
'AW'
) && ! check_acl(
$config['id_user'],
0,
'AD'
)
) {
db_pandora_audit(
'ACL Violation',
'Trying to access agent manager'
@ -51,7 +60,14 @@ $search = get_parameter('search', '');
$tab = 'view';
// Setup tab.
$viewtab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente">'.html_print_image('images/operation.png', true, ['title' => __('View')]).'</a>';
$viewtab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente">'.html_print_image(
'images/eye_show.png',
true,
[
'title' => __('View'),
'class' => 'invert_filter',
]
).'</a>';
$viewtab['operation'] = true;
@ -60,10 +76,19 @@ $viewtab['active'] = false;
$onheader = ['view' => $viewtab];
// Header.
ui_print_page_header(__('Agents defined in %s', get_product_name()), 'images/agent_mc.png', false, '', true, $onheader);
ui_print_page_header(
__('Agents defined in %s', get_product_name()),
'images/agent.png',
false,
'',
true,
$onheader
);
if (is_central_policies_on_node()) {
ui_print_warning_message(__('This node is configured with centralized mode. To delete an agent go to metaconsole.'));
ui_print_warning_message(
__('This node is configured with centralized mode. To delete an agent go to metaconsole.')
);
}
// Perform actions.
@ -72,9 +97,13 @@ $enable_agent = (int) get_parameter('enable_agent');
$disable_agent = (int) get_parameter('disable_agent');
if ($disable_agent != 0) {
$server_name = db_get_row_sql('select server_name from tagente where id_agente = '.$disable_agent);
$server_name = db_get_row_sql(
'select server_name from tagente where id_agente = '.$disable_agent
);
} else if ($enable_agent != 0) {
$server_name = db_get_row_sql('select server_name from tagente where id_agente = '.$enable_agent);
$server_name = db_get_row_sql(
'select server_name from tagente where id_agente = '.$enable_agent
);
}
@ -100,32 +129,68 @@ if ($agent_to_delete) {
exit;
}
ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.'));
ui_print_result_message(
$result,
__('Success deleted agent.'),
__('Could not be deleted.')
);
if (enterprise_installed()) {
// Check if the remote config file still exist.
if (isset($config['remote_config'])) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', [$id_agente])) {
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
enterprise_include_once(
'include/functions_config_agents.php'
);
if (enterprise_hook(
'config_agents_has_remote_configuration',
[$id_agente]
)
) {
ui_print_error_message(
__('Maybe the files conf or md5 could not be deleted')
);
}
}
}
}
if ($enable_agent) {
$result = db_process_sql_update('tagente', ['disabled' => 0], ['id_agente' => $enable_agent]);
$result = db_process_sql_update(
'tagente',
['disabled' => 0],
['id_agente' => $enable_agent]
);
$alias = io_safe_output(agents_get_alias($enable_agent));
if ($result) {
// Update the agent from the metaconsole cache.
enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 0];
enterprise_hook('agent_update_from_cache', [$enable_agent, $values, $server_name]);
enterprise_hook('config_agents_update_config_token', [$enable_agent, 'standby', 0]);
db_pandora_audit('Agent management', 'Enable '.$alias);
enterprise_hook(
'agent_update_from_cache',
[
$enable_agent,
$values,
$server_name,
]
);
enterprise_hook(
'config_agents_update_config_token',
[
$enable_agent,
'standby',
0,
]
);
db_pandora_audit(
'Agent management',
'Enable '.$alias
);
} else {
db_pandora_audit('Agent management', 'Fail to enable '.$alias);
db_pandora_audit(
'Agent management',
'Fail to enable '.$alias
);
}
ui_print_result_message(
@ -143,12 +208,32 @@ if ($disable_agent) {
// Update the agent from the metaconsole cache.
enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 1];
enterprise_hook('agent_update_from_cache', [$disable_agent, $values, $server_name]);
enterprise_hook('config_agents_update_config_token', [$disable_agent, 'standby', 1]);
enterprise_hook(
'agent_update_from_cache',
[
$disable_agent,
$values,
$server_name,
]
);
enterprise_hook(
'config_agents_update_config_token',
[
$disable_agent,
'standby',
1,
]
);
db_pandora_audit('Agent management', 'Disable '.$alias);
db_pandora_audit(
'Agent management',
'Disable '.$alias
);
} else {
db_pandora_audit('Agent management', 'Fail to disable '.$alias);
db_pandora_audit(
'Agent management',
'Fail to disable '.$alias
);
}
ui_print_result_message(
@ -158,7 +243,7 @@ if ($disable_agent) {
);
}
echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
echo "<table cellpadding='4' cellspacing='4' class='databox filters font_bold margin-bottom-10' width='100%'>
<tr>";
echo "<form method='post'
action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'>";
@ -167,14 +252,33 @@ echo '<td>';
echo __('Group').'&nbsp;';
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_acl($config['id_user'], 0, 'AW')) {
if (!$own_info['is_admin'] && !check_acl(
$config['id_user'],
0,
'AR'
) && !check_acl($config['id_user'], 0, 'AW')
) {
$return_all_group = false;
} else {
$return_all_group = true;
}
echo '<div class="w250px inline">';
html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false);
html_print_select_groups(
false,
'AR',
$return_all_group,
'ag_group',
$ag_group,
'this.form.submit();',
'',
0,
false,
false,
true,
'',
false
);
echo '</div>';
echo '<td>';
echo __('Show Agents').'&nbsp;';
@ -183,14 +287,21 @@ $fields = [
1 => __('Only disabled'),
0 => __('Only enabled'),
];
html_print_select($fields, 'disabled', $disabled, 'this.form.submit()');
html_print_select(
$fields,
'disabled',
$disabled,
'this.form.submit()'
);
echo '</td>';
echo '<td>';
echo __('Operative System').'&nbsp;';
$pre_fields = db_get_all_rows_sql('select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os');
$pre_fields = db_get_all_rows_sql(
'select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os'
);
$fields = [];
foreach ($pre_fields as $key => $value) {
@ -203,13 +314,23 @@ echo '</td>';
echo '<td>';
echo __('Recursion').'&nbsp;';
html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()');
html_print_checkbox(
'recursion',
1,
$recursion,
false,
false,
'this.form.submit()'
);
echo '</td><td>';
echo __('Search').'&nbsp;';
html_print_input_text('search', $search, '', 12);
echo ui_print_help_tip(__('Search filter by alias, name, description, IP address or custom fields content'), true);
echo ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'),
true
);
echo '</td><td>';
echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>";
@ -495,7 +616,7 @@ if ($agents !== false) {
echo '<th>'.__('Type').'</th>';
echo '<th>'.__('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown).'</th>';
echo '<th>'.__('Description').'</th>';
echo "<th style='text-align:left'>".__('Actions').'</th>';
echo "<th class='context_help_body'>".__('Actions').'</th>';
echo '</tr></thead>';
$color = 1;
@ -503,16 +624,35 @@ if ($agents !== false) {
$iterator = 0;
foreach ($agents as $agent) {
// Begin Update tagente.remote 0/1 with remote agent function return.
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
db_process_sql_update('tagente', ['remote' => 1], 'id_agente = '.$agent['id_agente'].'');
if (enterprise_hook(
'config_agents_has_remote_configuration',
[$agent['id_agente']]
)
) {
db_process_sql_update(
'tagente',
['remote' => 1],
'id_agente = '.$agent['id_agente'].''
);
} else {
db_process_sql_update('tagente', ['remote' => 0], 'id_agente = '.$agent['id_agente'].'');
}
// End Update tagente.remote 0/1 with remote agent function return.
$all_groups = agents_get_all_groups_agent($agent['id_agente'], $agent['id_grupo']);
$check_aw = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW');
$check_ad = check_acl_one_of_groups($config['id_user'], $all_groups, 'AD');
$all_groups = agents_get_all_groups_agent(
$agent['id_agente'],
$agent['id_grupo']
);
$check_aw = check_acl_one_of_groups(
$config['id_user'],
$all_groups,
'AW'
);
$check_ad = check_acl_one_of_groups(
$config['id_user'],
$all_groups,
'AD'
);
$cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']);
@ -593,16 +733,28 @@ if ($agents !== false) {
if ($agent['quiet']) {
echo '&nbsp;';
html_print_image('images/dot_blue.png', false, ['border' => '0', 'title' => __('Quiet'), 'alt' => '']);
html_print_image(
'images/dot_blue.png',
false,
[
'border' => '0',
'title' => __('Quiet'),
'alt' => '',
]
);
}
if ($in_planned_downtime) {
ui_print_help_tip(__('Agent in planned downtime'), false, 'images/minireloj-16.png');
ui_print_help_tip(
__('Agent in planned downtime'),
false,
$config['image']['minireloj_16']
);
echo '</em>';
}
echo '</span><div class="left actions" style="visibility: hidden; clear: left">';
echo '</span><div class="left actions clear_left">';
if ($check_aw) {
if ($agent['id_os'] == CLUSTER_OS_ID) {
if (enterprise_installed()) {
@ -664,7 +816,15 @@ if ($agents !== false) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
echo "<a href='index.php?".'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=remote_configuration&'.'id_agente='.$agent['id_agente']."&disk_conf=1'>";
echo html_print_image('images/application_edit.png', true, ['align' => 'middle', 'title' => __('Edit remote config')]);
echo html_print_image(
'images/application_edit.png',
true,
[
'align' => 'middle',
'title' => __('Edit remote config'),
'class' => 'invert_filter',
]
);
echo '</a>';
}
}
@ -702,7 +862,7 @@ if ($agents !== false) {
$offsetArg = $offset;
}
echo "<td class='$tdcolor action_buttons' align='left' style='width:7%' valign='middle'>";
echo "<td class='$tdcolor action_buttons' align='left' width=7% valign='middle'>";
if ($agent['disabled']) {
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
@ -724,7 +884,7 @@ if ($agents !== false) {
echo ' onClick="if (!confirm(\' '.__('You are going to disable a cluster agent. Are you sure?').'\')) return false;">';
}
echo html_print_image('images/lightbulb.png', true, ['alt' => __('Disable agent'), 'title' => __('Disable agent')]).'</a>';
echo html_print_image('images/lightbulb.png', true, ['alt' => __('Disable agent'), 'title' => __('Disable agent'), 'class' => 'invert_filter']).'</a>';
}
if ($check_aw && !is_central_policies_on_node()) {
@ -737,7 +897,7 @@ if ($agents !== false) {
echo ' onClick="if (!confirm(\' '.__('WARNING! - You are going to delete a cluster agent. Are you sure?').'\')) return false;">';
}
echo html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
echo html_print_image('images/cross.png', true, ['border' => '0', 'class' => 'invert_filter']).'</a>';
}
echo '</td>';
@ -752,7 +912,7 @@ if ($agents !== false) {
if (check_acl($config['id_user'], 0, 'AW')) {
// Create agent button.
echo '<div style="text-align: right;">';
echo '<div class="action-buttons">';
echo '<form method="post" action="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente">';
html_print_submit_button(
__('Create agent'),

View File

@ -45,7 +45,7 @@ if (!isset($policy_page)) {
echo '<form id="create_module_type" method="post" action="'.$url.'">';
echo '<table width="100%" cellpadding="2" cellspacing="2" class="databox filters" >';
echo "<tr><td class='datos' style='width:20%; font-weight: bold;'>";
echo "<tr><td class='datos bolder w20p'>";
echo __('Search').' '.html_print_input_text(
'search_string',
$search_string,
@ -63,10 +63,10 @@ if (($policy_page) || (isset($agent))) {
}
echo '</td>';
echo "<td class='datos' style='width:10%'>";
echo "<td class='datos w10p'>";
html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"');
echo '</td>';
echo "<td class='datos' style='width:10%'></td>";
echo "<td class='datos w10p'></td>";
echo '</form>';
// Check if there is at least one server of each type available to assign that
// kind of modules. If not, do not show server type in combo.
@ -162,7 +162,7 @@ if (($policy_page) || (isset($agent))) {
// Create module/type combo.
echo '<form id="create_module_type" method="post" action="'.$url.'">';
if (!$policy_page) {
echo '<td class="datos" style="font-weight: bold; width:20%;">';
echo '<td class="datos w20p bolder">';
echo __('Show in hierachy mode');
if ($checked == 'true') {
$checked = true;
@ -181,7 +181,7 @@ if (($policy_page) || (isset($agent))) {
echo '</td>';
}
echo '<td class="datos" style="font-weight: bold; width:20%;">';
echo '<td class="datos w20p bolder">';
echo __('<p>Type</p>');
html_print_select(
$modules,
@ -199,7 +199,7 @@ if (($policy_page) || (isset($agent))) {
);
html_print_input_hidden('edit_module', 1);
echo '</td>';
echo '<td class="datos" style="width:10%;">';
echo '<td class="datos w10p">';
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('Create').'">';
echo '</td>';
echo '</tr>';
@ -210,9 +210,9 @@ if (($policy_page) || (isset($agent))) {
echo '</table>';
if (!$config['disable_help']) {
echo '<div style="text-align: right; width: 100%;padding-top:10px;padding-bottom:10px">';
echo '<div class="disable_help">';
echo '<strong>';
echo "<a style='color: #373737;' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
echo "<a class='color-black-grey' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
echo '</strong>';
echo '</div>';
}
@ -222,9 +222,9 @@ if (! isset($id_agente)) {
}
$multiple_delete = (bool) get_parameter('multiple_delete');
$module_action = (string) get_parameter('module_action');
if ($multiple_delete) {
if ($module_action === 'delete') {
$id_agent_modules_delete = (array) get_parameter('id_delete');
$count_correct_delete_modules = 0;
@ -400,23 +400,63 @@ if ($multiple_delete) {
if ($count_correct_delete_modules == 0) {
ui_print_error_message(
sprintf(
__('There was a problem deleting %s modules, none deleted.'),
__('There was a problem completing the operation. Applied to 0/%d modules.'),
$count_modules_to_delete
)
);
} else {
if ($count_correct_delete_modules == $count_modules_to_delete) {
ui_print_success_message(__('All Modules deleted succesfully'));
ui_print_success_message(__('Operation finished successfully.'));
} else {
ui_print_error_message(
sprintf(
__('There was a problem only deleted %s modules of %s total.'),
count_correct_delete_modules,
__('There was a problem completing the operation. Applied to %d/%d modules.'),
$count_correct_delete_modules,
$count_modules_to_delete
)
);
}
}
} else if ($module_action === 'disable') {
$id_agent_modules_disable = (array) get_parameter('id_delete');
$count_correct_delete_modules = 0;
$updated_count = 0;
foreach ($id_agent_modules_disable as $id_agent_module_disable) {
$sql = sprintf(
'UPDATE tagente_modulo
SET disabled = 1
WHERE id_agente_modulo = %d',
$id_agent_module_disable
);
if (db_process_sql($sql)) {
$updated_count++;
}
}
$count_modules_to_disable = count($id_agent_modules_disable);
if ($updated_count === 0) {
ui_print_error_message(
sprintf(
__('There was a problem completing the operation. Applied to 0/%d modules.'),
$count_modules_to_disable
)
);
} else {
if ($updated_count == $count_modules_to_disable) {
ui_print_success_message(__('Operation finished successfully.'));
} else {
ui_print_error_message(
sprintf(
__('There was a problem completing the operation. Applied to %d/%d modules.'),
$updated_count,
$count_modules_to_disable
)
);
}
}
}
@ -845,6 +885,9 @@ foreach ($modules as $module) {
'id_delete[]',
$module['id_agente_modulo'],
false,
true,
false,
'',
true
);
}
@ -856,7 +899,10 @@ foreach ($modules as $module) {
$data[0] .= html_print_image(
'images/icono_escuadra.png',
true,
['style' => 'padding-bottom: inherit;']
[
'style' => 'padding-bottom: inherit;',
'class' => 'invert_filter',
]
).'&nbsp;&nbsp;';
}
@ -925,7 +971,7 @@ foreach ($modules as $module) {
$img = 'images/policies_brick.png';
$title = '('.__('Adopted').') '.$policyInfo['name_policy'];
} else {
$img = 'images/policies.png';
$img = 'images/policies_mc.png';
$title = $policyInfo['name_policy'];
}
} else {
@ -1035,6 +1081,7 @@ foreach ($modules as $module) {
[
'alt' => __('Disable module'),
'title' => __('Disable module'),
'class' => 'invert_filter',
]
).'</a>';
}
@ -1045,7 +1092,10 @@ foreach ($modules as $module) {
$data[8] .= html_print_image(
'images/copy.png',
true,
['title' => __('Duplicate')]
[
'title' => __('Duplicate'),
'class' => 'invert_filter',
]
);
$data[8] .= '</a> ';
@ -1054,9 +1104,12 @@ foreach ($modules as $module) {
if ($numericModules[$type] === true) {
$data[8] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&fix_module='.$module['id_agente_modulo'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image(
'images/chart_curve.png',
'images/chart.png',
true,
['title' => __('Normalize')]
[
'title' => __('Normalize'),
'class' => 'invert_filter',
]
);
$data[8] .= '</a>';
}
@ -1076,9 +1129,12 @@ foreach ($modules as $module) {
$data[8] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&create_network_from_module=1&id_agente='.$id_agente.'&create_module_from='.$module['id_agente_modulo'].'"
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image(
'images/network.png',
'images/op_network.png',
true,
['title' => __('Create network component')]
[
'title' => __('Create network component'),
'class' => 'invert_filter',
]
);
$data[8] .= '</a> ';
} else {
@ -1098,7 +1154,10 @@ foreach ($modules as $module) {
$data[9] .= html_print_image(
'images/cross.png',
true,
['title' => __('Delete')]
[
'title' => __('Delete'),
'class' => 'invert_filter',
]
);
$data[9] .= '</a> ';
}
@ -1123,12 +1182,29 @@ html_print_table($table);
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('multiple_delete', 1);
html_print_submit_button(
__('Delete'),
'multiple_delete',
html_print_input_hidden('submit_modules_action', 1);
html_print_select(
[
'disable' => 'Disable selected modules',
'delete' => 'Delete selected modules',
],
'module_action',
'',
'',
'',
0,
false,
'class="sub delete"'
false,
false
);
html_print_submit_button(
__('Execute action'),
'submit_modules_action',
false,
'class="sub next"'
);
echo '</div>';
echo '</form>';

View File

@ -19,7 +19,7 @@ require_once $config['homedir'].'/include/graphs/functions_d3.php';
include_javascript_d3();
function prepend_table_simple($row, $id=false)
global $config;function prepend_table_simple($row, $id=false)
{
global $table_simple;
@ -119,7 +119,7 @@ function add_component_selection($id_network_component_type)
);
$data[1] .= '</span>';
$data[1] .= ' <span id="component_loading" class="invisible">';
$data[1] .= html_print_image('images/spinner.png', true);
$data[1] .= html_print_image('images/spinner.gif', true);
$data[1] .= '</span>';
$table_simple->colspan['module_component'][1] = 3;
@ -210,7 +210,10 @@ if (!empty($id_agent_module) && isset($id_agente)) {
$table_simple->data[0][1] .= html_print_image(
'images/cross.png',
true,
['title' => __('Delete module')]
[
'title' => __('Delete module'),
'class' => 'invert_filter',
]
);
$table_simple->data[0][1] .= '</a> ';
}
@ -635,7 +638,14 @@ $table_advanced->data[3][1] = html_print_extended_select_for_time(
$classdisabledBecauseInPolicy,
$disabledBecauseInPolicy
);
$table_advanced->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image('images/cog.png', true, ['title' => __('Advanced options Dynamic Threshold')]).'</a>';
$table_advanced->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image(
'images/cog.png',
true,
[
'title' => __('Advanced options Dynamic Threshold'),
'class' => 'invert_filter',
]
).'</a>';
$table_advanced->cellclass[3][2] = 'hide_dinamic';
$table_advanced->cellclass[3][3] = 'hide_dinamic';
@ -717,6 +727,10 @@ $table_advanced->colspan[4][4] = 3;
// FF stands for Flip-flop.
$table_advanced->colspan[5][1] = 5;
$table_advanced->cellclass[5][1] = 'font_bold';
$table_advanced->data[5][0] = __('FF threshold').' ';
$table_advanced->data[5][1] .= __('Keep counters');
@ -933,10 +947,24 @@ if (!tags_has_user_acl_tags($config['id_user'])) {
}
}
$table_advanced->data[7][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module')]);
// html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
$table_advanced->data[7][2] .= '<br><br><br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'left', 'title' => __('Delete tags to module')]);
// html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));
$table_advanced->data[7][2] = html_print_image(
'images/darrowright.png',
true,
[
'id' => 'right',
'title' => __('Add tags to module'),
'class' => 'invert_filter',
]
);
$table_advanced->data[7][2] .= '<br><br><br><br>'.html_print_image(
'images/darrowleft.png',
true,
[
'id' => 'left',
'title' => __('Delete tags to module'),
'class' => 'invert_filter',
]
);
$table_advanced->data[7][3] = '<b>'.__('Tags selected').'</b>';
$table_advanced->data[7][4] = html_print_select_from_sql(
"SELECT a.id_tag, name
@ -1002,7 +1030,7 @@ $table_advanced->data[8][3] = __('Cascade Protection Services');
$table_advanced->colspan[8][4] = 3;
$table_advanced->data[8][4] = html_print_select($cps_array, 'cps_module', $cps_module, '', '', 0, true, false, true, '', $disabledBecauseInPolicy);
$textarea_custom_style = ' style="min-height: 0px;"';
$textarea_custom_style = ' class="min-height-0px"';
$table_advanced->data[9][0] = __('Description');
$table_advanced->colspan[9][1] = 6;
@ -1128,7 +1156,7 @@ $table_macros->data = [];
$table_macros->style = [];
$table_macros->style[0] = 'font-weight: bold;';
$table_macros->style[2] = 'font-weight: bold;';
$table_macros->style[5] = 'width: 10px';
$table_macros->style[5] = 'font-weight: bold;';
$table_macros->colspan = [];
$macro_count = 0;
@ -1140,7 +1168,7 @@ if (isset($module_macros)) {
$table_macros->data[$macro_count][2] = __('Value');
$table_macros->data[$macro_count][3] = html_print_input_text('module_macro_values[]', $macro_value, '', 50, 60, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
if (!$disabledBecauseInPolicy) {
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro('.$macro_count.');">'.html_print_image('images/cross.png', true).'</a>';
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro('.$macro_count.');">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
}
$macro_count++;
@ -1149,7 +1177,7 @@ if (isset($module_macros)) {
}
if (!$disabledBecauseInPolicy) {
$table_macros->data[$macro_count][0] = '<span>'.__('Custom macros').'</span> <a href="javascript:add_macro();">'.html_print_image('images/add.png', true).'</a>';
$table_macros->data[$macro_count][0] = '<span>'.__('Custom macros').'</span> <a href="javascript:add_macro();">'.html_print_image('images/add.png', true, ['class' => 'invert_filter']).'</a>';
$table_macros->colspan[$macro_count][0] = 5;
}
@ -1211,7 +1239,7 @@ $table_new_relations->data[0][6] = html_print_button(
'class="sub add"',
true
);
$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' style='display: inline;'></div>";
$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' class='inline_line'></div>";
// Relationship list.
$table_relations = new stdClass();
@ -1237,14 +1265,23 @@ $table_relations->data[-1][0] = '';
$table_relations->data[-1][1] = '';
$table_relations->data[-1][2] = '';
$table_relations->data[-1][3] = '<a id="disable_updates_button" class="alpha50" href="">';
$table_relations->data[-1][3] .= html_print_image('images/lock.png', true).'</a>';
$table_relations->data[-1][3] .= html_print_image(
'images/lock_mc.png',
true
).'</a>';
$table_relations->data[-1][4] = '<a id="delete_relation_button" href="">';
$table_relations->data[-1][4] .= html_print_image('images/cross.png', true).'</a>';
$table_relations->data[-1][4] .= html_print_image(
'images/cross.png',
true,
['class' => 'invert_filter']
).'</a>';
$relations_count = 0;
if ($id_agent_module) {
$module_relations = modules_get_relations(['id_module' => $id_agent_module]);
$module_relations = modules_get_relations(
['id_module' => $id_agent_module]
);
if (!$module_relations) {
$module_relations = [];
@ -1280,13 +1317,28 @@ if ($id_agent_module) {
// Agent name.
$table_relations->data[$relations_count][0] = $agent_name;
// Module name.
$table_relations->data[$relations_count][1] = "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$agent_id.'&tab=module&edit_module=1&id_agent_module='.$module_id."'>".ui_print_truncate_text($module_name, 'module_medium', true, true, true, '[&hellip;]').'</a>';
$table_relations->data[$relations_count][1] = "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$agent_id.'&tab=module&edit_module=1&id_agent_module='.$module_id."'>".ui_print_truncate_text(
$module_name,
'module_medium',
true,
true,
true,
'[&hellip;]'
).'</a>';
// Type.
$table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
// Lock relationship updates.
$table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/lock.png', true).'</a>';
$table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image(
'images/lock_mc.png',
true,
['class' => 'invert_filter']
).'</a>';
// Delete relationship.
$table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/cross.png', true).'</a>';
$table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image(
'images/cross.png',
true,
['class' => 'invert_filter']
).'</a>';
$relations_count++;
}
}
@ -1711,14 +1763,14 @@ function add_new_relation () {
'<td id="module_relations-' + relationsCount + '-0"><b>' + agent_b_name + '</b></td>' +
'<td id="module_relations-' + relationsCount + '-1">' + module_b_name + '</td>' +
'<td id="module_relations-' + relationsCount + '-2">' + relation_type + '</td>' +
'<td id="module_relations-' + relationsCount + '-3" style="width: 10%; text-align: center;">' +
'<td id="module_relations-' + relationsCount + '-3" class="w10p center">' +
'<a id="disable_updates_button" class="alpha50" href="javascript: change_lock_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/lock.png', true); ?>' +
'<?php echo html_print_image('images/lock_mc.png', true, ['class' => 'invert_filter']); ?>' +
'</a>' +
'</td>' +
'<td id="module_relations-' + relationsCount + '-4" style="width: 10%; text-align: center;">' +
'<td id="module_relations-' + relationsCount + '-4" class="w10p center">' +
'<a id="delete_relation_button" href="javascript: delete_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/cross.png', true); ?>' +
'<?php echo html_print_image('images/cross.png', true, ['class' => 'invert_filter']); ?>' +
'</a>' +
'</td>' +
'</tr>';

View File

@ -40,7 +40,7 @@ html_print_input_hidden(
'custom_action',
urlencode(
base64_encode(
'&nbsp;<a href="javascript:setOID()"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" style="vertical-align: middle;"></img></a>'
'&nbsp;<a href="javascript:setOID()"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" class="vertical_middle"></img></a>'
)
),
false
@ -225,7 +225,7 @@ push_table_simple($data, 'snmp_1');
$data = [];
$data[0] = __('SNMP OID');
$data[1] = '<span class="left"; style="width: 50%">';
$data[1] = '<span class="left w50p">';
$data[1] .= html_print_input_text(
'snmp_oid',
$snmp_oid,
@ -261,7 +261,7 @@ $data[1] .= html_print_image(
]
);
$data[1] .= '</span>';
$data[1] .= '</span><span class="right" style="width: 50%; text-align: right">';
$data[1] .= '</span><span class="right w50p right">';
$data[1] .= html_print_button(
__('SNMP walk'),
'snmp_walk',

View File

@ -71,7 +71,7 @@ if (!empty($id_plugin)) {
$preload = '';
}
$data[2] = '<span style="font-weight: normal;" id="plugin_description">'.$preload.'</span>';
$data[2] = '<span class="normal" id="plugin_description">'.$preload.'</span>';
push_table_simple($data, 'plugin_1');

View File

@ -108,7 +108,7 @@ if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
$data[0] = '';
}
$data[1] = '<div id="module_data" style="top:1em; float:left; width:50%;">';
$data[1] = '<div id="module_data" class="w50p float-left top-1em">';
$data[1] .= html_print_label(__('Agent'), 'agent_name', true).'<br/>';
// Get module and agent of the target prediction module

View File

@ -29,6 +29,8 @@
global $config;
check_login();
$agent_d = check_acl($config['id_user'], 0, 'AD');
@ -53,7 +55,10 @@ $buttons = [
'text' => "<a href='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>".html_print_image(
'images/list.png',
true,
['title' => __('List')]
[
'title' => __('List'),
'class' => 'invert_filter',
]
).'</a>',
];
@ -745,7 +750,7 @@ $days = array_combine(range(1, 31), range(1, 31));
$table->data[5][0] = __('Configure the time').'&nbsp;';
;
$table->data[5][1] = "
<div id='once_time' style='display: none;'>
<div id='once_time' class='invisible'>
<table>
<tr>
<td>".__('From:').'</td>
@ -757,7 +762,7 @@ $table->data[5][1] = "
</tr>
</table>
</div>
<div id='periodically_time' style='display: none;'>
<div id='periodically_time' class='invisible'>
<table>
<tr><td>".ui_get_using_system_timezone_warning().'</td></tr>
<tr>
@ -780,7 +785,7 @@ $table->data[5][1] = "
</tr>
<tr>
<td colspan='2'>
<table id='weekly_item' style='display: none;'>
<table id='weekly_item' class='invisible'>
<tr>
<td>".__('Mon').html_print_checkbox('monday', 1, $monday, true, $disabled_in_execution).'</td>
<td>'.__('Tue').html_print_checkbox('tuesday', 1, $tuesday, true, $disabled_in_execution).'</td>
@ -791,7 +796,7 @@ $table->data[5][1] = "
<td>'.__('Sun').html_print_checkbox('sunday', 1, $sunday, true, $disabled_in_execution)."</td>
</tr>
</table>
<table id='monthly_item' style='display: none;'>
<table id='monthly_item' class='invisible'>
<tr>
<td>".__('From day:').'</td>
<td>'.html_print_select(
@ -870,7 +875,7 @@ if ($id_downtime > 0) {
html_print_table($table);
html_print_input_hidden('id_agent', $id_agent);
echo '<div class="action-buttons" style="width: 100%">';
echo '<div class="action-buttons w100p" >';
if ($id_downtime > 0) {
html_print_input_hidden('update_downtime', 1);
html_print_input_hidden('id_downtime', $id_downtime);
@ -894,7 +899,7 @@ echo '</div>';
echo '</form>';
if ($id_downtime > 0) {
echo "<td valign=top style='width:300px;padding-left:20px;'>";
echo "<td valign=top class='w300px pdd_l_20px'>";
$filter_group = (int) get_parameter('filter_group', 0);
@ -950,9 +955,9 @@ if ($id_downtime > 0) {
echo html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, false, true, true, '', false, 'width: 180px;');
if ($type_downtime != 'quiet') {
echo '<div id="available_modules_selection_mode" style="padding-top:20px;display: none;">';
echo '<div id="available_modules_selection_mode" class="invisible pdd_l_20px">';
} else {
echo '<div id="available_modules_selection_mode" style="padding-top:20px">';
echo '<div id="available_modules_selection_mode" class="pdd_l_20px">';
}
html_print_input_hidden('all_common_modules', '');
@ -981,9 +986,9 @@ if ($id_downtime > 0) {
).'</h4>';
if ($type_downtime != 'quiet') {
echo '<div id="available_modules" style="display: none;">';
echo '<div id="available_modules" class="invisible">';
} else {
echo '<div id="available_modules" style="">';
echo '<div id="available_modules" >';
}
echo html_print_select(
@ -1089,10 +1094,25 @@ if ($id_downtime > 0) {
if ($type_downtime != 'disable_agents_alerts'
&& $type_downtime != 'disable_agents'
) {
$data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
$data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image(
'images/config.png',
true,
[
'border' => '0',
'alt' => __('Delete'),
]
).'</a>';
}
$data[5] .= '<a href="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete')]).'</a>';
$data[5] .= '<a href="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image(
'images/cross.png',
true,
[
'border' => '0',
'alt' => __('Delete'),
'class' => 'invert_filter',
]
).'</a>';
}
$table->data['agent_'.$downtime_agent['id_agente']] = $data;
@ -1110,7 +1130,7 @@ $table->style[0] = 'text-align: center;';
$table->data = [];
$table->data['loading'] = [];
$table->data['loading'][0] = html_print_image('images/spinner.gif', true);
echo "<div style='display: none;'>";
echo "<div class='invisible'>";
html_print_table($table);
echo '</div>';
@ -1134,9 +1154,9 @@ $table->data['module'][1] = "
</tr>
</thead>
<tbody>
<tr class='datos' id='template' style='display: none;'>
<td class='name_module' style=''></td>
<td class='cell_delete_button' style='text-align: right; width:10%;' id=''>".'<a class="link_delete"
<tr class='datos' id='template' class='invisible'>
<td class='name_module'></td>
<td class='cell_delete_button right w10p' id=''>".'<a class="link_delete"
onclick="if(!confirm(\''.__('Are you sure?').'\')) return false;"
href="">'.html_print_image(
'images/cross.png',
@ -1144,11 +1164,12 @@ $table->data['module'][1] = "
[
'border' => '0',
'alt' => __('Delete'),
'class' => 'invert_filter',
]
).'</a>'."</td>
</tr>
<tr class='datos2' id='add_modules_row'>
<td class='datos2' style='' id=''>".__('Add Module:').'&nbsp;'.html_print_select(
<td class='datos2'id=''>".__('Add Module:').'&nbsp;'.html_print_select(
[],
'modules',
'',
@ -1157,36 +1178,40 @@ $table->data['module'][1] = "
0,
true
)."</td>
<td class='datos2 button_cell' style='text-align: right; width:10%;' id=''>".'<div id="add_button_div">'.'<a class="add_button" href="">'.html_print_image(
<td class='datos2 button_cell right w10p' id=''>".'<div id="add_button_div">'.'<a class="add_button" href="">'.html_print_image(
'images/add.png',
true,
[
'border' => '0',
'alt' => __('Add'),
'class' => 'invert_filter',
]
).'</a>'.'</div>'."<div id='spinner_add' style='display: none;'>".html_print_image('images/spinner.gif', true).'</div>'.'</td>
).'</a>'.'</div>'."<div id='spinner_add' class='invisible'>".html_print_image(
'images/spinner.gif',
true
).'</div>'.'</td>
</tr>
</tbody></table>';
echo "<div style='display: none;'>";
echo "<div class='invisible'>";
html_print_table($table);
echo '</div>';
echo "<div style='display: none;'>";
echo "<div class='invisible'>";
echo "<div id='spinner_template'>";
html_print_image('images/spinner.gif');
echo '</div>';
echo '</div>';
echo "<div id='some_modules_text' style='display: none;'>";
echo "<div id='some_modules_text' class='invisible'>";
echo __('Some modules');
echo '</div>';
echo "<div id='some_modules_text' style='display: none;'>";
echo "<div id='some_modules_text' class='invisible'>";
echo __('Some modules');
echo '</div>';
echo "<div id='all_modules_text' style='display: none;'>";
echo "<div id='all_modules_text' class='invisible'>";
echo __('All modules');
echo '</div>';

View File

@ -364,12 +364,12 @@ else if (!$downtimes) {
// Info message.
echo '<div class="nf">'.__('No planned downtime').'</div>';
echo '<div class="action-buttons" style="width: 100%">';
echo '<div class="action-buttons w100p" >';
// Create button.
if ($write_permisson) {
echo '&nbsp;';
echo '<form method="post" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
echo '<form method="post" class="display_in" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
echo '</form>';
}
@ -493,9 +493,9 @@ else {
|| check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD')
) {
// Edit.
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update'), 'class' => 'invert_filter']).'</a>';
// Delete.
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]);
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']);
} else {
$data['edit'] = '';
$data['delete'] = '';
@ -505,7 +505,7 @@ else {
|| check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD')
) {
// Edit.
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update'), 'class' => 'invert_filter']).'</a>';
// Delete.
$data['delete'] = __('N/A');
} else {
@ -539,7 +539,7 @@ else {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
// CSV export button.
echo '<div style="display: inline;">';
echo '<div class="display_in">';
html_print_button(
__('Export to CSV'),
'csv_export',
@ -552,7 +552,7 @@ else {
// Create button.
if ($write_permisson) {
echo '&nbsp;';
echo '<form method="post" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
echo '<form method="post" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" class="display_in" >';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
echo '</form>';
}

View File

@ -27,6 +27,8 @@ if (! check_acl($config['id_user'], 0, 'AR')
return;
}
$update = get_parameter('upd_button', '');
$default = (int) get_parameter('default', 0);
@ -169,6 +171,7 @@ $table->data[1][1] = '<a href="javascript:">'.html_print_image(
[
'id' => 'right',
'title' => __('Add fields to select'),
'class' => 'invert_filter',
]
).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
@ -177,6 +180,7 @@ $table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
[
'id' => 'left',
'title' => __('Delete fields to select'),
'class' => 'invert_filter',
]
).'</a>';
@ -235,7 +239,7 @@ $(document).ready (function () {
if(selected_fields_total === current_fields_size){
display_confirm_dialog(
"<?php echo '<span style=text-transform:none;font-size:9.5pt;>'.__('There must be at least one custom field. Timestamp will be set by default').'</span>'; ?>",
"<?php echo '<span class="transform_none">'.__('There must be at least one custom field. Timestamp will be set by default').'</span>'; ?>",
"<?php echo __('Confirm'); ?>",
"<?php echo __('Cancel'); ?>",
function () {

View File

@ -36,6 +36,8 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'LM')) {
@ -429,9 +431,9 @@ foreach ($actions as $action) {
$text_confirm = __('Are you sure?');
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions"
onClick="copy_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/copy.png', true).'</a>';
onClick="copy_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
$data[4] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions"
onClick="delete_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/cross.png', true).'</a>';
onClick="delete_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
}
array_push($table->data, $data);

View File

@ -28,6 +28,12 @@ if (! check_acl($config['id_user'], 0, 'LM')) {
exit;
}
if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin($config['id_user'])) {
echo "<div id='message_permissions' title='".__('Permissions warning')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Command management is limited to administrator users or user profiles with permissions over Pandora FMS management').'</p>';
echo '</div>';
}
if (is_metaconsole()) {
$sec = 'advanced';
} else {
@ -90,9 +96,15 @@ if (is_ajax()) {
if (!empty($field_description)) {
// If the value is 5, this because severity in snmp alerts is not permit to show.
if (($i > 5) && ($command['id'] == 3)) {
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), ($i - 1)).'</span>';
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
__('Field %s'),
($i - 1)
).'</span>';
} else {
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), $i).'</span>';
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
__('Field %s'),
$i
).'</span>';
}
// If the field is the number one, print the help message.
@ -125,7 +137,7 @@ if (is_ajax()) {
$field_value = io_safe_output($field_value);
// HTML type.
if (preg_match('/^_html_editor_$/i', $field_value)) {
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx = '<div id="command_div"><b><small>';
$editor_type_chkbx .= __('Basic');
$editor_type_chkbx .= ui_print_help_tip(
__('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: <pre></pre>'),
@ -166,7 +178,7 @@ if (is_ajax()) {
$is_central_policies_on_node
);
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx = '<div id="command_div"><b><small>';
$editor_type_chkbx .= __('Basic').'&nbsp;&nbsp;';
$editor_type_chkbx .= html_print_radio_button_extended(
'editor_type_recovery_value_'.$i,
@ -203,7 +215,7 @@ if (is_ajax()) {
$is_central_policies_on_node
);
} else if (preg_match('/^_content_type_$/i', $field_value)) {
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx = '<div id="command_div"><b><small>';
$editor_type_chkbx .= __('Text/plain');
$editor_type_chkbx .= ui_print_help_tip(
__('For sending emails only text plain'),
@ -234,7 +246,7 @@ if (is_ajax()) {
$editor_type_chkbx .= '</small></b></div>';
$ffield = $editor_type_chkbx;
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx = '<div id="command_div"><b><small>';
$editor_type_chkbx .= __('Text/plain');
$editor_type_chkbx .= ui_print_help_tip(
__('For sending emails only text plain'),
@ -388,7 +400,7 @@ if (is_ajax()) {
1,
1,
$fv[0],
'style="min-height:40px; '.$style.'" class="fields"',
'style="'.$style.'" class="fields min-height-40px"',
true,
'',
$is_central_policies_on_node
@ -398,7 +410,7 @@ if (is_ajax()) {
1,
1,
$fv[0],
'style="min-height:40px; '.$style.'" class="fields_recovery',
'style="'.$style.'" class="fields_recovery min-height-40px',
true,
'',
$is_central_policies_on_node
@ -411,7 +423,7 @@ if (is_ajax()) {
1,
1,
'',
'style="min-height:40px; '.$style.'" class="fields"',
'style="'.$style.'" class="fields min-height-40px"',
true,
'',
$is_central_policies_on_node
@ -421,7 +433,7 @@ if (is_ajax()) {
1,
1,
'',
'style="min-height:40px; '.$style.'" class="fields_recovery"',
'style="'.$style.'" class="fields_recovery min-height-40px"',
true,
'',
$is_central_policies_on_node
@ -434,7 +446,7 @@ if (is_ajax()) {
$fields_rows[$i] = '';
} else {
$fields_rows[$i] = '<tr id="table_macros-field'.$i.'" class="datos">';
$fields_rows[$i] .= '<td style="font-weight:bold;width:20%" class="datos">'.$fdesc.'</td>';
$fields_rows[$i] .= '<td class="datos bolder w20p">'.$fdesc.'</td>';
$fields_rows[$i] .= '<td class="datos">'.$ffield.'</td>';
if ($get_recovery_fields) {
$fields_rows[$i] .= '<td class="datos recovery_col">'.$rfield.'</td>';
@ -625,10 +637,10 @@ if ($commands === false) {
foreach ($commands as $command) {
$data = [];
$data['name'] = '<span style="font-size: 7.5pt">';
$data['name'] = '<span>';
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
if (!$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
if (!$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'PM')) {
$data['name'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&id='.$command['id'].'&pure='.$pure.'">'.$command['name'].'</a>';
} else {
$data['name'] .= $command['name'];
@ -655,11 +667,11 @@ foreach ($commands as $command) {
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
if ($is_central_policies_on_node === false && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
$data['action'] = '<span style="display: inline-flex">';
$data['action'] = '<span class="inline_flex">';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true).'</a>';
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
$data['action'] .= '</span>';
}
@ -672,7 +684,7 @@ if (count($table->data) > 0) {
ui_print_info_message(['no_close' => true, 'message' => __('No alert commands configured') ]);
}
if ($is_central_policies_on_node === false) {
if ($is_central_policies_on_node === false && check_acl_restricted_all($config['id_user'], $command['id_group'], 'PM')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
@ -682,3 +694,26 @@ if ($is_central_policies_on_node === false) {
}
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready(function () {
dialog_message("#message_permissions");
});
function dialog_message(message) {
$(message)
.css("display", "inline")
.dialog({
modal: true,
width: "400px",
buttons: {
Close: function() {
$(this).dialog("close");
}
}
});
}
</script>

View File

@ -90,7 +90,7 @@ $table->data[0][1] = html_print_select(
$table->data[0][1] .= ' <span id="latest_value" class="invisible">'.__('Latest value').': ';
$table->data[0][1] .= '<span id="value">&nbsp;</span></span>';
$table->data[0][1] .= ' <span id="module_loading" class="invisible">';
$table->data[0][1] .= html_print_image('images/spinner.png', true).'</span>';
$table->data[0][1] .= html_print_image('images/spinner.gif', true).'</span>';
$table->data[1][0] = __('Actions');
@ -131,8 +131,8 @@ $table->data[1][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
$table->data[1][1] .= '</span>';
if (check_acl($config['id_user'], 0, 'LM')) {
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
$table->data[1][1] .= html_print_image('images/add.png', true);
$table->data[1][1] .= '<span style="margin-left:0.5em;">'.__('Create Action').'</span>';
$table->data[1][1] .= html_print_image('images/add.png', true, ['class' => 'invert_filter']);
$table->data[1][1] .= '<span class="mrgn_lft_05em">'.__('Create Action').'</span>';
$table->data[1][1] .= '</a>';
}
@ -164,8 +164,8 @@ if ($own_info['is_admin']) {
$table->data[2][1] .= ' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a>';
if (check_acl($config['id_user'], 0, 'LM')) {
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
$table->data[2][1] .= html_print_image('images/add.png', true);
$table->data[2][1] .= '<span style="margin-left:0.5em;">'.__('Create Template').'</span>';
$table->data[2][1] .= html_print_image('images/add.png', true, ['class' => 'invert_filter']);
$table->data[2][1] .= '<span class=""mrgn_lft_05em>'.__('Create Template').'</span>';
$table->data[2][1] .= '</a>';
}
@ -197,7 +197,7 @@ if ($own_info['is_admin']) {
if (!isset($step)) {
if ($id_cluster) {
echo "<input onclick='window.location.replace(\"index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id=".$id_cluster."\");' type=button style='float:right;margin-left:20px;' name='store' class='sub upd' value='".__('Finish and view cluster')."'>";
echo "<input onclick='window.location.replace(\"index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id=".$id_cluster."\");' type=button name='store' class='sub upd right mrgn_lft_20px' value='".__('Finish and view cluster')."'>";
}
html_print_submit_button(__('Add alert'), 'add', false, 'class="sub wand"');

View File

@ -50,9 +50,9 @@ if ($id_agente) {
// Table for filter controls
$form_filter = '<form method="post" action="index.php?sec='.$sec.'&amp;sec2='.$sec2.'&amp;refr='.((int) get_parameter('refr', 0)).'&amp;pure='.$config['pure'].'">';
$form_filter .= "<input type='hidden' name='search' value='1' />";
$form_filter .= '<table style="width: 100%;" cellpadding="0" cellspacing="0" class="databox filters">';
$form_filter .= '<table cellpadding="0" cellspacing="0" class="databox filters w100p">';
$form_filter .= '<tr>';
$form_filter .= "<td style='font-weight: bold;'>".__('Template name').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Template name').'</td><td>';
$form_filter .= html_print_input_text('template_name', $templateName, '', 12, 255, true);
$form_filter .= '</td>';
$temp = agents_get_agents();
@ -65,7 +65,7 @@ if ($temp) {
}
}
$form_filter .= "<td style='font-weight: bold;'>".__('Agents').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Agents').'</td><td>';
$params = [];
$params['return'] = true;
@ -80,7 +80,7 @@ $form_filter .= ui_print_agent_autocomplete_input($params);
$form_filter .= '</td>';
$form_filter .= "<td style='font-weight: bold;'>".__('Module name').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Module name').'</td><td>';
$form_filter .= html_print_input_text('module_name', $moduleName, '', 12, 255, true);
$form_filter .= '</td>';
$form_filter .= '</tr>';
@ -111,19 +111,19 @@ if (is_array($temp)) {
}
}
$form_filter .= "<td style='font-weight: bold;'>".__('Actions').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Actions').'</td><td>';
$form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true);
$form_filter .= '</td>';
$form_filter .= "<td style='font-weight: bold;'>".__('Field content').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Field content').'</td><td>';
$form_filter .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true);
$form_filter .= '</td>';
$form_filter .= "<td style='font-weight: bold;'>".__('Priority').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Priority').'</td><td>';
$form_filter .= html_print_select(get_priorities(), 'priority', $priority, '', __('All'), -1, true);
$form_filter .= "</td style='font-weight: bold;'>";
$form_filter .= "</td class='bolder''>";
$form_filter .= '</tr>';
$form_filter .= '<tr>';
$form_filter .= "<td style='font-weight: bold;'>".__('Status').'</td><td>';
$form_filter .= "<td class='bolder'>".__('Status').'</td><td>';
$ed_list = [];
$alert_status_filter = [];
$alert_status_filter['all_enabled'] = __('All (Enabled)');
@ -132,13 +132,13 @@ $alert_status_filter['fired'] = __('Fired');
$alert_status_filter['notfired'] = __('Not fired');
$alert_status_filter['disabled'] = __('Disabled');
$form_filter .= html_print_select($alert_status_filter, 'status_alert', $status_alert, '', '', '', true);
$form_filter .= "</td><td style='font-weight: bold;'>".__('Standby').'</td><td>';
$form_filter .= "</td><td class='bolder'>".__('Standby').'</td><td>';
$sb_list = [];
$sb_list[1] = __('Standby on');
$sb_list[0] = __('Standby off');
$form_filter .= html_print_select($sb_list, 'standby', $standby, '', __('All'), -1, true);
$form_filter .= '</td>';
$form_filter .= "</td><td style='font-weight: bold;'>".__('Group').'</td><td>';
$form_filter .= "</td><td class='bolder''>".__('Group').'</td><td>';
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = false;
@ -158,7 +158,7 @@ if (defined('METACONSOLE')) {
$form_filter .= '</table>';
} else {
$form_filter .= '</table>';
$form_filter .= "<div style='text-align:right; height:100%;'>";
$form_filter .= "<div class='right height_100p'>";
$form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true);
$form_filter .= '</div>';
}
@ -528,7 +528,7 @@ foreach ($simple_alerts as $alert) {
$data[0] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab='.$main_tab.'&id_agente='.$id_agent.'">';
if ($alert['disabled']) {
$data[0] .= '<span style="font-style: italic; color: #aaaaaa;">';
$data[0] .= '<span class="italic_a">';
}
$alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
@ -579,7 +579,14 @@ foreach ($simple_alerts as $alert) {
);
$data[2] .= ' <a class="template_details"
href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">';
$data[2] .= html_print_image('images/zoom.png', true, ['id' => 'template-details-'.$alert['id_alert_template'], 'class' => 'img_help action_button_img']);
$data[2] .= html_print_image(
'images/zoom.png',
true,
[
'id' => 'template-details-'.$alert['id_alert_template'],
'class' => 'img_help action_button_img invert_filter',
]
);
$data[2] .= '</a> ';
if (check_acl($config['id_user'], $template_group, 'LW') || check_acl($config['id_user'], $template_group, 'LM')) {
@ -588,7 +595,7 @@ foreach ($simple_alerts as $alert) {
$actions = alerts_get_alert_agent_module_actions($alert['id']);
$data[3] = "<table style='width:100%;'>";
$data[3] = "<table class='w100p'>";
// Get and show default actions for this alert
$default_action = db_get_sql(
'SELECT id_alert_action
@ -603,12 +610,12 @@ foreach ($simple_alerts as $alert) {
}
foreach ($actions as $action_id => $action) {
$data[3] .= '<tr style="display: grid; grid-template-columns: 1fr 1fr; align-items: center;">';
$data[3] .= '<tr class="alert_action_list">';
$data[3] .= '<td>';
$data[3] .= '<ul class="action_list" style="display:inline;">';
$data[3] .= '<li style="display:inline;">';
$data[3] .= '<ul class="action_list inline_line">';
$data[3] .= '<li class="inline_line">';
if ($alert['disabled']) {
$data[3] .= '<font class="action_name" style="font-style: italic; color: #aaaaaa;">';
$data[3] .= '<font class="action_name italic_a">';
} else {
$data[3] .= '<font class="action_name">';
}
@ -642,12 +649,11 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '<td style=" display: flex; align-items: center;">';
$data[3] .= '<td class="flex_center">';
$data[3] .= ui_print_help_tip(__('The default actions will be executed every time that the alert is fired and no other action is executed'), true);
// Is possible manage actions if have LW permissions in the agent group of the alert module
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
// ~ $data[2] .= '<form method="post" action="' . $url . '" class="delete_link" style="display: inline; vertical-align: -50%;">';
$data[3] .= '<form method="post" action="'.$url.'" class="delete_link" style="display: inline;">';
$data[3] .= '<form method="post" action="'.$url.'" class="delete_link display_in">';
$data[3] .= html_print_input_image(
'delete',
'images/cross.png',
@ -656,7 +662,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'title' => __('Delete action'),
'class' => 'action_button_img',
'class' => 'action_button_img invert_filter',
]
);
$data[3] .= html_print_input_hidden('delete_action', 1, true);
@ -671,7 +677,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'title' => __('Update action'),
'class' => 'action_button_img',
'class' => 'action_button_img invert_filter',
'onclick' => 'show_display_update_action(\''.$action['id'].'\',\''.$alert['id'].'\',\''.$alert['id_agent_module'].'\',\''.$action_id.'\',\''.$alert['id_agent_module'].'\')',
]
);
@ -682,7 +688,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</tr>';
}
$data[3] .= '<div id="update_action-div" style="display:none;text-align:left">';
$data[3] .= '<div id="update_action-div" class="invisible left">';
$data[3] .= '</div>';
$data[3] .= '</table>';
// Is possible manage actions if have LW permissions in the agent group of the alert module
@ -700,15 +706,15 @@ foreach ($simple_alerts as $alert) {
$actions = alerts_get_alert_actions_filter(true, 'id_group IN ('.$filter_groups.')');
}
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" style="display:none;text-align:left">';
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible left">';
$data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post">';
$data[3] .= '<table class="databox_color" style="width:100%">';
$data[3] .= '<table class="databox_color w100p">';
$data[3] .= html_print_input_hidden('add_action', 1, true);
$data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true);
if (! $id_agente) {
$data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos2 bolder pdd_6px">';
$data[3] .= __('Agent');
$data[3] .= '</td>';
$data[3] .= '<td class="datos">';
@ -718,7 +724,7 @@ foreach ($simple_alerts as $alert) {
}
$data[3] .= '<tr class="datos">';
$data[3] .= '<td class="datos" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos bolder pdd_6px">';
$data[3] .= __('Module');
$data[3] .= '</td>';
$data[3] .= '<td class="datos">';
@ -726,7 +732,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '</tr>';
$data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos2 bolder pdd_6px">';
$data[3] .= __('Action');
$data[3] .= '</td>';
$data[3] .= '<td class="datos2">';
@ -734,7 +740,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '</tr>';
$data[3] .= '<tr class="datos">';
$data[3] .= '<td class="datos" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos bolder pdd_6px">';
$data[3] .= __('Number of alerts match from');
$data[3] .= '</td>';
$data[3] .= '<td class="datos">';
@ -758,7 +764,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '</tr>';
$data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos2 bolder pdd_6px">';
$data[3] .= __('Threshold');
$data[3] .= '</td>';
$data[3] .= '<td class="datos2">';
@ -782,7 +788,13 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '</tr>';
$data[3] .= '</table>';
$data[3] .= html_print_submit_button(__('Add'), 'addbutton', false, ['class' => 'sub next', 'style' => 'float:right'], true);
$data[3] .= html_print_submit_button(
__('Add'),
'addbutton',
false,
['class' => 'sub next right'],
true
);
$data[3] .= '</form>';
$data[3] .= '</div>';
}
@ -791,12 +803,24 @@ foreach ($simple_alerts as $alert) {
1 => 'action_buttons',
4 => 'action_buttons',
];
$data[4] = '<form class="disable_alert_form" action="'.$url.'" method="post" style="display: inline;">';
$data[4] = '<form class="disable_alert_form display_in" action="'.$url.'" method="post" >';
if ($alert['disabled']) {
$data[4] .= html_print_input_image('enable', 'images/lightbulb_off.png', 1, 'padding:0px', true);
$data[4] .= html_print_input_image(
'enable',
'images/lightbulb_off.png',
1,
'padding:0px',
true
);
$data[4] .= html_print_input_hidden('enable_alert', 1, true);
} else {
$data[4] .= html_print_input_image('disable', 'images/lightbulb.png', 1, 'padding:0px;', true);
$data[4] .= html_print_input_image(
'disable',
'images/lightbulb.png',
1,
'padding:0px;',
true
);
$data[4] .= html_print_input_hidden('disable_alert', 1, true);
}
@ -805,12 +829,26 @@ foreach ($simple_alerts as $alert) {
// To manage alert is necessary LW permissions in the agent group
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
$data[4] .= '<form class="standby_alert_form" action="'.$url.'" method="post" style="display: inline;">';
$data[4] .= '<form class="standby_alert_form display_in" action="'.$url.'" method="post">';
if (!$alert['standby']) {
$data[4] .= html_print_input_image('standby_off', 'images/bell.png', 1, 'padding:0px;', true);
$data[4] .= html_print_input_image(
'standby_off',
'images/bell.png',
1,
'padding:0px;',
true,
['class' => 'invert_filter']
);
$data[4] .= html_print_input_hidden('standbyon_alert', 1, true);
} else {
$data[4] .= html_print_input_image('standby_on', 'images/bell_pause.png', 1, 'padding:0px;', true);
$data[4] .= html_print_input_image(
'standby_on',
'images/bell_pause.png',
1,
'padding:0px;',
true,
['class' => 'invert_filter']
);
$data[4] .= html_print_input_hidden('standbyoff_alert', 1, true);
}
@ -825,7 +863,7 @@ foreach ($simple_alerts as $alert) {
if ($policyInfo === false) {
$data[1] .= '';
} else {
$img = 'images/policies.png';
$img = 'images/policies_mc.png';
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
}
@ -834,7 +872,7 @@ foreach ($simple_alerts as $alert) {
// To manage alert is necessary LW permissions in the agent group
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
$data[4] .= '<form class="delete_alert_form" action="'.$url.'" method="post" style="display: inline;">';
$data[4] .= '<form class="delete_alert_form display_in" action="'.$url.'" method="post" >';
$is_cluster = (bool) get_parameter('id_cluster');
if (!$is_cluster) {
if ($alert['disabled']) {
@ -845,20 +883,20 @@ foreach ($simple_alerts as $alert) {
);
} else {
$data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">';
$data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action')]);
$data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']);
$data[4] .= '</a>';
}
}
$data[4] .= html_print_input_image('delete', 'images/cross.png', 1, '', true, ['title' => __('Delete')]);
$data[4] .= html_print_input_image('delete', 'images/cross.png', 1, '', true, ['title' => __('Delete'), 'class' => 'invert_filter']);
$data[4] .= html_print_input_hidden('delete_alert', 1, true);
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
$data[4] .= '</form>';
if ($is_cluster) {
$data[4] .= '<form class="view_alert_form" method="post" style="display: inline;">';
$data[4] .= '<form class="view_alert_form display_in" method="post">';
$data[4] .= html_print_input_image('update', 'images/builder.png', 1, '', true, ['title' => __('Update')]);
$data[4] .= html_print_input_image('update', 'images/builder.png', 1, '', true, ['title' => __('Update'), 'class' => 'invert_filter']);
$data[4] .= html_print_input_hidden('upd_alert', 1, true);
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
@ -867,8 +905,8 @@ foreach ($simple_alerts as $alert) {
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LM')) {
$data[4] .= '<form class="view_alert_form" method="post" style="display: inline;" action="index.php?sec=galertas&sec2=godmode/alerts/alert_view">';
$data[4] .= html_print_input_image('view_alert', 'images/eye.png', 1, '', true, ['title' => __('View alert advanced details')]);
$data[4] .= '<form class="view_alert_form display_in" method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_view">';
$data[4] .= html_print_input_image('view_alert', 'images/operation.png', 1, '', true, ['title' => __('View alert advanced details'), 'class' => 'invert_filter']);
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
$data[4] .= '</form>';
}
@ -943,37 +981,109 @@ if (! $id_agente) {
$("input[name=disable]").attr ("title", "<?php echo __('Disable'); ?>")
.hover (function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/lightbulb_off.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/lightbulb_off.png',
true,
false,
true
).'"';
?>
);
},
function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/lightbulb.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/lightbulb.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
}
);
$("input[name=enable]").attr ("title", "<?php echo __('Enable'); ?>")
.hover (function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/lightbulb.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/lightbulb.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
},
function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/lightbulb_off.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/lightbulb_off.png',
true,
false,
true
).'"';
?>
);
}
);
$("input[name=standby_on]").attr ("title", "<?php echo __('Set off standby'); ?>")
.hover (function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/bell.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/bell.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
},
function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/bell_pause.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/bell_pause.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
}
);
$("input[name=standby_off]").attr ("title", "<?php echo __('Set standby'); ?>")
.hover (function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/bell_pause.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/bell_pause.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
},
function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/bell.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/bell.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
}
);

View File

@ -434,11 +434,11 @@ if ($id_agente) {
$buttons = [
'list' => [
'active' => false,
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('List alerts')]).'</a>',
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('List alerts'), 'class' => 'invert_filter']).'</a>',
],
'builder' => [
'active' => false,
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Builder alert')]).'</a>',
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'.html_print_image('images/pencil.png', true, ['title' => __('Builder alert'), 'class' => 'invert_filter']).'</a>',
],
];

View File

@ -270,8 +270,8 @@ if ($delete_special_day) {
}
echo "<table cellpadding='4' cellspacing='4' class='databox upload' width='100%
' style='font-weight: bold; margin-bottom: 10px;'><tr>";
echo "<table cellpadding='4' cellspacing='4' class='databox upload bolder margin-bottom-10' width='100%
'><tr>";
echo "<form method='post' enctype='multipart/form-data' action='index.php?sec=gagente&sec2=godmode/alerts/alert_special_days'>";
echo '<td>';
echo __('iCalendar(.ics) file').'&nbsp;';
@ -329,12 +329,12 @@ if ($display_range) {
$html .= '">&lt;&lt;&nbsp;</a>';
}
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range='.$display_range.'" style="font-weight: bold;">['.$display_range.']</a>';
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range='.$display_range.'" class="bolder">['.$display_range.']</a>';
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= ($display_range + 1);
$html .= '">&nbsp;&gt;&gt;</a>';
} else {
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days" style="font-weight: bold;">['.__('Default').']</a>&nbsp;&nbsp;';
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days" class="bolder">['.__('Default').']</a>&nbsp;&nbsp;';
$html .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= ($this_year - 1);
$html .= '">&lt;&lt;&nbsp;</a>';
@ -472,7 +472,7 @@ for ($month = 1; $month <= 12; $month++) {
if ($special_days != '') {
foreach ($special_days as $special_day) {
$cal_table->data[$cal_line][$week] .= '<div style="font-size: 18px;';
$cal_table->data[$cal_line][$week] .= '<div class="font_18px" style="';
if ($special_day['same_day'] == 'sunday' || $special_day['same_day'] == 'saturday') {
$cal_table->data[$cal_line][$week] .= 'color: red;';
}
@ -525,10 +525,18 @@ for ($month = 1; $month <= 12; $month++) {
if ($special_day['id_group'] || ($can_manage_group_all && $special_day['id_group'] == 0)) {
$cal_table->data[$cal_line][$week] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days&id='.$special_day['id'].'" title=';
$cal_table->data[$cal_line][$week] .= __('Edit');
$cal_table->data[$cal_line][$week] .= '>'.html_print_image('images/wrench_orange.png', true).'</a> &nbsp;';
$cal_table->data[$cal_line][$week] .= '>'.html_print_image(
'images/config.png',
true,
['class' => 'invert_filter']
).'</a> &nbsp;';
$cal_table->data[$cal_line][$week] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&delete_special_day=1&id='.$special_day['id'].'"onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;" title=';
$cal_table->data[$cal_line][$week] .= __('Remove');
$cal_table->data[$cal_line][$week] .= '>'.html_print_image('images/cross.png', true).'</a>';
$cal_table->data[$cal_line][$week] .= '>'.html_print_image(
'images/cross.png',
true,
['class' => 'invert_filter']
).'</a>';
;
}
@ -542,7 +550,11 @@ for ($month = 1; $month <= 12; $month++) {
$cal_table->data[$cal_line][$week] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_special_days&create_special_day=1&date='.$date.'" title=';
$cal_table->data[$cal_line][$week] .= __('Create');
$cal_table->data[$cal_line][$week] .= '>'.html_print_image('images/plus.png', true).'</a>';
$cal_table->data[$cal_line][$week] .= '>'.html_print_image(
'images/add.png',
true,
['class' => 'invert_filter']
).'</a>';
if ($week == 6) {
$cal_line++;

View File

@ -414,7 +414,7 @@ foreach ($templates as $template) {
&& check_acl_restricted_all($config['id_user'], $template['id_group'], 'LM')
) {
$table->cellclass[][4] = 'action_buttons';
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" style="display: inline; float: left">';
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'" class="float-left inline_line">';
$data[4] .= html_print_input_hidden('duplicate_template', 1, true);
$data[4] .= html_print_input_hidden('source_id', $template['id'], true);
$data[4] .= html_print_input_image(
@ -427,7 +427,7 @@ foreach ($templates as $template) {
);
$data[4] .= '</form> ';
$data[4] .= '<form method="post" style="display: inline; float: right" onsubmit="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
$data[4] .= '<form method="post" class="float-right inline_line" onsubmit="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
$data[4] .= html_print_input_hidden('delete_template', 1, true);
$data[4] .= html_print_input_hidden('id', $template['id'], true);
$data[4] .= html_print_input_image(

View File

@ -58,11 +58,11 @@ $table_details->style[0] = 'font-weight: bold;';
$data = [];
$data[0] = __('List alerts');
$data[1] = '<a style=" font-size: 7pt;" href="index.php?sec=galertas&sec2=godmode/alerts/alert_list" title="'.__('List alerts').'"><b><span style=" font-size: 7pt;">'.__('List alerts').'</span></b></a>';
$data[1] = '<a class="size_7pt" href="index.php?sec=galertas&sec2=godmode/alerts/alert_list" title="'.__('List alerts').'"><b><span>'.__('List alerts').'</span></b></a>';
$table_details->data[] = $data;
$data[0] = __('Agent');
$data[1] = '<a style=" font-size: 7pt;" href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent.'" title="'.$agent_alias.'"><b><span style=" font-size: 7pt;">'.$agent_alias.'</span></b></a>';
$data[1] = '<a class="size_7pt" href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent.'" title="'.$agent_alias.'"><b><span>'.$agent_alias.'</span></b></a>';
$table_details->data[] = $data;
$data[0] = __('Module');
@ -89,13 +89,17 @@ if ($alert['times_fired'] > 0) {
}
$data[0] = __('Status');
$data[1] = '<span style="margin-right: 5px;">'.ui_print_status_image($status, $title, true).'</span>'.$title;
$data[1] = '<span class="mrg_r_5px">'.ui_print_status_image(
$status,
$title,
true
).'</span>'.$title;
$table_details->data[] = $data;
$priorities = get_priorities();
$data[0] = __('Priority');
$data[1] = '<span style="width: 20px; height: 10px; margin-right: 5px; display: inline-block;" title="'.$priorities[$template['priority']].'" class="'.get_priority_class($template['priority']).'">&nbsp</span>'.$priorities[$template['priority']];
$data[1] = '<span title="'.$priorities[$template['priority']].'" class="'.get_priority_class($template['priority']).' span_priority">&nbsp</span>'.$priorities[$template['priority']];
$table_details->data[] = $data;
$data[0] = __('Stand by');
@ -107,7 +111,7 @@ if (enterprise_installed() && $alert['id_policy_alerts'] != 0) {
if ($policyInfo === false) {
$policy = __('N/A');
} else {
$img = 'images/policies.png';
$img = 'images/policies_mc.png';
$policy = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
}
@ -343,7 +347,7 @@ $table->head = [];
$table->data = [];
$table->styleTable = 'text-align: center;';
echo '<div class="firing_action_all" style="width: 100%;">';
echo '<div class="firing_action_all w100p" >';
$table->head[0] = __('Actions');
$table->style[0] = 'font-weight: bold; text-align: left;';
@ -418,7 +422,7 @@ $modes = [];
$modes['firing'] = __('Firing');
$modes['recovering'] = __('Recovering');
$table->data[1][1] = '<div class="action_details" style="display: none;">'.__('Mode').'<br>'.html_print_select($modes, 'modes', 'firing', '', '', 0, true, false, false).'</div>';
$table->data[1][1] = '<div class="action_details invisible" >'.__('Mode').'<br>'.html_print_select($modes, 'modes', 'firing', '', '', 0, true, false, false).'</div>';
html_print_table($table);
unset($table);
@ -463,7 +467,10 @@ foreach ($actions as $kaction => $action) {
$data[0] = '<b>'.$data[0].'</b><br>';
}
$data[0] .= '<br><span style="font-size: xx-small;font-style:italic;">('.sprintf(__('Field %s'), ($kdesc + 1)).')</span>';
$data[0] .= '<br><span class="redi xx-small">('.sprintf(
__('Field %s'),
($kdesc + 1)
).')</span>';
$data[1] = $template[$field];
$data[2] = $action[$field];
$data[3] = $firing_fields[$kaction]['value'][$field] = empty($action[$field]) ? $template[$field] : $action[$field];
@ -494,20 +501,20 @@ foreach ($actions as $kaction => $action) {
$firing_fields[$kaction]['command_preview'] = $command_preview;
}
echo '<div class="mode_table mode_table_firing action_details" style="width: 100%; display: none;">';
echo '<div class="mode_table mode_table_firing action_details invisible w100p">';
html_print_table($table);
unset($table);
foreach ($actions as $kaction => $action) {
echo '<div class="firing_action firing_action_'.$kaction.'" style="display:none;">';
echo '<div class="firing_action firing_action_'.$kaction.' invisible">';
ui_print_info_message(['title' => __('Command preview'), 'message' => $firing_fields[$kaction]['command_preview'], 'no_close' => true]);
echo '</div>';
}
echo '</div>';
// Firing table
echo '<div class="mode_table mode_table_recovering action_details" style="display: none; width: 100%;">';
echo '<div class="mode_table mode_table_recovering action_details invisible w100p" >';
if ($template['recovery_notify'] == 0) {
ui_print_info_message(['title' => __('Disabled'), 'message' => __('The alert recovering is disabled on this template.'), 'no_close' => true]);
} else {
@ -541,7 +548,10 @@ if ($template['recovery_notify'] == 0) {
$data[0] = '<b>'.$data[0].'</b><br>';
}
$data[0] .= '<br><span style="font-size: xx-small;font-style:italic;">('.sprintf(__('Field %s'), $fieldn).')</span>';
$data[0] .= '<br><span class="redi xx-small">('.sprintf(
__('Field %s'),
$fieldn
).')</span>';
$data[1] = $firing_fields[$kaction]['value'][$field];
$data[2] = $template[$field.'_recovery'];
$data[3] = $firing_fields[$kaction][$field.'_recovery'];

View File

@ -257,7 +257,7 @@ if ($is_central_policies_on_node === false
$table->data[2][1] .= '</a>';
}
$table->data[2][1] .= '<div id="command_description" style=""></div>';
$table->data[2][1] .= '<div id="command_description" ></div>';
$table->colspan[2][1] = 2;
$table->data[3][0] = __('Threshold');

View File

@ -21,7 +21,7 @@ check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'LM')) {
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Alert Management'
@ -51,7 +51,7 @@ if (is_metaconsole() === true) {
if ($id > 0) {
$alert = alerts_get_alert_command($id);
if ($alert['internal'] || !check_acl_restricted_all($config['id_user'], $alert['id_group'], 'LM')) {
if ($alert['internal'] || !check_acl_restricted_all($config['id_user'], $alert['id_group'], 'PM')) {
db_pandora_audit('ACL Violation', 'Trying to access Alert Management');
include 'general/noaccess.php';
exit;

View File

@ -12,7 +12,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Load global vars.
global $config;
require_once 'include/functions_alerts.php';
@ -51,8 +51,14 @@ if ($date == '') {
$date = date('Y-m-d', get_system_time());
}
// Header
ui_print_page_header(__('Alerts').' &raquo; '.__('Configure special day'), 'images/gm_alerts.png', false, '', true);
// Header.
ui_print_page_header(
__('Alerts').' &raquo; '.__('Configure special day'),
'images/gm_alerts.png',
false,
'',
true
);
$table = new stdClass();
$table->width = '100%';
@ -64,19 +70,44 @@ $table->size = [];
$table->size[0] = '20%';
$table->data = [];
$table->data[0][0] = __('Date');
$table->data[0][1] = html_print_input_text('date', $date, '', 10, 10, true);
$table->data[0][1] .= html_print_image('images/calendar_view_day.png', true, ['alt' => 'calendar', 'onclick' => "scwShow(scwID('text-date'),this);"]);
$table->data[0][1] = html_print_input_text(
'date',
$date,
'',
10,
10,
true
);
$table->data[0][1] .= html_print_image(
'images/calendar_view_day.png',
true,
[
'alt' => 'calendar',
'onclick' => "scwShow(scwID('text-date'),this);",
'class' => 'invert_filter',
]
);
$table->data[1][0] = __('Group');
$groups = users_get_groups();
$own_info = get_user_info($config['id_user']);
// Only display group "All" if user is administrator or has "LM" privileges
// Only display group "All" if user is administrator or has "LM" privileges.
if (users_can_manage_group_all('LM')) {
$display_all_group = true;
} else {
$display_all_group = false;
}
$table->data[1][1] = html_print_select_groups(false, 'LW', $display_all_group, 'id_group', $id_group, '', '', 0, true);
$table->data[1][1] = html_print_select_groups(
false,
'LW',
$display_all_group,
'id_group',
$id_group,
'',
'',
0,
true
);
$table->data[2][0] = __('Same day of the week');
$days = [];
@ -87,10 +118,27 @@ $days['thursday'] = __('Thursday');
$days['friday'] = __('Friday');
$days['saturday'] = __('Saturday');
$days['sunday'] = __('Sunday');
$table->data[2][1] = html_print_select($days, 'same_day', $same_day, '', '', 0, true, false, false);
$table->data[2][1] = html_print_select(
$days,
'same_day',
$same_day,
'',
'',
0,
true,
false,
false
);
$table->data[3][0] = __('Description');
$table->data[3][1] = html_print_textarea('description', 10, 30, $description, '', true);
$table->data[3][1] = html_print_textarea(
'description',
10,
30,
$description,
'',
true
);
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days">';
html_print_table($table);

View File

@ -835,7 +835,7 @@ if ($step == 2) {
'',
$is_central_policies_on_node
);
$table->data[6][1] .= '<span id="matches_value" '.($show_matches ? '' : 'style="display: none"').'>';
$table->data[6][1] .= '<span id="matches_value" '.($show_matches ? '' : 'class="invisible"').'>';
$table->data[6][1] .= '&nbsp;'.html_print_checkbox('matches_value', 1, $matches, true);
$table->data[6][1] .= html_print_label(
__('Trigger when matches the value'),
@ -959,7 +959,7 @@ if ($step == 2) {
// TinyMCE.
// triggering fields.
// Basic.
$table->data['field'.$i][1] = '<div style="padding: 4px 0px;"><b><small>';
$table->data['field'.$i][1] = '<div id="command_div"><b><small>';
$table->data['field'.$i][1] .= __('Basic').'&nbsp;&nbsp;';
$table->data['field'.$i][1] .= html_print_radio_button_extended(
'editor_type_value_'.$i,
@ -992,7 +992,7 @@ if ($step == 2) {
1,
1,
isset($fields[$i]) ? $fields[$i] : '',
'style="min-height:40px;" class="fields"',
'class="fields" min-height-40px',
true,
'',
$is_central_policies_on_node
@ -1000,7 +1000,7 @@ if ($step == 2) {
// Recovery.
// Basic.
$table->data['field'.$i][2] = '<div style="padding: 4px 0px;"><b><small>';
$table->data['field'.$i][2] = '<div id="command_div"><b><small>';
$table->data['field'.$i][2] .= __('Basic').'&nbsp;&nbsp;';
$table->data['field'.$i][2] .= html_print_radio_button_extended(
'editor_type_recovery_value_'.$i,
@ -1033,7 +1033,7 @@ if ($step == 2) {
1,
1,
isset($fields_recovery[$i]) ? $fields_recovery[$i] : '',
'style="min-height:40px" class="fields"',
'class="fields min-height-40px"',
true,
'',
$is_central_policies_on_node

View File

@ -38,14 +38,28 @@ if (defined('METACONSOLE')) {
$buttons = [
'list' => [
'active' => false,
'text' => '<a href="index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image('images/list.png', true, ['title' => __('List categories')]).'</a>',
'text' => '<a href="index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
'images/list.png',
true,
[
'title' => __('List categories'),
'class' => 'invert_filter',
]
).'</a>',
],
];
} else {
$buttons = [
'list' => [
'active' => false,
'text' => '<a href="index.php?sec=galertas&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image('images/list.png', true, ['title' => __('List categories')]).'</a>',
'text' => '<a href="index.php?sec=galertas&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
'images/list.png',
true,
[
'title' => __('List categories'),
'class' => 'invert_filter',
]
).'</a>',
],
];
}
@ -125,13 +139,29 @@ if (!empty($result)) {
if (defined('METACONSOLE')) {
$data[0] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".$category['name'].'</a>';
$data[1] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image('images/config.png', true, ['title' => 'Edit']).'</a>&nbsp;&nbsp;';
$data[1] .= '<a href="index.php?sec=advanced&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image('images/cross.png', true, ['title' => 'Delete']).'</a>';
$data[1] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image(
'images/config.png',
true,
['title' => 'Edit']
).'</a>&nbsp;&nbsp;';
$data[1] .= '<a href="index.php?sec=advanced&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
'images/cross.png',
true,
['title' => 'Delete']
).'</a>';
} else {
$data[0] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".$category['name'].'</a>';
$table->cellclass[][1] = 'action_buttons';
$data[1] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image('images/config.png', true, ['title' => 'Edit']).'</a>';
$data[1] .= '<a href="index.php?sec=gmodules&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image('images/cross.png', true, ['title' => 'Delete']).'</a>';
$data[1] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image(
'images/config.png',
true,
['title' => 'Edit']
).'</a>';
$data[1] .= '<a href="index.php?sec=gmodules&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
'images/cross.png',
true,
['title' => 'Delete']
).'</a>';
}
array_push($table->data, $data);
@ -145,7 +175,7 @@ if (!empty($result)) {
}
// Form to add new categories or search categories
echo "<div style='width=100%; float:right;'>";
echo "<div class='w100p right'>";
if (defined('METACONSOLE')) {
echo '<form method="post" action="index.php?sec=advanced&sec2=godmode/category/edit_category&action=new&pure='.(int) $config['pure'].'">';
} else {

View File

@ -37,14 +37,28 @@ if (defined('METACONSOLE')) {
$buttons = [
'list' => [
'active' => false,
'text' => '<a href="index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image('images/list.png', true, ['title' => __('List categories')]).'</a>',
'text' => '<a href="index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
'images/list.png',
true,
[
'title' => __('List categories'),
'class' => 'invert_filter',
]
).'</a>',
],
];
} else {
$buttons = [
'list' => [
'active' => false,
'text' => '<a href="index.php?sec=gmodules&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image('images/list.png', true, ['title' => __('List categories')]).'</a>',
'text' => '<a href="index.php?sec=gmodules&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
'images/list.png',
true,
[
'title' => __('List categories'),
'class' => 'invert_filter',
]
).'</a>',
],
];
}
@ -120,9 +134,9 @@ else {
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/category/edit_category&action='.$action.'&id_category='.$id_category.'&pure='.(int) $config['pure'].'" enctype="multipart/form-data">';
if (!defined('METACONSOLE')) {
echo '<div align=left style="width: 100%" class="pandora_form">';
echo '<div align=left class="pandora_form w100p">';
} else {
echo '<div align=left style="width: 100%" class="pandora_form">';
echo '<div align=left class="pandora_form w100p">';
}
echo "<table border=0 cellpadding=4 cellspacing=4 class='databox filters' width=100%>";
@ -146,7 +160,7 @@ if (defined('METACONSOLE')) {
}
echo '<tr>';
echo "<td style='font-weight: bold'>";
echo "<td class='bolder'>";
html_print_label(__('Name'), 'name');
echo '</td>';

View File

@ -198,7 +198,7 @@ $(document).ready (function () {
if(selected_fields_total === current_fields_size){
display_confirm_dialog(
"<?php echo '<span style=text-transform:none;font-size:9.5pt;>'.__('There must be at least one custom field. Timestamp will be set by default').'</span>'; ?>",
"<?php echo '<span class=transform_none font_9pt>'.__('There must be at least one custom field. Timestamp will be set by default').'</span>'; ?>",
"<?php echo __('Confirm'); ?>",
"<?php echo __('Cancel'); ?>",
function () {

View File

@ -29,6 +29,8 @@ if (!$event_w && !$event_m) {
return;
}
$delete = (bool) get_parameter('delete', 0);
$multiple_delete = (bool) get_parameter('multiple_delete', 0);
@ -183,7 +185,14 @@ foreach ($filters as $filter) {
|| check_acl_restricted_all($config['id_user'], $filter['id_group'], 'EM')
) {
$table->cellclass[][6] = 'action_buttons';
$data[6] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'href='index.php?sec=geventos&sec2=godmode/events/events&section=filter&delete=1&id=".$filter['id_filter'].'&offset=0&pure='.$config['pure']."'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
$data[6] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'href='index.php?sec=geventos&sec2=godmode/events/events&section=filter&delete=1&id=".$filter['id_filter'].'&offset=0&pure='.$config['pure']."'>".html_print_image(
'images/cross.png',
true,
[
'title' => __('Delete'),
'class' => 'invert_filter',
]
).'</a>';
}
array_push($table->data, $data);
@ -194,9 +203,9 @@ if (isset($data)) {
html_print_input_hidden('multiple_delete', 1);
html_print_table($table);
if (!is_metaconsole()) {
echo "<div style='padding-bottom: 20px; text-align: right;'>";
echo "<div class='pdd_b_20px right'>";
} else {
echo "<div style='float:right; '>";
echo "<div class='right'>";
}
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
@ -207,9 +216,9 @@ if (isset($data)) {
}
if (!defined('METACONSOLE')) {
echo "<div style='padding-bottom: 20px; text-align: right; width:100%;'>";
echo "<div class='pdd_b_20px right w100p'>";
} else {
echo "<div style='float:right; '>";
echo "<div class='right'>";
}
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&amp;pure='.$config['pure'].'">';

View File

@ -159,13 +159,13 @@ $data[3] = html_print_select($types, 'type', $event_response['type'], '', '', ''
$table->data[3] = $data;
$data = [];
$data[0] = '<span id="command_label" class="labels">'.__('Command').'</span><span id="url_label" style="display:none;" class="labels">'.__('URL').'</span>'.ui_print_help_icon('response_macros', true);
$data[0] = '<span id="command_label" class="labels">'.__('Command').'</span><span id="url_label" class="labels invisible">'.__('URL').'</span>'.ui_print_help_icon('response_macros', true);
$data[1] = html_print_textarea(
'target',
3,
1,
$event_response['target'],
'style="min-height:initial;"',
'class="mh_initial"',
true
);
@ -187,23 +187,23 @@ if (enterprise_installed()) {
}
}
$data[2] = '<div id="server_to_exec_label" style="display:none;" class="labels">'.__('Server to execute command').'</div>';
$data[3] = '<div id="server_to_exec_value" style="display:none;">'.html_print_select($servers_to_exec, 'server_to_exec', $event_response['server_to_exec'], '', '', '', true).'</div>';
$data[2] = '<div id="server_to_exec_label" class="labels invisible">'.__('Server to execute command').'</div>';
$data[3] = '<div id="server_to_exec_value" class="invisible" >'.html_print_select($servers_to_exec, 'server_to_exec', $event_response['server_to_exec'], '', '', '', true).'</div>';
$table->data[4] = $data;
$data = [];
$data[0] = '<div id="command_timeout_label" style="display:none;" class="labels">'.__('Command timeout (s)');
$data[1] = '<div id="command_timeout_value" style="display:none;">'.html_print_input_text('command_timeout', $event_response['command_timeout'], '', 4, 5, true);
$data[0] = '<div id="command_timeout_label" class="labels invisible">'.__('Command timeout (s)');
$data[1] = '<div id="command_timeout_value" class="invisible">'.html_print_input_text('command_timeout', $event_response['command_timeout'], '', 4, 5, true);
$table->data[5] = $data;
if ($event_response_id == 0) {
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=create_response&amp;pure='.$config['pure'].'">';
html_print_table($table);
if (!defined('METACONSOLE')) {
echo '<div style="width:100%;text-align:right;">';
echo '<div class="w100p right">';
} else {
echo '<div style="width:100%;text-align:right;">';
echo '<div class="w100p right">';
}
html_print_submit_button(__('Create'), 'create_response_button', false, ['class' => 'sub next']);
@ -213,9 +213,9 @@ if ($event_response_id == 0) {
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=update_response&amp;pure='.$config['pure'].'">';
html_print_table($table);
if (!defined('METACONSOLE')) {
echo '<div style="width:100%;text-align:right;">';
echo '<div class="w100p right">';
} else {
echo '<div style="width:100%;text-align:right;">';
echo '<div class="w100p right">';
}
html_print_submit_button(__('Update'), 'update_response_button', false, ['class' => 'sub next']);

View File

@ -64,16 +64,35 @@ foreach ($event_responses as $response) {
$data[1] = $response['description'];
$data[2] = ui_print_group_icon($response['id_group'], true);
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&action=delete_response&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
$data[3] .= '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image('images/pencil.png', true, ['title' => __('Edit')]).'</a>';
$data[3] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&action=delete_response&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image(
'images/cross.png',
true,
[
'title' => __('Delete'),
'class' => 'invert_filter',
]
).'</a>';
$data[3] .= '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image(
'images/pencil.png',
true,
[
'title' => __('Edit'),
'class' => 'invert_filter',
]
).'</a>';
$table->data[] = $data;
}
html_print_table($table);
echo '<div style="width:100%;text-align:right;">';
echo '<div class="w100p right">';
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&amp;pure='.$config['pure'].'">';
html_print_submit_button(__('Create response'), 'create_response_button', false, ['class' => 'sub next']);
html_print_submit_button(
__('Create response'),
'create_response_button',
false,
['class' => 'sub next']
);
echo '</form>';
echo '</div>';

View File

@ -34,25 +34,53 @@ $section = (string) get_parameter('section', 'filter');
if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EM')) {
$buttons['view'] = [
'active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=operation/events/events&amp;pure='.$config['pure'].'">'.html_print_image('images/events_list.png', true, ['title' => __('Event list')]).'</a>',
'text' => '<a href="index.php?sec=eventos&sec2=operation/events/events&amp;pure='.$config['pure'].'">'.html_print_image(
'images/events_list.png',
true,
[
'title' => __('Event list'),
'class' => 'invert_filter',
]
).'</a>',
'operation' => true,
];
$buttons['filter'] = [
'active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=filter&amp;pure='.$config['pure'].'">'.html_print_image('images/filter_mc.png', true, ['title' => __('Filter list')]).'</a>',
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=filter&amp;pure='.$config['pure'].'">'.html_print_image(
'images/filter_mc.png',
true,
[
'title' => __('Filter list'),
'class' => 'invert_filter',
]
).'</a>',
];
}
if (check_acl($config['id_user'], 0, 'PM')) {
$buttons['responses'] = [
'active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=responses&amp;pure='.$config['pure'].'">'.html_print_image('images/event_responses.png', true, ['title' => __('Event responses')]).'</a>',
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=responses&amp;pure='.$config['pure'].'">'.html_print_image(
'images/event_responses.png',
true,
[
'title' => __('Event responses'),
'class' => 'invert_filter',
]
).'</a>',
];
$buttons['fields'] = [
'active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=fields&amp;pure='.$config['pure'].'">'.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'</a>',
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=fields&amp;pure='.$config['pure'].'">'.html_print_image(
'images/custom_columns.png',
true,
[
'title' => __('Custom fields'),
'class' => 'invert_filter',
]
).'</a>',
];
}

View File

@ -13,6 +13,8 @@
// GNU General Public License for more details.
check_login();
global $config;
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
@ -144,11 +146,6 @@ $table->head[] = __('Login Function');
$table->head[] = __('Agent operation tab');
$table->head[] = __('Agent godmode tab');
$table->head[] = __('Operation');
/*
$table->width = array();
$table->width[] = '30%';
$table->width[] = '30%';
*/
$table->width = '100%';
$table->class = 'info_table';
@ -174,7 +171,7 @@ foreach ($extensions as $file => $extension) {
if (!$extension['enabled']) {
$on = html_print_image('images/dot_green.disabled.png', true);
$off = html_print_image('images/dot_red.disabled.png', true);
$data[] = '<i style="color: grey;">'.$file.'</i>';
$data[] = '<i class="grey">'.$file.'</i>';
// Get version of this extensions
if ($config['extensions'][$file]['operation_menu']) {
@ -259,7 +256,7 @@ foreach ($extensions as $file => $extension) {
if (!$extension['enabled']) {
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.disabled.png', true).'</a>'.' <a title="'.__('Enable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file.'" class="mn">'.html_print_image('images/lightbulb_off.png', true).'</a>';
} else {
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.png', true).'</a>'.' <a title="'.__('Disable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file.'" class="mn">'.html_print_image('images/lightbulb.png', true).'</a>';
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>'.' <a title="'.__('Disable').'" href="index.php?sec=godmode/extensions&amp;sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file.'" class="mn">'.html_print_image('images/lightbulb.png', true).'</a>';
}
} else {
$data[] = '';

View File

@ -267,7 +267,10 @@ $buttons['gis_maps_list'] = [
'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image(
'images/list.png',
true,
['title' => __('GIS Maps list')]
[
'title' => __('GIS Maps list'),
'class' => 'invert_filter',
]
).'</a>',
];
if ($idMap) {
@ -276,7 +279,10 @@ if ($idMap) {
'text' => '<a href="index.php?sec=gismaps&sec2=operation/gis_maps/render_view&map_id='.$idMap.'">'.html_print_image(
'images/op_gis.png',
true,
['title' => __('View GIS')]
[
'title' => __('View GIS'),
'class' => 'invert_filter',
]
).'</a>',
];
}
@ -448,13 +454,17 @@ foreach ($listConnectionTemp as $connectionTemp) {
}
$table->data[1][0] = __('Add Map connection').$iconError;
$table->data[1][1] = "<table style='padding:0px;' class='no-class' border='0' id='map_connection'>
$table->data[1][1] = "<table class='no-class' border='0' id='map_connection'>
<tr>
<td style='padding:0px;' >
<td >
".html_print_select($listConnection, 'map_connection', '', '', '', '0', true)."
</td>
<td style='padding:0px;' >
<a href='javascript: addConnectionMap();'>".html_print_image('images/add.png', true)."</a>
<td >
<a href='javascript: addConnectionMap();'>".html_print_image(
'images/add.png',
true,
['class' => 'invert_filter']
)."</a>
<input type='hidden' name='map_connection_list' value='' id='map_connection_list' />
<input type='hidden' name='layer_list' value='' id='layer_list' />
</td>
@ -526,10 +536,10 @@ $table->valign[1] = 'top';
$table->data = [];
$table->data[0][0] = '<h4>'.__('List of layers').'</h4>';
$table->data[0][1] = '<div style="text-align: right;">'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add"', true).'</div>';
$table->data[0][1] = '<divclass="right">'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add"', true).'</div>';
$table->data[1][0] = '<table class="databox" border="0" cellpadding="4" cellspacing="4" id="list_layers"></table>';
$table->data[1][1] = '<div id="form_layer" style="display: none;">
$table->data[1][1] = '<div id="form_layer" class="invisible">
<table id="form_layer_table" class="" border="0" cellpadding="4" cellspacing="4">
<tr>
<td>'.__('Layer name').':</td>
@ -653,7 +663,18 @@ echo '</form>';
<tr class="row_0">
<td><?php html_print_input_text('map_connection_name', $map_name, '', 20, 40, false, true); ?></td>
<td><?php html_print_radio_button_extended('map_connection_default', '', '', true, false, 'changeDefaultConection(this.value)', ''); ?></td>
<td><a id="delete_row" href="none"><?php html_print_image('images/cross.png', false, ['alt' => '']); ?></a></td>
<td><a id="delete_row" href="none">
<?php
html_print_image(
'images/cross.png',
false,
[
'alt' => '',
'class' => 'invert_filter',
]
);
?>
</a></td>
</tr>
</tbody>
</table>
@ -951,7 +972,15 @@ function getAgentRow (layerId, agentId, agentAlias) {
var $deleteCol = $("<td />");
var $agentAlias = $("<span class=\"agent_alias\" data-agent-id=\"" + agentId + "\">" + agentAlias + "</span>");
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/cross.png', true); ?></a>');
var $removeBtn = $('<a class="delete_row" href="javascript:;">
<?php
echo html_print_image(
'images/cross.png',
true,
['class' => 'invert_filter']
);
?>
</a>');
$removeBtn.click(function (event) {
var $layerRow = $("tr#layer_row_" + layerId);
@ -1007,7 +1036,7 @@ function getGroupRow (layerId, groupId, groupName, agentId, agentAlias) {
+ "<i>" + agentAlias + "</i>"
+ ")"
+ "</span>");
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/cross.png', true); ?></a>');
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/cross.png', true, ['class' => 'invert_filter']); ?></a>');
$removeBtn.click(function (event) {
var $layerRow = $("tr#layer_row_" + layerId);
@ -1085,8 +1114,8 @@ function getLayerRow (layerId, layerData) {
var $layerName = $("<span class=\"layer_name\">" + layerData.name + "</span>");
var $sortUpBtn = $("<a class=\"up_arrow\" href=\"javascript:;\" />");
var $sortDownBtn = $("<a class=\"down_arrow\" href=\"javascript:;\" />");
var $editBtn = $('<a class="edit_layer" href="javascript:;"><?php echo html_print_image('images/config.png', true); ?></a>');
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/cross.png', true); ?></a>');
var $editBtn = $('<a class="edit_layer" href="javascript:;"><?php echo html_print_image('images/config.png', true, ['class' => 'invert_filter']); ?></a>');
var $removeBtn = $('<a class="delete_row" href="javascript:;"><?php echo html_print_image('images/cross.png', true, ['class' => 'invert_filter']); ?></a>');
$sortUpBtn.click(moveLayerRowUpOnClick);
$sortDownBtn.click(moveLayerRowDownOnClick);

View File

@ -66,7 +66,7 @@ if ($id_group) {
ui_print_error_message(__('There was a problem loading group'));
echo '</table>';
echo '</div>';
echo '<div style="clear:both">&nbsp;</div>';
echo '<div id="both">&nbsp;</div>';
echo '</div>';
echo '<div id="foot">';
include 'general/footer.php';
@ -210,11 +210,11 @@ $table->data[$i][1] = html_print_input_text('description', $description, '', 60,
$i++;
$table->data[$i][0] = __('Contact').ui_print_help_tip(__('Contact information accessible through the _groupcontact_ macro'), true);
$table->data[$i][1] = html_print_textarea('contact', 4, 40, $contact, "style='min-height: 0px;'", true);
$table->data[$i][1] = html_print_textarea('contact', 4, 40, $contact, "class='min-height-0px'", true);
$i++;
$table->data[$i][0] = __('Other').ui_print_help_tip(__('Information accessible through the _group_other_ macro'), true);
$table->data[$i][1] = html_print_textarea('other', 4, 40, $other, "style='min-height: 0px;'", true);
$table->data[$i][1] = html_print_textarea('other', 4, 40, $other, "class='min-height-0px'", true);
$i++;
$isFunctionSkins = enterprise_include_once('include/functions_skins.php');

View File

@ -46,7 +46,7 @@ if ($id_group) {
ui_print_error_message(__('There was a problem loading group'));
echo '</table>';
echo '</div>';
echo '<div style="clear:both">&nbsp;</div>';
echo '<div id="both">&nbsp;</div>';
echo '</div>';
echo '<div id="foot">';
include 'general/footer.php';

View File

@ -291,6 +291,7 @@ $buttons['tree'] = [
true,
[
'title' => __('Tree Group view'),
'class' => 'invert_filter',
]
).'</a>',
];
@ -302,6 +303,7 @@ $buttons['groups'] = [
true,
[
'title' => __('Group view'),
'class' => 'invert_filter',
]
).'</a>',
];
@ -313,6 +315,7 @@ $buttons['credbox'] = [
true,
[
'title' => __('Credential Store'),
'class' => 'invert_filter',
]
).'</a>',
];
@ -679,7 +682,7 @@ if ($tab == 'tree') {
}
$form = "<form method='post' action=''>";
$form .= "<table class='databox filters' width='100%' style='font-weight: bold;'>";
$form .= "<table class='databox filters bolder' width='100%'>";
$form .= '<tr><td>'.__('Search').'&nbsp;';
$form .= html_print_input_text('search', $search, '', 100, 100, true);
$form .= '</td><td>';
@ -844,7 +847,7 @@ if ($tab == 'tree') {
if (check_acl($config['id_user'], 0, 'PM')) {
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/configure_group">';
echo '<div class="action-buttons" style="width:100%;">';
echo '<div class="action-buttons w100p">';
html_print_submit_button(__('Create group'), 'crt', false, 'class="sub next"');
echo '</div>';
echo '</form>';

View File

@ -1,17 +1,32 @@
<?php
/**
* View for Add actions alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -195,9 +210,6 @@ $table->data[1][0] .= '</span>';
$table->data[1][1] = html_print_select([], 'id_agents[]', 0, false, __('Any'), '', true, true);
$table->data[2][0] = __('Alert templates');
$table->data[2][0] .= '<span id="template_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true);
$table->data[2][0] .= '</span>';
$table->data[2][1] = html_print_select([], 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0);
$table->data[2][2] = __('When select agents');
$table->data[2][2] .= '<br>';
@ -251,36 +263,20 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>";
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('add', 1);
html_print_submit_button(__('Add'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('add', 'create', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_javascript_file('massive_operations');
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript">
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#form_alerts").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_alerts").serializeArray().length;
var count_parameters =
get_parameters_count + post_parameters_count;
if (count_parameters > limit_parameters_massive) {
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
return false;
}
});
update_alerts();
@ -319,7 +315,7 @@ $(document).ready (function () {
jQuery.each ($("#id_agents option:selected"), function (i, val) {
idAgents.push($(val).val());
});
$("#template_loading").show();
showSpinner();
var $select_template = $("#id_alert_templates").disable ();
@ -340,7 +336,7 @@ $(document).ready (function () {
}
$("#id_alert_templates").append (options);
$("#template_loading").hide ();
hideSpinner();
$select_template.enable ();
},
"json"

View File

@ -278,17 +278,15 @@ $table->data[2][3] = '';
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('add', 1);
html_print_submit_button(__('Add'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('add', 'add', $table->width);
echo '</form>';
// TODO: Change to iu_print_error system.
echo '<h3 class="error invisible" id="message"> </h3>';
// Hack to translate text "none" in PHP to javascript.
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo '<span id ="none_text" class="invisible">'.__('None').'</span>';
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
@ -299,7 +297,7 @@ ui_require_jquery_file('pandora.controls');
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#form_alerts").submit(function() {
/* $("#form_alerts").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_alerts").serializeArray().length;
@ -311,7 +309,7 @@ $(document).ready (function () {
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
return false;
}
});
}); */
$("#checkbox-recursion").click(function () {
$("#id_group").trigger("change");
@ -321,7 +319,7 @@ $(document).ready (function () {
$("#id_group").change (function () {
var $select = $("#id_agents").enable ();
$("#agent_loading").show ();
showSpinner();
$("option", $select).remove ();
jQuery.post ("ajax.php",
@ -340,7 +338,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_agents").append (options);
$("#agent_loading").hide ();
hideSpinner();
$select.enable ();
},
"json"

View File

@ -1,20 +1,34 @@
<?php
/**
* View for Add profiles in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (!check_acl($config['id_user'], 0, 'UM')) {
db_pandora_audit(
'ACL Violation',
@ -219,14 +233,14 @@ $data[2] .= html_print_select(
'width: 100%'
);
// Waiting spinner.
ui_print_spinner(__('Loading'));
array_push($table->data, $data);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('create_profiles', 1);
html_print_submit_button(__('Create'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('create_profiles', 'update', $table->width);
echo '</form>';

View File

@ -1,17 +1,32 @@
<?php
/**
* View for copy modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -294,22 +309,17 @@ echo '<legend><span>'.__('To agent(s)').'</span></legend>';
html_print_table($table);
echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
attachActionButton('do_operation', 'copy', $table->width);
html_print_input_hidden('do_operation', 1);
html_print_submit_button(__('Copy'), 'go', false, 'class="sub wand"');
echo '</div>';
echo '</form>';
echo '<h3 class="error invisible" id="message">&nbsp;</h3>';
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var module_alerts;
@ -514,7 +524,7 @@ $(document).ready (function () {
});
$("#manage_config_form").submit (function () {
var get_parameters_count = window.location.href.slice(
/* var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#manage_config_form").serializeArray().length;
@ -522,9 +532,13 @@ $(document).ready (function () {
get_parameters_count + post_parameters_count;
if (count_parameters > limit_parameters_massive) {
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
alert("
<?php
// echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.');
?>
");
return false;
}
} */

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete action alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -270,10 +285,8 @@ $agents_with_templates_json = json_encode($agents_with_templates_json);
echo "<input type='hidden' id='hidden-agents_with_templates' value='".$agents_with_templates_json."'>";
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"></h3>';

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete agents in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -186,11 +201,8 @@ $table->data[2][1] = html_print_select(
echo '<form method="post" id="form_agents" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents">';
html_print_table($table);
if (!is_central_policies_on_node()) {
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
if (is_central_policies_on_node() === false) {
attachActionButton('delete', 'delete', $table->width);
}
echo '</form>';
@ -202,24 +214,8 @@ ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript">
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#form_agents").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_agents").serializeArray().length;
var count_parameters =
get_parameters_count + post_parameters_count;
if (count_parameters > limit_parameters_massive) {
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
return false;
}
});
var recursion;
$("#checkbox-recursion").click(function () {

View File

@ -1,17 +1,32 @@
<?php
/**
* View for Delete alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -321,14 +336,12 @@ $table->data[2][3] = html_print_select([], 'module[]', '', false, '', '', true,
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_alerts" >';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
// Hack to translate text "none" in PHP to javascript
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo '<span id ="none_text" class="invisible">'.__('None').'</span>';
echo '<h3 class="error invisible" id="message"> </h3>';
@ -371,7 +384,7 @@ $(document).ready (function () {
$("#id_group").change (function () {
var $select = $("#id_agents").disable ();
$("#agent_loading").show ();
showSpinner();
$("option", $select).remove ();
jQuery.post ("ajax.php",
@ -393,7 +406,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_agents").append (options);
$("#agent_loading").hide ();
hideSpinner();
$select.enable ();
},
"json"

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -296,8 +311,8 @@ $table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->data['selection_mode'][0] = __('Selection mode');
$table->data['selection_mode'][1] = '<span style="width:110px;display:inline-block;">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true).'<br>';
$table->data['selection_mode'][1] .= '<span style="width:110px;display:inline-block;">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true);
$table->data['selection_mode'][1] = '<span class="massive_span">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'<br>';
$table->data['selection_mode'][1] .= '<span class="massive_span">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true);
$table->rowclass['form_modules_1'] = 'select_modules_row';
$table->data['form_modules_1'][0] = __('Module type');
@ -326,7 +341,7 @@ $table->data['form_modules_1'][3] = __('Select all modules of this type').' '.ht
'',
'',
false,
'style="margin-right: 40px;"',
'class="mrgn_right_40px"',
true,
''
);
@ -371,7 +386,7 @@ $table->data['form_agents_1'][3] = __('Select all modules of this group').' '.ht
'',
false,
'',
'style="margin-right: 40px;"',
'class="mrgn_right_40px"',
true
);
@ -563,18 +578,19 @@ $table->data['form_agents_3'][3] = html_print_select(
echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_jquery_file('form');
// Hack to translate text "none" in PHP to javascript
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo '<span id ="select_agent_first_text" style="display: none;">'.__('Please, select an agent first').'</span>';
echo '<span id ="none_text" class="invisible">'.__('None').'</span>';
echo '<span id ="select_agent_first_text" class="invisible">'.__('Please, select an agent first').'</span>';
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('pandora.controls');
if ($selection_mode == 'modules') {
@ -586,13 +602,10 @@ if ($selection_mode == 'modules') {
}
?>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
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');
@ -689,7 +702,7 @@ $(document).ready (function () {
}
}
$("#module_loading").show ();
showSpinner();
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
$("#module_name").attr ("disabled", "disabled")
$("#module_name option[value!=0]").remove ();
@ -702,7 +715,7 @@ $(document).ready (function () {
.html(value["nombre"]);
$("#module_name").append (option);
});
$("#module_loading").hide();
hideSpinner();
$("#module_name").removeAttr ("disabled");
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
@ -832,21 +845,7 @@ $(document).ready (function () {
selector = $("#form_edit input[name=selection_mode]:checked").val();
$("#id_agents").trigger("change");
});
$("#form_modules").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_modules").serializeArray().length;
var count_parameters =
get_parameters_count + post_parameters_count;
if (count_parameters > limit_parameters_massive) {
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
return false;
}
});
if("<?php echo $delete; ?>"){
if("<?php echo $selection_mode; ?>" == 'agents'){
$("#groups_select").trigger("change");

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete profiles in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'UM')) {
@ -199,16 +214,13 @@ array_push($table->data, $data);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete_profiles', 1);
html_print_submit_button(__('Delete'), 'del', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete_profiles', 'delete', $table->width);
echo '</form>';
unset($table);
// TODO: Change to iu_print_error system
// TODO: Change to iu_print_error system.
echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_jquery_file('form');
@ -224,7 +236,7 @@ $(document).ready (function () {
var $select = $("#users_id").disable ();
$("#users_loading").show ();
$("option", $select).remove ();
console.log($("#groups_id").val());
jQuery.post ("ajax.php",
{"page" : "godmode/massive/massive_delete_profiles",
"get_users" : 1,

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit agents in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -327,13 +342,16 @@ if ($update_agents) {
// Update Custom Fields
foreach ($fields as $field) {
$info[$field['id_field']] = $field['name'];
if (get_parameter_post('customvalue_'.$field['id_field'], '') != '') {
$value = get_parameter('customvalue_'.$field['id_field']);
if (empty($value) === false) {
$key = $field['id_field'];
$value = get_parameter_post('customvalue_'.$field['id_field'], '');
$old_value = db_get_all_rows_filter('tagent_custom_data', ['id_agent' => $id_agent, 'id_field' => $key]);
$old_value = db_get_all_rows_filter(
'tagent_custom_data',
[
'id_agent' => $id_agent,
'id_field' => $key,
]
);
if ($old_value === false) {
// Create custom field if not exist
@ -346,14 +364,16 @@ if ($update_agents) {
]
);
} else {
$result = db_process_sql_update(
'tagent_custom_data',
['description' => $value],
[
'id_field' => $key,
'id_agent' => $id_agent,
]
);
if ($old_value[0]['description'] !== $value) {
$result = db_process_sql_update(
'tagent_custom_data',
['description' => $value],
[
'id_field' => $key,
'id_agent' => $id_agent,
]
);
}
}
}
}
@ -373,7 +393,7 @@ if ($update_agents) {
ui_print_result_message(
$result !== false,
__('Agents updated successfully').'('.$n_edited.')',
__('Agents updated successfully (%d)', $n_edited),
__('Agents cannot be updated (maybe there was no field to update)')
);
}
@ -486,7 +506,7 @@ $id_os = 0;
$server_name = 0;
$description = '';
echo '<div id="form_agents" style="display: none;">';
echo '<div id="form_agents" class="invisible">';
$table = new StdClass();
$table->width = '100%';
@ -648,26 +668,26 @@ $table->data[0][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255,
// Learn mode / Normal mode
$table->data[1][0] = __('Module definition');
$table->data[1][1] = __('No change').' '.html_print_radio_button_extended('mode', -1, '', $mode, false, '', 'style="margin-right: 40px;"', true);
$table->data[1][1] .= __('Learning mode').' '.html_print_radio_button_extended('mode', 1, '', $mode, false, '', 'style="margin-right: 40px;"', true);
$table->data[1][1] .= __('Normal mode').' '.html_print_radio_button_extended('mode', 0, '', $mode, false, '', 'style="margin-right: 40px;"', true);
$table->data[1][1] .= __('Autodisable mode').' '.html_print_radio_button_extended('mode', 2, '', $mode, false, '', 'style="margin-right: 40px;"', true);
$table->data[1][1] = __('No change').' '.html_print_radio_button_extended('mode', -1, '', $mode, false, '', 'class="mrgn_right_40px"', true);
$table->data[1][1] .= __('Learning mode').' '.html_print_radio_button_extended('mode', 1, '', $mode, false, '', 'class="mrgn_right_40px"', true);
$table->data[1][1] .= __('Normal mode').' '.html_print_radio_button_extended('mode', 0, '', $mode, false, '', 'class="mrgn_right_40px"', true);
$table->data[1][1] .= __('Autodisable mode').' '.html_print_radio_button_extended('mode', 2, '', $mode, false, '', 'class="mrgn_right_40px"', true);
// Status (Disabled / Enabled)
$table->data[2][0] = __('Status');
$table->data[2][1] = __('No change').' '.html_print_radio_button_extended('disabled', -1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][1] .= __('Disabled').' '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).' '.html_print_radio_button_extended('disabled', 1, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][1] .= __('Active').' '.html_print_radio_button_extended('disabled', 0, '', $disabled, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][1] = __('No change').' '.html_print_radio_button_extended('disabled', -1, '', $disabled, false, '', 'class="mrgn_right_40px"', true);
$table->data[2][1] .= __('Disabled').' '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).' '.html_print_radio_button_extended('disabled', 1, '', $disabled, false, '', 'class="mrgn_right_40px"', true);
$table->data[2][1] .= __('Active').' '.html_print_radio_button_extended('disabled', 0, '', $disabled, false, '', 'class="mrgn_right_40px"', true);
// Remote configuration
$table->data[3][0] = __('Remote configuration');
// Delete remote configuration
$table->data[3][1] = '<div id="delete_configurations" style="display: none">'.__('Delete available remote configurations').' (';
$table->data[3][1] = '<div id="delete_configurations" class="invisible">'.__('Delete available remote configurations').' (';
$table->data[3][1] .= '<span id="n_configurations"></span>';
$table->data[3][1] .= ') '.html_print_checkbox_extended('delete_conf', 1, 0, false, '', 'style="margin-right: 40px;"', true).'</div>';
$table->data[3][1] .= ') '.html_print_checkbox_extended('delete_conf', 1, 0, false, '', 'class="mrgn_right_40px"', true).'</div>';
$table->data[3][1] .= '<div id="not_available_configurations" style="display: none"><em>'.__('Not available').'</em></div>';
$table->data[3][1] .= '<div id="not_available_configurations" class="invisible"><em>'.__('Not available').'</em></div>';
$listIcons = gis_get_array_list_icons();
@ -700,9 +720,9 @@ $table->data[4][1] = html_print_select($arraySelectIcon, 'icon_path', $icon_path
if ($config['activate_gis']) {
$table->data[5][0] = __('Ignore new GIS data:');
$table->data[5][1] = __('No change').' '.html_print_radio_button_extended('update_gis_data', -1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
$table->data[5][1] .= __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
$table->data[5][1] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $update_gis_data, false, '', 'style="margin-right: 40px;"', true);
$table->data[5][1] = __('No change').' '.html_print_radio_button_extended('update_gis_data', -1, '', $update_gis_data, false, '', 'class="mrgn_right_40px"', true);
$table->data[5][1] .= __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $update_gis_data, false, '', 'class="mrgn_right_40px"', true);
$table->data[5][1] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $update_gis_data, false, '', 'class="mrgn_right_40px"', true);
}
$table->data[6][0] = __('Quiet');
@ -795,7 +815,7 @@ foreach ($fields as $field) {
true
);
} else {
$data[1] = html_print_textarea('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
$data[1] = html_print_textarea('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'class="mrgn_right_30px"', true);
}
if ($field['combo_values'] !== '') {
@ -830,19 +850,16 @@ if (!empty($fields)) {
echo '<h3 class="error invisible" id="message"> </h3>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"');
html_print_input_hidden('update_agents', 1);
html_print_input_hidden('id_agente', $id_agente);
echo '</div>';
if (is_central_policies_on_node() === false) {
attachActionButton('update_agents', 'update', $table->width);
}
// Shown and hide div
echo '</div></form>';
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('ajaxqueue');

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -275,14 +290,11 @@ $table->width = '100%';
$table->data = [];
$table->data['selection_mode'][0] = __('Selection mode');
$table->data['selection_mode'][1] = '<span style="width:110px;display:inline-block;">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true).'<br>';
$table->data['selection_mode'][1] .= '<span style="width:110px;display:inline-block;">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'style="margin-right: 40px;"', true);
$table->data['selection_mode'][1] = '<span class="massive_span">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'<br>';
$table->data['selection_mode'][1] .= '<span class="massive_span">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true);
$table->rowclass['form_modules_1'] = 'select_modules_row';
$table->data['form_modules_1'][0] = __('Module type');
$table->data['form_modules_1'][0] .= '<span id="module_loading" class="invisible">';
$table->data['form_modules_1'][0] .= html_print_image('images/spinner.png', true);
$table->data['form_modules_1'][0] .= '</span>';
$types[0] = __('All');
$table->colspan['form_modules_1'][1] = 2;
@ -304,7 +316,7 @@ $table->data['form_modules_1'][3] = __('Select all modules of this type').' '.ht
'',
'',
false,
'style="margin-right: 40px;"',
'class="mrgn_right_40px"',
true,
''
);
@ -351,7 +363,7 @@ $table->data['form_agents_1'][3] = __('Select all modules of this group').' '.ht
'',
false,
'',
'style="margin-right: 40px;"'
'class="mrgn_right_40px"'
);
$table->rowclass['form_modules_3'] = '';
@ -1161,30 +1173,37 @@ $table->data['edit1'][1] = '<table width="100%">';
''
);
if (!empty($id_plugin)) {
$preload = db_get_sql("SELECT description FROM tplugin WHERE id = $id_plugin");
if (empty($id_plugin) === false) {
$preload = db_get_sql(
sprintf(
'SELECT description FROM tplugin WHERE id = %s',
$id_plugin
)
);
$preload = io_safe_output($preload);
$preload = str_replace("\n", '<br>', $preload);
} else {
$preload = '';
}
$table->data['edit21'][1] = '<span style="font-weight: normal;" id="plugin_description">'.$preload.'</span>';
$table->data['edit21'][1] = sprintf(
'<span class="normal" id="plugin_description">%s</span>',
$preload
);
echo '<form method="post" '.'action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" '.'id="form_edit">';
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('update', 1);
html_print_submit_button(__('Update'), 'go', false, 'class="sub upd"');
echo '</div>';
attachActionButton('update', 'update', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
// Hack to translate text "none" in PHP to javascript
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo '<span id ="select_agent_first_text" style="display: none;">'.__('Please, select an agent first').'</span>';
// Hack to translate text "none" in PHP to javascript.
echo '<span id ="none_text" class="invisible">'.__('None').'</span>';
echo '<span id ="select_agent_first_text" class="invisible">'.__('Please, select an agent first').'</span>';
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('pandora.controls');
if ($selection_mode == 'modules') {
@ -1196,27 +1215,11 @@ $table->data['edit1'][1] = '<table width="100%">';
}
?>
<script type="text/javascript">flag_load_plugin_component = false;</script>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
flag_load_plugin_component = false;
$(document).ready (function () {
$("#form_edit").submit(function() {
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#form_edit").serializeArray().length;
var count_parameters =
get_parameters_count + post_parameters_count;
if (count_parameters > limit_parameters_massive) {
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
return false;
}
});
$("#checkbox-select_all_modules").change(function() {
if( $('#checkbox-select_all_modules').prop('checked')) {
@ -1340,7 +1343,7 @@ $(document).ready (function () {
}
}
$("#module_loading").show ();
showSpinner();
$("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide ();
$("#module_name").attr ("disabled", "disabled")
$("#module_name option[value!=0]").remove ();
@ -1351,7 +1354,7 @@ $(document).ready (function () {
option = $("<option></option>").attr ("value", value["nombre"]).html (value["nombre"]);
$("#module_name").append (option);
});
$("#module_loading").hide ();
hideSpinner();
$("#module_name").removeAttr ("disabled");
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
@ -1864,9 +1867,8 @@ function changePluginSelect() {
$('#hidden-macros').val(data['base64']);
jQuery.each (data['array'], function (i, macro) {
console.log(macro);
if (macro['desc'] != '') {
$("#delete_table-edit21").after("<tr class='macro_field' id='delete_table-edit"+(80+parseInt(i))+"'><td style='font-weight:bold;'>"+macro['desc']+"<input type='hidden' name='desc"+macro['macro']+"' value='"+macro['desc']+"'></td><td><input type='text' name='"+macro['macro']+"'></td></tr>");
$("#delete_table-edit21").after("<tr class='macro_field' id='delete_table-edit"+(80+parseInt(i))+"'><td class='bolder'>"+macro['desc']+"<input type='hidden' name='desc"+macro['macro']+"' value='"+macro['desc']+"'></td><td><input type='text' name='"+macro['macro']+"'></td></tr>");
}
});
//Plugin text can be larger

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit plugins in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
global $config;
check_login();
@ -371,10 +386,7 @@ echo '<form method="POST" id="form-massive_plugin_edition"
html_print_table($table);
echo "<div style='text-align: right; width: ".$table->width."'>";
html_print_input_hidden('update', 1);
html_print_submit_button(__('Update'), 'upd-btn', false, 'class="sub upd"');
echo '</div>';
attachActionButton('update', 'update', $table->width);
echo '</form>';
@ -405,35 +417,6 @@ echo '</form>';
canSubmit = val;
$submitButton.prop('disabled', !val);
}
var showSpinner = function () {
var $loadingSpinner = $pluginsSelect.siblings('img#loading_spinner');
if ($loadingSpinner.length > 0) {
// Display inline instead using the show function
// cause its absolute positioning.
$loadingSpinner.css('display', 'inline');
return;
}
$loadingSpinner = $('<img />');
$loadingSpinner
.prop('id', 'loading_spinner')
.css('padding-left', '5px')
.css('position', 'absolute')
.css('top', $pluginsSelect.position().top + 'px')
.prop('src', "<?php echo $config['homeurl'].'/'; ?>images/spinner.gif");
$pluginsSelect.parent().append($loadingSpinner);
}
var hideSpinner = function () {
var $loadingSpinner = $pluginsSelect.siblings('img#loading_spinner');
if ($loadingSpinner.length > 0)
$loadingSpinner.hide();
}
var clearModulePluginMacrosValues = function () {
$('input.plugin-macro')
@ -864,6 +847,7 @@ echo '</form>';
}
var errorHandler = function (error) {
hideSpinner();
console.log("<?php echo __('Error'); ?>: " + error.message);
// alert("<?php echo __('Error'); ?>: " + err.message);
@ -927,7 +911,10 @@ echo '</form>';
$agentModulesRow.show();
}
else {
alert("<?php echo __('There are no modules using this plugin'); ?>");
var contents = {};
contents.html = '<?php echo __('There are no modules using this plugin'); ?>';
contents.title = '<?php echo __('Massive operations'); ?>';
showMassiveModal(contents);
// Abort the another call
if (typeof pluginXHR !== 'undefined') {

View File

@ -1,17 +1,32 @@
<?php
/**
* View for enable/disable alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {

View File

@ -1,17 +1,32 @@
<?php
/**
* Main view for Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars.
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -26,6 +41,7 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
require_once 'include/functions_agents.php';
require_once 'include/functions_alerts.php';
require_once 'include/functions_modules.php';
require_once 'include/functions_massive_operations.php';
enterprise_include('godmode/massive/massive_operations.php');
@ -197,154 +213,183 @@ if ($option == '') {
$alertstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts">'.html_print_image(
'images/op_alerts.png',
'images/bell.png',
true,
['title' => __('Alerts operations')]
[
'title' => __('Alerts operations'),
'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_alerts',
];
$userstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users">'.html_print_image(
'images/op_workspace.png',
'images/user.png',
true,
['title' => __('Users operations')]
[
'title' => __('Users operations'),
'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_users',
];
$agentstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_agents">'.html_print_image(
'images/bricks.png',
'images/agent.png',
true,
['title' => __('Agents operations')]
[
'title' => __('Agents operations'),
'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_agents',
];
$modulestab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'.html_print_image(
'images/brick.png',
true,
['title' => __('Modules operations')]
).'</a>', 'active' => $tab == 'massive_modules',
];
$modulestab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'.html_print_image(
'images/module.png',
true,
[
'title' => __('Modules operations'),
'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_modules',
];
$pluginstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_plugins">'.html_print_image(
'images/plugin.png',
true,
['title' => __('Plugins operations')]
).'</a>', 'active' => $tab == 'massive_plugins',
];
$pluginstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_plugins">'.html_print_image(
'images/plugin.png',
true,
[
'title' => __('Plugins operations'),
'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_plugins',
];
$policiestab = enterprise_hook('massive_policies_tab');
$policiestab = enterprise_hook('massive_policies_tab');
if ($policiestab == ENTERPRISE_NOT_HOOK) {
$policiestab = '';
}
if ($policiestab == ENTERPRISE_NOT_HOOK) {
$policiestab = '';
}
$snmptab = enterprise_hook('massive_snmp_tab');
$snmptab = enterprise_hook('massive_snmp_tab');
if ($snmptab == ENTERPRISE_NOT_HOOK) {
$snmptab = '';
}
if ($snmptab == ENTERPRISE_NOT_HOOK) {
$snmptab = '';
}
$satellitetab = enterprise_hook('massive_satellite_tab');
$satellitetab = enterprise_hook('massive_satellite_tab');
if ($satellitetab == ENTERPRISE_NOT_HOOK) {
$satellitetab = '';
}
if ($satellitetab == ENTERPRISE_NOT_HOOK) {
$satellitetab = '';
}
$servicestab = enterprise_hook('massive_services_tab');
$servicestab = enterprise_hook('massive_services_tab');
if ($servicestab == ENTERPRISE_NOT_HOOK) {
$servicestab = '';
}
if ($servicestab == ENTERPRISE_NOT_HOOK) {
$servicestab = '';
}
$onheader = [];
$onheader['massive_agents'] = $agentstab;
$onheader['massive_modules'] = $modulestab;
$onheader['massive_plugins'] = $pluginstab;
if (check_acl($config['id_user'], 0, 'UM')) {
$onheader['user_agents'] = $userstab;
}
$onheader = [];
$onheader['massive_agents'] = $agentstab;
$onheader['massive_modules'] = $modulestab;
$onheader['massive_plugins'] = $pluginstab;
if (check_acl($config['id_user'], 0, 'UM')) {
$onheader['user_agents'] = $userstab;
}
$onheader['massive_alerts'] = $alertstab;
$onheader['policies'] = $policiestab;
$onheader['snmp'] = $snmptab;
$onheader['satellite'] = $satellitetab;
$onheader['services'] = $servicestab;
$onheader['massive_alerts'] = $alertstab;
$onheader['policies'] = $policiestab;
$onheader['snmp'] = $snmptab;
$onheader['satellite'] = $satellitetab;
$onheader['services'] = $servicestab;
/*
Hello there! :)
/*
Hello there! :)
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :(
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years.
*/
*/
ui_print_page_header(
__('Bulk operations').' &raquo; '.$options[$option],
'images/gm_massive_operations.png',
false,
$help_header,
true,
$onheader,
false,
'massivemodal'
);
ui_print_page_header(
__('Bulk operations').' &raquo; '.$options[$option],
'images/gm_massive_operations.png',
false,
$help_header,
true,
$onheader,
false,
'massivemodal'
);
// Checks if the PHP configuration is correctly.
if ((get_cfg_var('max_execution_time') != 0)
|| (get_cfg_var('max_input_time') != -1)
) {
echo '<div id="notify_conf" class="notify">';
echo __('In order to perform massive operations, PHP needs a correct configuration in timeout parameters. Please, open your PHP configuration file (php.ini) for example: <i>sudo vi /etc/php5/apache2/php.ini;</i><br> And set your timeout parameters to a correct value: <br><i> max_execution_time = 0</i> and <i>max_input_time = -1</i>');
echo '</div>';
}
// Checks if the PHP configuration is correctly.
if ((get_cfg_var('max_execution_time') != 0)
|| (get_cfg_var('max_input_time') != -1)
) {
echo '<div id="notify_conf" class="notify">';
echo __('In order to perform massive operations, PHP needs a correct configuration in timeout parameters. Please, open your PHP configuration file (php.ini) for example: <i>sudo vi /etc/php5/apache2/php.ini;</i><br> And set your timeout parameters to a correct value: <br><i> max_execution_time = 0</i> and <i>max_input_time = -1</i>');
echo '</div>';
}
if ($tab == 'massive_policies' && is_central_policies_on_node()) {
ui_print_warning_message(__('This node is configured with centralized mode. All policies information is read only. Go to metaconsole to manage it.'));
return;
}
if ($tab == 'massive_policies' && is_central_policies_on_node()) {
ui_print_warning_message(__('This node is configured with centralized mode. All policies information is read only. Go to metaconsole to manage it.'));
return;
}
// Catch all submit operations in this view to display Wait banner.
$submit_action = get_parameter('go');
$submit_update = get_parameter('updbutton');
$submit_del = get_parameter('del');
$submit_template_disabled = get_parameter('id_alert_template_disabled');
$submit_template_enabled = get_parameter('id_alert_template_enabled');
$submit_template_not_standby = get_parameter('id_alert_template_not_standby');
$submit_template_standby = get_parameter('id_alert_template_standby');
$submit_add = get_parameter('crtbutton');
// Catch all submit operations in this view to display Wait banner.
$submit_action = get_parameter('go');
$submit_update = get_parameter('updbutton');
$submit_del = get_parameter('del');
$submit_template_disabled = get_parameter('id_alert_template_disabled');
$submit_template_enabled = get_parameter('id_alert_template_enabled');
$submit_template_not_standby = get_parameter('id_alert_template_not_standby');
$submit_template_standby = get_parameter('id_alert_template_standby');
$submit_add = get_parameter('crtbutton');
// Waiting spinner.
ui_print_spinner(__('Loading'));
// Modal for show messages.
html_print_div(
[
'id' => 'massive_modal',
'content' => '',
]
);
echo '<div id="loading" display="none">';
echo html_print_image('images/wait.gif', true, ['border' => '0']).'<br />';
echo '<strong>'.__('Please wait...').'</strong>';
echo '</div>';
?>
// Load common JS files.
ui_require_javascript_file('massive_operations');
?>
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$('#manage_config_form').submit( function() {
confirm_status =
confirm("<?php echo __('Are you sure?'); ?>");
if (confirm_status)
$("#loading").css("display", "");
else
$('#button-go').click( function(e) {
var limitParametersMassive = <?php echo $config['limit_parameters_massive']; ?>;
var thisForm = e.target.form.id;
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $('#'+thisForm).serializeArray().length;
var totalCount = get_parameters_count + post_parameters_count;
var contents = {};
contents.html = '<?php echo __('No changes have been made because they exceed the maximum allowed (%d). Make fewer changes or contact the administrator.', $config['limit_parameters_massive']); ?>';
contents.title = '<?php echo __('Massive operations'); ?>';
contents.question = '<?php echo __('Are you sure?'); ?>';
contents.ok = '<?php echo __('OK'); ?>';
contents.cancel = '<?php echo __('Cancel'); ?>';
var operation = massiveOperationValidation(contents, totalCount, limitParametersMassive, thisForm);
if (operation == false) {
return false;
}
});
$('[id^=form]').submit( function() {
confirm_status =
confirm("<?php echo __('Are you sure?'); ?>");
if (confirm_status)
$("#loading").css("display", "");
else
return false;
});
$("#loading").css("display", "none");
});
/* ]]> */
</script>
<?php

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete action alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -285,7 +300,7 @@ $(document).ready (function () {
jQuery.each ($("#id_agents option:selected"), function (i, val) {
idAgents.push($(val).val());
});
$("#template_loading").show();
showSpinner();
var $select_template = $("#id_alert_templates").disable ();
$("option", $select_template).remove ();
@ -302,7 +317,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_alert_templates").append (options);
$("#template_loading").hide ();
hideSpinner();
$select_template.enable ();
},
"json"

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