Merge remote-tracking branch 'origin/develop' into ent-2561-llamadas-api-para-modulos-de-politicas

This commit is contained in:
fbsanchez 2021-03-24 16:05:08 +01:00
commit ac1c3398fe
447 changed files with 14756 additions and 6523 deletions

View File

@ -1,15 +1,15 @@
FROM centos:centos8 FROM centos:7
MAINTAINER Pandora FMS Team <info@pandorafms.com> LABEL maintainer="Pandora FMS Team <info@pandorafms.com>"
# Add Pandora FMS agent installer # Add Pandora FMS agent installer
ADD unix /opt/pandora/pandora_agent/unix ADD unix /opt/pandora/pandora_agent/unix
RUN export LC_ALL=C RUN export LC_ALL=C
RUN dnf install -y dnf-plugins-core; dnf config-manager --set-enabled PowerTools RUN yum -y update
# Install dependencies # Install dependencies
RUN dnf -y install \ RUN yum -y install \
epel-release \ epel-release \
unzip \ unzip \
perl \ perl \
@ -17,7 +17,7 @@ RUN dnf -y install \
sed \ sed \
perl-YAML-Tiny \ perl-YAML-Tiny \
"perl(Sys::Syslog)" \ "perl(Sys::Syslog)" \
&& dnf clean all && yum clean all
# Install Pandora FMS agent # Install Pandora FMS agent

View File

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

View File

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

View File

@ -1016,7 +1016,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.752'; use constant AGENT_VERSION => '7.0NG.752';
use constant AGENT_BUILD => '210311'; use constant AGENT_BUILD => '210324';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -4143,7 +4143,7 @@ while (1) {
@address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`; @address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`;
} }
else { else {
@address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`; @address_list = `ifconfig -a 2>$DevNull | grep -i inet | grep -v 'inet6' | grep -v '0.0.0.0' | grep -v '::/0' | awk '{print \$2}' | grep -v '127.0.0.1'`;
} }
for (my $i = 0; $i <= $#address_list; $i++) { for (my $i = 0; $i <= $#address_list; $i++) {

View File

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

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{210311} {210324}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -64,6 +64,16 @@ if (isset($config['console_log_enabled']) === true
ini_set('error_log', 0); ini_set('error_log', 0);
} }
// Sometimes input is badly retrieved from caller...
if (empty($_REQUEST) === true) {
$data = explode('&', urldecode(file_get_contents('php://input')));
foreach ($data as $d) {
$r = explode('=', $d, 2);
$_POST[$r[0]] = $r[1];
$_GET[$r[0]] = $r[1];
}
}
// Hash login process. // Hash login process.
if (isset($_GET['loginhash']) === true) { if (isset($_GET['loginhash']) === true) {
$loginhash_data = get_parameter('loginhash_data', ''); $loginhash_data = get_parameter('loginhash_data', '');

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; $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.' 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]) { } else if ($full_modules_selected[0] && $full_agents_id[0]) {
$full_modules = urlencode(implode(';', $full_modules_selected)); $full_modules = urlencode(implode(';', $full_modules_selected));
$full_agents = urlencode(implode(';', $full_agents_id)); $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; $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.' 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 { } else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp; $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>'; 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. // Header.
ui_print_page_header( ui_print_page_header(
__('Agents/Modules'), __('Agents/Modules'),
'images/module_mc.png', 'images/module.png',
false, false,
'', '',
false, false,
$updated_time $updated_time
); );
echo '<table style="width:100%;">'; echo '<table class="w100p">';
echo '<tr>'; 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 '</tr>';
echo '</table>'; echo '</table>';
} else { } else {
@ -461,7 +461,7 @@ function mainAgentsModules()
} }
// Floating menu - Start. // 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 '<div id="menu_tab">';
echo '<ul class="mn">'; echo '<ul class="mn">';
@ -469,14 +469,21 @@ function mainAgentsModules()
// Quit fullscreen. // Quit fullscreen.
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<a target="_top" href="'.$url.'">'; 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 '</a>';
echo '</li>'; echo '</li>';
// Countdown. // Countdown.
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<div class="vc-refr">'; 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 '<div id="vc-refr-form">';
echo __('Refresh').':'; echo __('Refresh').':';
echo html_print_select( echo html_print_select(
@ -511,8 +518,8 @@ function mainAgentsModules()
} }
if ($config['pure'] != 1) { 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 = '<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" cellpadding="0" cellspacing="0" border="0" style="width:100%; border:none;">'; $show_filters .= '<table class="white_table w100p no-border" cellpadding="0" cellspacing="0" border="0">';
$show_filters .= '<tr>'; $show_filters .= '<tr>';
$show_filters .= '<td>'.$filter_groups_label.'</td>'; $show_filters .= '<td>'.$filter_groups_label.'</td>';
$show_filters .= '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</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 .= '<td>'.$filter_modules.'</td>';
$show_filters .= '</tr>'; $show_filters .= '</tr>';
$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 .= '</tr>';
$show_filters .= '</table>'; $show_filters .= '</table>';
$show_filters .= '</form>'; $show_filters .= '</form>';
@ -675,15 +682,15 @@ function mainAgentsModules()
return; 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 '<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) { if ($hor_offset > 0) {
$new_hor_offset = ($hor_offset - $block); $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', 'images/arrow_left_green.png',
true, true,
['title' => __('Previous modules')] ['title' => __('Previous modules')]
@ -701,15 +708,15 @@ function mainAgentsModules()
$text = ui_print_truncate_text(io_safe_output($module['name']), 'module_small'); $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"> echo '<th align="center" width="20px" id="th_module_r_'.$nmodules.'" class="th_class_module_r">
<div style="width: 30px;"> <div class="w30px">
<div id="div_module_r_'.$nmodules.'" style="display: none;padding-left:10px" class="rotate_text_module">'.$text.'</div> <div id="div_module_r_'.$nmodules.'" class="rotate_text_module invisible padding-lft-10">'.$text.'</div>
</div> </div>
</th>'; </th>';
} }
if (($hor_offset + $block) < $nmodules) { if (($hor_offset + $block) < $nmodules) {
$new_hor_offset = ($hor_offset + $block); $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', 'images/arrow_right_green.png',
true, true,
['title' => __('More modules')] ['title' => __('More modules')]
@ -767,7 +774,7 @@ function mainAgentsModules()
break; break;
} }
echo "<tr style='height: 25px;'>"; echo "<tr class='height_25px'>";
echo "<td class='$rowcolor'> 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>'; <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) { foreach ($module['id'] as $module_id) {
if (!$match && array_key_exists($module_id, $agent_modules)) { if (!$match && array_key_exists($module_id, $agent_modules)) {
$status = modules_get_agentmodule_status($module_id); $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'])); $win_handle = dechex(crc32($module_id.$module['name']));
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id)); $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)"; $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>'; echo '</table>';
$show_legend = "<div class='legend_white'>"; $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>'; <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 class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></div>".__('Red cell when the module has a critical status').'
</div>'; </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>'; <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>'; <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>'; <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>'; <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>'; $show_legend .= '</div>';
ui_toggle($show_legend, __('Legend')); ui_toggle($show_legend, __('Legend'));

View File

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

View File

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

View File

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

View File

@ -25,12 +25,19 @@ function load_matrix_console()
if (! $pure) { if (! $pure) {
$title_menu = __('Matrix events'); $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]; $onheader = ['fullscreen' => $fullscreen];
ui_print_page_header($title_menu, 'images/op_monitoring.png', false, '', false, $onheader); 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"> <script language="javascript" type="text/javascript">

View File

@ -84,7 +84,7 @@ function extension_uploader_extensions()
echo "<form method='post' enctype='multipart/form-data'>"; echo "<form method='post' enctype='multipart/form-data'>";
html_print_table($table); 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_input_hidden('upload', 1);
html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"'); html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"');
echo '</div>'; echo '</div>';

View File

@ -111,25 +111,25 @@ function pandora_files_repo_godmode()
return; return;
} }
// Header tabs // 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>'; $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['godmode'] = 1;
$godmode['active'] = 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; $operation['operation'] = 1;
$onheader = [ $onheader = [
'godmode' => $godmode, 'godmode' => $godmode,
'operation' => $operation, 'operation' => $operation,
]; ];
// Header // Header.
ui_print_page_header(__('Files repository manager'), 'images/extensions.png', false, '', true, $onheader); ui_print_page_header(__('Files repository manager'), 'images/extensions.png', false, '', true, $onheader);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/'; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php'; 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)) { if (!files_repo_check_directory(true)) {
return; return;
} }
@ -139,19 +139,19 @@ function pandora_files_repo_godmode()
$server_content_length = $_SERVER['CONTENT_LENGTH']; $server_content_length = $_SERVER['CONTENT_LENGTH'];
} }
// Check for an anoying error that causes the $_POST and $_FILES arrays // Check for an anoying error that causes the $_POST and $_FILES arrays.
// were empty if the file is larger than the post_max_size // were empty if the file is larger than the post_max_size.
if (intval($server_content_length) > 0 && empty($_POST)) { if (intval($server_content_length) > 0 && empty($_POST)) {
ui_print_error_message(__('The file exceeds the maximum size')); 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'); $file_id = (int) get_parameter('file_id');
$add_file = (bool) get_parameter('add_file'); $add_file = (bool) get_parameter('add_file');
$update_file = (bool) get_parameter('update_file'); $update_file = (bool) get_parameter('update_file');
$delete_file = (bool) get_parameter('delete'); $delete_file = (bool) get_parameter('delete');
// File add or update // File add or update.
if ($add_file || ($update_file && $file_id > 0)) { if ($add_file || ($update_file && $file_id > 0)) {
$groups = get_parameter('groups', []); $groups = get_parameter('groups', []);
$public = (bool) get_parameter('public'); $public = (bool) get_parameter('public');
@ -174,7 +174,7 @@ function pandora_files_repo_godmode()
} }
} }
// File delete // File delete.
if ($delete_file && $file_id > 0) { if ($delete_file && $file_id > 0) {
$result = files_repo_delete_file($file_id); $result = files_repo_delete_file($file_id);
if ($result !== -1) { if ($result !== -1) {
@ -184,10 +184,10 @@ function pandora_files_repo_godmode()
$file_id = 0; $file_id = 0;
} }
// FORM // FORM.
include $full_extensions_dir.'files_repo/files_repo_form.php'; include $full_extensions_dir.'files_repo/files_repo_form.php';
if (!$file_id) { if (!$file_id) {
// LIST // LIST.
$manage = true; $manage = true;
include $full_extensions_dir.'files_repo/files_repo_list.php'; include $full_extensions_dir.'files_repo/files_repo_list.php';
} }
@ -198,13 +198,13 @@ function pandora_files_repo_operation()
{ {
global $config; global $config;
// Header tabs // Header tabs.
$onheader = []; $onheader = [];
if (check_acl($config['id_user'], 0, 'PM')) { 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; $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['operation'] = 1;
$operation['active'] = 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); ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/'; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php'; 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)) { if (!files_repo_check_directory(true)) {
return; return;
} }
// LIST // LIST.
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/'; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include $full_extensions_dir.'files_repo/files_repo_list.php'; 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_menu_option(__('Files repository manager'), 'PM', null, null, 'v1r1');
extensions_add_godmode_function('pandora_files_repo_godmode'); extensions_add_godmode_function('pandora_files_repo_godmode');
// pandora_files_repo_uninstall();
pandora_files_repo_install(); pandora_files_repo_install();

View File

@ -82,7 +82,7 @@ $table->colspan[][1] = 3;
$row = []; $row = [];
$row[0] = __('Description'); $row[0] = __('Description');
$row[0] .= ui_print_help_tip(__('Only 200 characters are permitted'), true); $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->data[] = $row;
$table->colspan[][1] = 3; $table->colspan[][1] = 3;
@ -90,7 +90,7 @@ $table->colspan[][1] = 3;
$row = []; $row = [];
// Public checkbox // Public checkbox
$checkbox = html_print_checkbox('public', 1, (bool) !empty($file['hash']), true); $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'); $row[0] = __('File');
if ($file_id > 0) { if ($file_id > 0) {

View File

@ -16,6 +16,8 @@ global $config;
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/'; $full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
require_once $full_extensions_dir.'files_repo/functions_files_repo.php'; require_once $full_extensions_dir.'files_repo/functions_files_repo.php';
$offset = (int) get_parameter('offset'); $offset = (int) get_parameter('offset');
$filter = []; $filter = [];
$filter['limit'] = $config['block_size']; $filter['limit'] = $config['block_size'];
@ -61,19 +63,34 @@ if (!empty($files)) {
$data = []; $data = [];
// Prepare the filename for the get_file.php script // Prepare the filename for the get_file.php script
$document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT'])); $document_root = str_replace(
$file['location'] = str_replace('\\', '/', io_safe_output($file['location'])); '\\',
'/',
io_safe_output($_SERVER['DOCUMENT_ROOT'])
);
$file['location'] = str_replace(
'\\',
'/',
io_safe_output($file['location'])
);
$relative_path = str_replace($document_root, '', $file['location']); $relative_path = str_replace($document_root, '', $file['location']);
$file_name = explode('/', $file['location']); $file_name = explode('/', $file['location']);
$file_decoded = $file_name[(count($file_name) - 1)]; $file_decoded = $file_name[(count($file_name) - 1)];
$file_path = base64_encode($file_decoded); $file_path = base64_encode($file_decoded);
$hash = md5($file_path.$config['dbpass']); $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'; $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>'; $data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>';
// Name // Name
$data[1] = ui_print_truncate_text($file['description'], 'description', true, true); $data[1] = ui_print_truncate_text(
$file['description'],
'description',
true,
true
);
// Description // Description
$data[2] = ui_format_filesize($file['size']); $data[2] = ui_format_filesize($file['size']);
// Size // Size
@ -83,30 +100,58 @@ if (!empty($files)) {
$data[4] = ''; $data[4] = '';
$table->cellclass[][4] = 'action_buttons'; $table->cellclass[][4] = 'action_buttons';
if (!empty($file['hash'])) { 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'; $message = __('Copy to clipboard').': Ctrl+C -> Enter';
$action = "window.prompt('$message', '$public_url');"; $action = "window.prompt('$message', '$public_url');";
$data[4] .= "<a href=\"javascript:;\" onclick=\"$action\">"; $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 // Public link image
$data[4] .= '</a> '; $data[4] .= '</a> ';
} }
$data[4] .= "<a href=\"$url\" target=\"_blank\">"; $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 // Download image
$data[4] .= '</a>'; $data[4] .= '</a>';
if ($manage) { if ($manage) {
$config_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id=$file_id"); $config_url = ui_get_full_url(
$data[4] .= " <a href=\"$config_url\">"; 'index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id='.$file_id
$data[4] .= html_print_image('images/config.png', true, ['title' => __('Edit')]); );
$data[4] .= '<a href=\"$config_url\">';
$data[4] .= html_print_image(
'images/config.png',
true,
['title' => __('Edit')]
);
// Edit image // Edit image
$data[4] .= '</a>'; $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] .= " <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 // Delete image
$data[4] .= '</a>'; $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( 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.'), __('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'] $config['remote_config']
@ -200,7 +200,7 @@ function mainInsertData()
html_print_table($table); 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_input_hidden('save', 1);
html_print_submit_button(__('Save'), 'submit', ($id_agent === ''), 'class="sub next"'); html_print_submit_button(__('Save'), 'submit', ($id_agent === ''), 'class="sub next"');
echo '</div>'; 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>"; <tr>";
echo "<form method='post' echo "<form method='post'
action='index.php?sec=view&sec2=extensions/module_groups'>"; 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] = "<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] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '</a></div>'; $data[$i][$j] .= '</a></div>';
} else { } else {
@ -349,7 +349,7 @@ function mainModuleGroups()
} }
} else { } else {
foreach ($value['gm'] as $k => $v) { 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] .= 0;
$data[$i][$j] .= '</div>'; $data[$i][$j] .= '</div>';
$j++; $j++;
@ -365,15 +365,15 @@ function mainModuleGroups()
ui_pagination($counter); ui_pagination($counter);
echo "<div style='width:100%; overflow-x:auto;'>"; echo "<div class='w100p' style='overflow-x:auto;'>";
html_print_table($table); html_print_table($table);
echo '</div>'; echo '</div>';
ui_pagination($counter); ui_pagination($counter);
echo "<div class='legend_basic' style='width: 98.6%'>"; echo "<div class='legend_basic w99p'>";
echo '<table >'; 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_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_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>'; 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

@ -1,506 +0,0 @@
<?php
/**
* Net tools utils.
*
* @category Extensions
* @package Pandora FMS
* @subpackage NetTools
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
// Requires.
require_once $config['homedir'].'/include/functions.php';
// This extension is usefull only if the agent has associated IP.
$id_agente = get_parameter('id_agente');
$address = agents_get_address($id_agente);
if (!empty($address) || empty($id_agente)) {
extensions_add_opemode_tab_agent(
'network_tools',
'Network Tools',
'extensions/net_tools/nettool.png',
'main_net_tools',
'v1r1',
'AW'
);
}
/**
* Searchs for command.
*
* @param string $command Command.
*
* @return string Path.
*/
function whereis_the_command($command)
{
global $config;
if (isset($config['network_tools_config'])) {
$network_tools_config = json_decode($config['network_tools_config'], true);
$traceroute_path = $network_tools_config['traceroute_path'];
$ping_path = $network_tools_config['ping_path'];
$nmap_path = $network_tools_config['nmap_path'];
$dig_path = $network_tools_config['dig_path'];
$snmpget_path = $network_tools_config['snmpget_path'];
switch ($command) {
case 'traceroute':
if (!empty($traceroute_path)) {
return $traceroute_path;
}
break;
case 'ping':
if (!empty($ping_path)) {
return $ping_path;
}
break;
case 'nmap':
if (!empty($nmap_path)) {
return $nmap_path;
}
break;
case 'dig':
if (!empty($dig_path)) {
return $dig_path;
}
break;
case 'snmpget':
if (!empty($snmpget_path)) {
return $snmpget_path;
}
break;
default:
return null;
}
}
ob_start();
system('whereis '.$command);
$output = ob_get_clean();
$result = explode(':', $output);
$result = trim($result[1]);
if (empty($result)) {
return null;
}
$result = explode(' ', $result);
$fullpath = trim($result[0]);
if (! file_exists($fullpath)) {
return null;
}
return $fullpath;
}
/**
* Execute net tools action.
*
* @param integer $operation Operation.
* @param string $ip Ip.
* @param string $community Community.
* @param string $snmp_version SNMP version.
*
* @return void
*/
function net_tools_execute($operation, $ip, $community, $snmp_version)
{
if (!validate_address($ip)) {
ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
} else {
switch ($operation) {
case 1:
$traceroute = whereis_the_command('traceroute');
if (empty($traceroute)) {
ui_print_error_message(__('Traceroute executable does not exist.'));
} else {
echo '<h3>'.__('Traceroute to ').$ip.'</h3>';
echo '<pre>';
echo system($traceroute.' '.$ip);
echo '</pre>';
}
break;
case 2:
$ping = whereis_the_command('ping');
if (empty($ping)) {
ui_print_error_message(__('Ping executable does not exist.'));
} else {
echo '<h3>'.__('Ping to %s', $ip).'</h3>';
echo '<pre>';
echo system($ping.' -c 5 '.$ip);
echo '</pre>';
}
break;
case 4:
$nmap = whereis_the_command('nmap');
if (empty($nmap)) {
ui_print_error_message(__('Nmap executable does not exist.'));
} else {
echo '<h3>'.__('Basic TCP Scan on ').$ip.'</h3>';
echo '<pre>';
echo system($nmap.' -F '.$ip);
echo '</pre>';
}
break;
case 5:
echo '<h3>'.__('Domain and IP information for ').$ip.'</h3>';
$dig = whereis_the_command('dig');
if (empty($dig)) {
ui_print_error_message(__('Dig executable does not exist.'));
} else {
echo '<pre>';
echo system('dig '.$ip);
echo '</pre>';
}
$whois = whereis_the_command('whois');
if (empty($whois)) {
ui_print_error_message(__('Whois executable does not exist.'));
} else {
echo '<pre>';
echo system('whois '.$ip);
echo '</pre>';
}
break;
case 3:
$snmp_obj = [
'ip_target' => $ip,
'snmp_version' => $snmp_version,
'snmp_community' => $community,
'format' => '-Oqn',
];
$snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.3.0';
$result = get_h_snmpwalk($snmp_obj);
echo '<h3>'.__('SNMP information for ').$ip.'</h3>';
echo '<h4>'.__('Uptime').'</h4>';
echo '<pre>';
if (empty($result)) {
ui_print_error_message(__('Target unreachable.'));
break;
} else {
echo array_pop($result);
}
echo '</pre>';
echo '<h4>'.__('Device info').'</h4>';
echo '<pre>';
$snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.1.0';
$result = get_h_snmpwalk($snmp_obj);
if (empty($result)) {
ui_print_error_message(__('Target unreachable.'));
break;
} else {
echo array_pop($result);
}
echo '</pre>';
echo '<h4>Interface Information</h4>';
$table = new StdClass();
$table->class = 'databox';
$table->head = [];
$table->head[] = __('Interface');
$table->head[] = __('Status');
$i = 0;
$base_oid = '.1.3.6.1.2.1.2.2.1';
$idx_oids = '.1';
$names_oids = '.2';
$status_oids = '.8';
$snmp_obj['base_oid'] = $base_oid.$idx_oids;
$idx = get_h_snmpwalk($snmp_obj);
$snmp_obj['base_oid'] = $base_oid.$names_oids;
$names = get_h_snmpwalk($snmp_obj);
$snmp_obj['base_oid'] = $base_oid.$status_oids;
$statuses = get_h_snmpwalk($snmp_obj);
foreach ($idx as $k => $v) {
$index = str_replace($base_oid.$idx_oids, '', $k);
$name = $names[$base_oid.$names_oids.$index];
$status = $statuses[$base_oid.$status_oids.$index];
$table->data[$i][0] = $name;
$table->data[$i++][1] = $status;
}
html_print_table($table);
break;
default:
// Ignore.
break;
}
}
}
/**
* Main function.
*
* @return void
*/
function main_net_tools()
{
$operation = get_parameter('operation', 0);
$community = get_parameter('community', 'public');
$ip = get_parameter('select_ips');
$snmp_version = get_parameter('select_version');
// Show form.
$id_agente = get_parameter('id_agente', 0);
$principal_ip = db_get_sql(
sprintf(
'SELECT direccion FROM tagente WHERE id_agente = %d',
$id_agente
)
);
$list_address = db_get_all_rows_sql(
sprintf(
'SELECT id_a FROM taddress_agent WHERE id_agent = %d',
$id_agente
)
);
foreach ($list_address as $address) {
$ids[] = join(',', $address);
}
$ips = db_get_all_rows_sql(
sprintf(
'SELECT ip FROM taddress WHERE id_a IN (%s)',
join(',', $ids)
)
);
if ($ips == '') {
echo "<div class='error' style='margin-top:5px'>".__('The agent hasn\'t got IP').'</div>';
return;
}
// Javascript.
?>
<script type='text/javascript'>
$(document).ready(function(){
mostrarColumns($('#operation :selected').val());
});
function mostrarColumns(value) {
if (value == 3) {
$('.snmpcolumn').show();
}
else {
$('.snmpcolumn').hide();
}
}
</script>
<?php
echo '<div>';
echo "<form name='actionbox' method='post'>";
echo "<table class='databox filters' width=100% id=netToolTable>";
echo '<tr><td>';
echo __('Operation');
echo '</td><td>';
html_print_select(
[
1 => __('Traceroute'),
2 => __('Ping host & Latency'),
3 => __('SNMP Interface status'),
4 => __('Basic TCP Port Scan'),
5 => __('DiG/Whois Lookup'),
],
'operation',
$operation,
'mostrarColumns(this.value)',
__('Please select')
);
echo '</td>';
echo '<td>';
echo __('IP address');
echo '</td><td>';
$ips_for_select = array_reduce(
$ips,
function ($carry, $item) {
$carry[$item['ip']] = $item['ip'];
return $carry;
}
);
html_print_select(
$ips_for_select,
'select_ips',
$principal_ip
);
echo '</td>';
echo "<td class='snmpcolumn'>";
echo __('SNMP Version');
html_print_select(
[
'1' => 'v1',
'2c' => 'v2c',
],
'select_version',
$snmp_version
);
echo '</td><td class="snmpcolumn">';
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 '</td>';
echo '</tr></table>';
echo '</form>';
if ($operation) {
// Execute form.
net_tools_execute($operation, $ip, $community, $snmp_version);
}
echo '</div>';
}
/**
* Add option.
*
* @return void
*/
function godmode_net_tools()
{
global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Profile Management'
);
include 'general/noaccess.php';
return;
}
ui_print_page_header(
__('Config Network Tools'),
'',
false,
'network_tools_tab'
);
$update_traceroute = (bool) get_parameter('update_traceroute', 0);
$traceroute_path = (string) get_parameter('traceroute_path', '');
$ping_path = (string) get_parameter('ping_path', '');
$nmap_path = (string) get_parameter('nmap_path', '');
$dig_path = (string) get_parameter('dig_path', '');
$snmpget_path = (string) get_parameter('snmpget_path', '');
if ($update_traceroute) {
$network_tools_config = [];
$network_tools_config['traceroute_path'] = $traceroute_path;
$network_tools_config['ping_path'] = $ping_path;
$network_tools_config['nmap_path'] = $nmap_path;
$network_tools_config['dig_path'] = $dig_path;
$network_tools_config['snmpget_path'] = $snmpget_path;
$result = config_update_value('network_tools_config', json_encode($network_tools_config));
ui_print_result_message(
$result,
__('Set the paths.'),
__('Set the paths.')
);
} else {
if (isset($config['network_tools_config'])) {
$network_tools_config_output = io_safe_output($config['network_tools_config']);
$network_tools_config = json_decode($network_tools_config_output, true);
$traceroute_path = $network_tools_config['traceroute_path'];
$ping_path = $network_tools_config['ping_path'];
$nmap_path = $network_tools_config['nmap_path'];
$dig_path = $network_tools_config['dig_path'];
$snmpget_path = $network_tools_config['snmpget_path'];
}
}
$table = null;
$table->width = '100%';
$table->data = [];
$table->data[0][0] = __('Traceroute path');
$table->data[0][1] = html_print_input_text('traceroute_path', $traceroute_path, '', 40, 255, true);
$table->data[1][0] = __('Ping path');
$table->data[1][1] = html_print_input_text('ping_path', $ping_path, '', 40, 255, true);
$table->data[2][0] = __('Nmap path');
$table->data[2][1] = html_print_input_text('nmap_path', $nmap_path, '', 40, 255, true);
$table->data[3][0] = __('Dig path');
$table->data[3][1] = html_print_input_text('dig_path', $dig_path, '', 40, 255, true);
$table->data[4][0] = __('Snmpget path');
$table->data[4][1] = html_print_input_text('snmpget_path', $snmpget_path, '', 40, 255, true);
echo '<form id="form_setup" method="post" >';
echo '<fieldset>';
echo '<legend>'.__('Options').'</legend>';
html_print_input_hidden('update_traceroute', 1);
html_print_table($table);
echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
echo '</div>';
echo '</form>';
}
extensions_add_godmode_menu_option(__('Config Network Tools'), 'PM');
extensions_add_godmode_function('godmode_net_tools');

View File

@ -36,14 +36,14 @@ function view_logfile($file_name)
} else if ($file_size > ($config['max_log_size'] * 1000)) { } else if ($file_size > ($config['max_log_size'] * 1000)) {
$data = file_get_contents($file_name, false, null, ($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 "<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 '... ';
echo $data; echo $data;
echo '</textarea><br><br>'; echo '</textarea><br><br>';
} else { } else {
$data = file_get_contents($file_name); $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 "<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 $data;
echo '</textarea><br><br>'; echo '</textarea><br><br>';
} }

View File

@ -207,7 +207,7 @@ function pandora_realtime_graphs()
'reset', 'reset',
false, false,
'javascript:realtimeGraphs.clearGraph();', 'javascript:realtimeGraphs.clearGraph();',
'class="sub delete" style="margin-top:0px;"', 'class="sub delete mgn_tp_0" ',
true true
); );
$table->data[] = $data; $table->data[] = $data;
@ -230,7 +230,7 @@ function pandora_realtime_graphs()
'custom_action', 'custom_action',
urlencode( urlencode(
base64_encode( 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 false

View File

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

View File

@ -30,7 +30,7 @@ function users_extension_main_god($god=true)
if ($god) { if ($god) {
$image = 'images/gm_users.png'; $image = 'images/gm_users.png';
} else { } else {
$image = 'images/op_workspace.png'; $image = 'images/user.png';
} }
// Header // Header

View File

@ -73,3 +73,4 @@ enterprise/extensions/ipam.php
enterprise/extensions/ipam enterprise/extensions/ipam
enterprise/extensions/disabled/visual_console_manager.php enterprise/extensions/disabled/visual_console_manager.php
enterprise/extensions/visual_console_manager.php enterprise/extensions/visual_console_manager.php
pandora_console/extensions/net_tools.php

View File

@ -1,5 +1,8 @@
START TRANSACTION; 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` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `summary` tinyint(1) DEFAULT 0; ALTER TABLE `treport_content_template` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
@ -8,4 +11,10 @@ UPDATE `tinventory_alert` t1 INNER JOIN `tinventory_alert` t2 ON t1.id = t2.id S
ALTER TABLE `tnotification_source` ADD COLUMN `subtype_blacklist` TEXT; ALTER TABLE `tnotification_source` ADD COLUMN `subtype_blacklist` TEXT;
SET @plugin_name = 'Network&#x20;bandwidth&#x20;SNMP';
SET @plugin_description = 'Retrieves&#x20;amount&#x20;of&#x20;digital&#x20;information&#x20;sent&#x20;and&#x20;received&#x20;from&#x20;device&#x20;or&#x20;filtered&#x20;&#x20;interface&#x20;index&#x20;over&#x20;a&#x20;particular&#x20;time&#x20;&#40;agent/module&#x20;interval&#41;.';
SET @plugin_id = '';
SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name;
INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,300,0,'perl&#x20;/usr/share/pandora_server/util/plugin/pandora_snmp_bandwidth.pl','','','','',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"SNMP&#x20;Version&#40;1,2c,3&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Community\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Interface&#x20;Index&#x20;&#40;filter&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"securityName\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"context\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"securityLevel\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"9\":{\"macro\":\"_field9_\",\"desc\":\"authProtocol\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"10\":{\"macro\":\"_field10_\",\"desc\":\"authKey\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"11\":{\"macro\":\"_field11_\",\"desc\":\"privProtocol\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"12\":{\"macro\":\"_field12_\",\"desc\":\"privKey\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"13\":{\"macro\":\"_field13_\",\"desc\":\"UniqId\",\"help\":\"This&#x20;plugin&#x20;needs&#x20;to&#x20;store&#x20;information&#x20;in&#x20;temporary&#x20;directory&#x20;to&#x20;calculate&#x20;bandwidth.&#x20;Set&#x20;here&#x20;an&#x20;unique&#x20;identifier&#x20;with&#x20;no&#x20;spaces&#x20;or&#x20;symbols.\",\"value\":\"\",\"hide\":\"\"},\"14\":{\"macro\":\"_field14_\",\"desc\":\"inUsage\",\"help\":\"Retrieve&#x20;input&#x20;usage&#x20;&#40;%&#41;\",\"value\":\"\",\"hide\":\"\"},\"15\":{\"macro\":\"_field15_\",\"desc\":\"outUsage\",\"help\":\"Retrieve&#x20;output&#x20;usage&#x20;&#40;%&#41;\",\"value\":\"\",\"hide\":\"\"}}','-version&#x20;&#039;_field1_&#039;&#x20;-community&#x20;&#039;_field2_&#039;&#x20;-host&#x20;&#039;_field3_&#039;&#x20;-port&#x20;&#039;_field4_&#039;&#x20;-ifIndex&#x20;&#039;_field5_&#039;&#x20;-securityName&#x20;&#039;_field6_&#039;&#x20;-context&#x20;&#039;_field7_&#039;&#x20;-securityLevel&#x20;&#039;_field8_&#039;&#x20;-authProtocol&#x20;&#039;_field9_&#039;&#x20;-authKey&#x20;&#039;_field10_&#039;&#x20;-privProtocol&#x20;&#039;_field11_&#039;&#x20;-privKey&#x20;&#039;_field12_&#039;&#x20;-uniqid&#x20;&#039;_field13_&#039;&#x20;-inUsage&#x20;&#039;_field14_&#039;&#x20;-outUsage&#x20;&#039;_field15_&#039;');
COMMIT; COMMIT;

View File

@ -1380,6 +1380,8 @@ ALTER TABLE `talert_actions` MODIFY COLUMN `field11` text NOT NULL,
MODIFY COLUMN `field14` text NOT NULL, MODIFY COLUMN `field14` text NOT NULL,
MODIFY COLUMN `field15` text NOT NULL; MODIFY COLUMN `field15` text NOT NULL;
ALTER TABLE `talert_actions` ADD COLUMN `create_wu_integria` TINYINT(1) default NULL;
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `talert_commands` -- Table `talert_commands`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@ -2878,6 +2880,12 @@ SET @plugin_id = '';
SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name;
INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_wmi_module',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Namespace&#x20;&#40;Optional&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"User\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"WMI&#x20;Class\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Fields&#x20;list\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Query&#x20;filter&#x20;&#40;Optional&#41;\",\"help\":\"Use&#x20;single&#x20;quotes&#x20;for&#x20;query&#x20;conditions\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Operation\",\"help\":\"Aritmetic&#x20;operation&#x20;to&#x20;get&#x20;data.&#x20;Macros&#x20;_fN_&#x20;will&#x20;be&#x20;changed&#x20;by&#x20;fields&#x20;in&#x20;list.&#x20;Example:&#x20;&#40;&#40;_f1_&#x20;-&#x20;_f2_&#41;&#x20;*&#x20;100&#41;&#x20;/&#x20;_f1_\",\"value\":\"\",\"hide\":\"\"}}','-host&#x20;&#039;_field1_&#039;&#x20;-namespace&#x20;&#039;_field2_&#039;&#x20;-user&#x20;&#039;_field3_&#039;&#x20;-pass&#x20;&#039;_field4_&#039;&#x20;-wmiClass&#x20;&#039;_field5_&#039;&#x20;-fieldsList&#x20;&#039;_field6_&#039;&#x20;-queryFilter&#x20;&quot;_field7_&quot;&#x20;-operation&#x20;&#039;_field8_&#039;&#x20;-wmicPath&#x20;/usr/bin/wmic'); INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_wmi_module',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Namespace&#x20;&#40;Optional&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"User\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"WMI&#x20;Class\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Fields&#x20;list\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Query&#x20;filter&#x20;&#40;Optional&#41;\",\"help\":\"Use&#x20;single&#x20;quotes&#x20;for&#x20;query&#x20;conditions\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Operation\",\"help\":\"Aritmetic&#x20;operation&#x20;to&#x20;get&#x20;data.&#x20;Macros&#x20;_fN_&#x20;will&#x20;be&#x20;changed&#x20;by&#x20;fields&#x20;in&#x20;list.&#x20;Example:&#x20;&#40;&#40;_f1_&#x20;-&#x20;_f2_&#41;&#x20;*&#x20;100&#41;&#x20;/&#x20;_f1_\",\"value\":\"\",\"hide\":\"\"}}','-host&#x20;&#039;_field1_&#039;&#x20;-namespace&#x20;&#039;_field2_&#039;&#x20;-user&#x20;&#039;_field3_&#039;&#x20;-pass&#x20;&#039;_field4_&#039;&#x20;-wmiClass&#x20;&#039;_field5_&#039;&#x20;-fieldsList&#x20;&#039;_field6_&#039;&#x20;-queryFilter&#x20;&quot;_field7_&quot;&#x20;-operation&#x20;&#039;_field8_&#039;&#x20;-wmicPath&#x20;/usr/bin/wmic');
SET @plugin_name = 'Network&#x20;bandwidth&#x20;SNMP';
SET @plugin_description = 'Retrieves&#x20;amount&#x20;of&#x20;digital&#x20;information&#x20;sent&#x20;and&#x20;received&#x20;from&#x20;device&#x20;or&#x20;filtered&#x20;&#x20;interface&#x20;index&#x20;over&#x20;a&#x20;particular&#x20;time&#x20;&#40;agent/module&#x20;interval&#41;.';
SET @plugin_id = '';
SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name;
INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,300,0,'perl&#x20;/usr/share/pandora_server/util/plugin/pandora_snmp_bandwidth.pl','','','','',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"SNMP&#x20;Version&#40;1,2c,3&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Community\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Interface&#x20;Index&#x20;&#40;filter&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"securityName\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"context\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"securityLevel\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"9\":{\"macro\":\"_field9_\",\"desc\":\"authProtocol\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"10\":{\"macro\":\"_field10_\",\"desc\":\"authKey\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"11\":{\"macro\":\"_field11_\",\"desc\":\"privProtocol\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"12\":{\"macro\":\"_field12_\",\"desc\":\"privKey\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"13\":{\"macro\":\"_field13_\",\"desc\":\"UniqId\",\"help\":\"This&#x20;plugin&#x20;needs&#x20;to&#x20;store&#x20;information&#x20;in&#x20;temporary&#x20;directory&#x20;to&#x20;calculate&#x20;bandwidth.&#x20;Set&#x20;here&#x20;an&#x20;unique&#x20;identifier&#x20;with&#x20;no&#x20;spaces&#x20;or&#x20;symbols.\",\"value\":\"\",\"hide\":\"\"},\"14\":{\"macro\":\"_field14_\",\"desc\":\"inUsage\",\"help\":\"Retrieve&#x20;input&#x20;usage&#x20;&#40;%&#41;\",\"value\":\"\",\"hide\":\"\"},\"15\":{\"macro\":\"_field15_\",\"desc\":\"outUsage\",\"help\":\"Retrieve&#x20;output&#x20;usage&#x20;&#40;%&#41;\",\"value\":\"\",\"hide\":\"\"}}','-version&#x20;&#039;_field1_&#039;&#x20;-community&#x20;&#039;_field2_&#039;&#x20;-host&#x20;&#039;_field3_&#039;&#x20;-port&#x20;&#039;_field4_&#039;&#x20;-ifIndex&#x20;&#039;_field5_&#039;&#x20;-securityName&#x20;&#039;_field6_&#039;&#x20;-context&#x20;&#039;_field7_&#039;&#x20;-securityLevel&#x20;&#039;_field8_&#039;&#x20;-authProtocol&#x20;&#039;_field9_&#039;&#x20;-authKey&#x20;&#039;_field10_&#039;&#x20;-privProtocol&#x20;&#039;_field11_&#039;&#x20;-privKey&#x20;&#039;_field12_&#039;&#x20;-uniqid&#x20;&#039;_field13_&#039;&#x20;-inUsage&#x20;&#039;_field14_&#039;&#x20;-outUsage&#x20;&#039;_field15_&#039;');
SET @main_component_group_name = 'Wizard'; SET @main_component_group_name = 'Wizard';
SET @component_id = ''; SET @component_id = '';
SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @main_component_group_name; SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @main_component_group_name;

View File

@ -29,7 +29,7 @@ if (check_login()) {
} }
echo "</span> 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>
<div class='modalcontent'> <div class='modalcontent'>
@ -105,7 +105,7 @@ if (check_login()) {
echo __( 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> "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(), get_product_name(),
get_product_name(), get_product_name(),
@ -136,7 +136,7 @@ if (check_login()) {
case 'modulemodal': case 'modulemodal':
echo __( 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. "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; break;
@ -192,7 +192,7 @@ if (check_login()) {
echo " echo "
</div> </div>
<div style='float:right;width:100%;height:30px;'> <div class='right height_30px'>
</div> </div>
<div class='modalokbutton cerrar'> <div class='modalokbutton cerrar'>
<span class='modalokbuttontext'>OK</span> <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 <?php
if (check_acl($config['id_user'], 0, 'PM')) { if (check_acl($config['id_user'], 0, 'PM')) {
echo "<div id='create_master_window' style='display:none;'></div>"; echo "<div id='create_master_window' class='invisible'></div>";
echo "<div id='msg' style='display:none;'></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 <?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"> <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> </form>
<?php <?php

View File

@ -21,7 +21,8 @@ ui_require_css_file('order_interpreter');
// Check permissions // Check permissions
// Global errors/warnings checking. // Global errors/warnings checking.
config_check(); config_check();
if ($config['menu_type'] == 'classic') { if ($config['menu_type'] == 'classic') {
@ -76,9 +77,9 @@ if ($config['menu_type'] == 'classic') {
if ($check_minor_release_available) { if ($check_minor_release_available) {
if (users_is_admin($config['id_user'])) { if (users_is_admin($config['id_user'])) {
if ($config['language'] == 'es') { 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 { } 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) { if ($acl_head_search) {
// Search bar. // Search bar.
$search_bar = '<form autocomplete="off" method="get" style="display: inline;" name="quicksearch" action="">'; $search_bar = '<form autocomplete="off" method="get" class="display_in" name="quicksearch" action="">';
'<input autocomplete="false" name="hidden" type="text" style="display:none;">'; '<input autocomplete="false" name="hidden" type="text" class="invisible">';
if (!isset($config['search_keywords'])) { if (!isset($config['search_keywords'])) {
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>'; $search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
} else { } else {
@ -256,7 +257,7 @@ if ($config['menu_type'] == 'classic') {
$ignored_params['refr'] = ''; $ignored_params['refr'] = '';
$values = get_refresh_time_array(); $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( $autorefresh_additional .= html_print_select(
$values, $values,
'ref', 'ref',
@ -292,7 +293,15 @@ if ($config['menu_type'] == 'classic') {
$autorefresh_link_close = '</a>'; $autorefresh_link_close = '</a>';
$display_counter = 'display:block'; $display_counter = 'display:block';
} else { } 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; $ignored_params['refr'] = false;
@ -307,7 +316,7 @@ if ($config['menu_type'] == 'classic') {
'images/header_refresh_disabled_gray.png', 'images/header_refresh_disabled_gray.png',
true, true,
[ [
'class' => 'bot autorefresh_disabled', 'class' => 'bot autorefresh_disabled invert_filter',
'alt' => 'lightning', 'alt' => 'lightning',
'title' => __('Disabled autorefresh'), 'title' => __('Disabled autorefresh'),
] ]
@ -339,10 +348,10 @@ if ($config['menu_type'] == 'classic') {
// Button for feedback pandora. // Button for feedback pandora.
if (enterprise_installed()) { if (enterprise_installed()) {
$header_feedback = '<div id="feedback-icon-header">'; $header_feedback = '<div id="feedback-icon-header">';
$header_feedback .= '<div id="modal-feedback-form" style="display:none;"></div>'; $header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
$header_feedback .= '<div id="msg-header" style="display: none"></div>'; $header_feedback .= '<div id="msg-header" class="invisible"></div>';
$header_feedback .= html_print_image( $header_feedback .= html_print_image(
'/images/feedback-header.png', 'images/feedback-header.png',
true, true,
[ [
'title' => __('Feedback'), 'title' => __('Feedback'),
@ -364,13 +373,29 @@ if ($config['menu_type'] == 'classic') {
$header_support = '<div id="header_support">'; $header_support = '<div id="header_support">';
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">'; $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>'; $header_support .= '</a></div>';
// Documentation. // Documentation.
$header_docu = '<div id="header_docu">'; $header_docu = '<div id="header_docu">';
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'; $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>'; $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. // Logout.
$header_logout = '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">'; $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, true,
[ [
'alt' => __('Logout'), 'alt' => __('Logout'),
'class' => 'bot', 'class' => 'bot invert_filter',
'title' => __('Logout'), 'title' => __('Logout'),
] ]
); );
@ -421,10 +446,10 @@ if ($config['menu_type'] == 'classic') {
<!-- Notifications content wrapper--> <!-- Notifications content wrapper-->
<div id='notification-content' style='display:none;' /></div> <div id='notification-content' class='invisible'/></div>
<!-- Old style div wrapper --> <!-- Old style div wrapper -->
<div id="alert_messages" style="display: none"></div> <div id="alert_messages" class="invisible"></div>
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
@ -877,7 +902,9 @@ if ($config['menu_type'] == 'classic') {
blinkpubli(); blinkpubli();
<?php <?php
if ($_GET['refr'] || $do_refresh === true) { if ($_GET['refr']
|| (isset($do_refresh) === true && $do_refresh === true)
) {
if ($_GET['sec2'] == 'operation/events/events') { if ($_GET['sec2'] == 'operation/events/events') {
$autorefresh_draw = true; $autorefresh_draw = true;
} }
@ -941,7 +968,7 @@ if ($config['menu_type'] == 'classic') {
var newValue = btoa(JSON.stringify(values)); var newValue = btoa(JSON.stringify(values));
<?php <?php
// Check if the url has the parameter fb64. // Check if the url has the parameter fb64.
if ($_GET['fb64']) { if (isset($_GET['fb64']) === true) {
$fb64 = $_GET['fb64']; $fb64 = $_GET['fb64'];
?> ?>
var fb64 = '<?php echo $fb64; ?>'; var fb64 = '<?php echo $fb64; ?>';

View File

@ -18,6 +18,8 @@
global $config; global $config;
if (is_ajax()) { if (is_ajax()) {
$skip_login_help = get_parameter('skip_login_help', 0); $skip_login_help = get_parameter('skip_login_help', 0);
@ -34,9 +36,9 @@ if (is_ajax()) {
} }
// Prints help dialog information // 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 __( 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!", "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(), get_product_name(),
@ -44,11 +46,11 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
); );
echo '</div>'; echo '</div>';
echo '<div style="">'; echo '<div>';
echo '<table cellspacing=0 cellpadding=0 style="border:1px solid #FFF; width:100%; height: 100%">'; echo '<table cellspacing=0 cellpadding=0 class="border_solid_white w100p h100p">';
echo '<tr>'; echo '<tr>';
echo '<td style="border:1px solid #FFF; text-align:center;">'; echo '<td class="border_solid_white 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 '<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', 'images/online_help.png',
true, true,
[ [
@ -56,12 +58,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0, 'border' => 0,
] ]
).'</a>'; ).'</a>';
echo '<br style="margin-bottom: 40px;" />'; echo '<br id="br_mb_40" />';
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 '<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>';
echo '<td style="border:1px solid #FFF; text-align:center;">'; echo '<td class="border_solid_white center">';
echo '<a href="http://pandorafms.com/" target="_blank" style="text-decoration:none;">'.html_print_image( echo '<a href="http://pandorafms.com/" target="_blank" class="no_decoration">'.html_print_image(
'images/enterprise_version.png', 'images/enterprise_version.png',
true, true,
[ [
@ -69,12 +71,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0, 'border' => 0,
] ]
).'</a>'; ).'</a>';
echo '<br style="margin-bottom: 40px;" />'; echo '<br id="br_mb_40" />';
echo '<a style="font-size: 9pt;" href="http://pandorafms.com/" target="_blank">'.__('Enterprise version').'</a>'; echo '<a class="font_9pt" href="http://pandorafms.com/" target="_blank">'.__('Enterprise version').'</a>';
echo '</td>'; echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">'; echo '<td class="border_solid_white center">';
echo '<a href="https://pandorafms.com/forums" target="_blank" style="text-decoration:none;">'.html_print_image( echo '<a href="https://pandorafms.com/forums" target="_blank" class="no_decoration">'.html_print_image(
'images/support.png', 'images/support.png',
true, true,
[ [
@ -82,12 +84,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0, 'border' => 0,
] ]
).'</a>'; ).'</a>';
echo '<br style="margin-bottom: 40px;" />'; echo '<br id="br_mb_40" />';
echo '<a style="font-size: 9pt;" href="https://pandorafms.com/forums" target="_blank">'.__('Support').' / '.__('Forums').'</a>'; echo '<a class="font_9pt" href="https://pandorafms.com/forums" target="_blank">'.__('Support').' / '.__('Forums').'</a>';
echo '</td>'; echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">'; echo '<td class="border_solid_white center">';
echo '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank" style="text-decoration:none;">'.html_print_image( echo '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank" class="no_decoration">'.html_print_image(
'images/documentation.png', 'images/documentation.png',
true, true,
[ [
@ -95,20 +97,20 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0, 'border' => 0,
] ]
).'</a>'; ).'</a>';
echo '<br style="margin-bottom: 40px;" />'; echo '<br id="br_mb_40" />';
echo '<a style="font-size: 9pt;"href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Documentation').'</span></a>'; echo '<a clas="font_9pt" href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Documentation').'</span></a>';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '</table>'; echo '</table>';
echo '</div>'; echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; top: 240px; right: 10px; border: 1px solid #FFF; width: 570px">'; echo '<div class="absolute help_dialog_login" ">';
echo '<div style="float: left; margin-top: 3px; margin-left: 0px; width: 80%; text-align: left;">'; echo '<div class="skip_help_login">';
html_print_checkbox('skip_login_help', 1, false, false, false, 'cursor: \'pointer\''); 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>';
echo '<div style="float: right; width: 20%;">'; 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" style="width:100px;"'); 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>';
echo '</div>'; echo '</div>';

View File

@ -17,6 +17,10 @@ if (isset($config['homedir'])) {
$homedir = ''; $homedir = '';
} }
global $config;
ui_require_css_file('login', 'include/styles/', true); ui_require_css_file('login', 'include/styles/', true);
require_once __DIR__.'/../include/functions_ui.php'; require_once __DIR__.'/../include/functions_ui.php';
@ -197,9 +201,6 @@ if (is_metaconsole() === true) {
} else { } else {
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true); html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} }
// 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>'; echo '</a></div>';
@ -214,7 +215,7 @@ switch ($login_screen) {
} }
if ($config['auth'] == 'saml') { 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( html_print_input_text_extended(
'nick', 'nick',
'', '',
@ -228,7 +229,7 @@ switch ($login_screen) {
); );
echo '</div>'; 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( html_print_input_text_extended(
'pass', 'pass',
'', '',
@ -244,7 +245,7 @@ switch ($login_screen) {
); );
echo '</div>'; 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"'); html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="next_login"');
echo '</div>'; echo '</div>';

View File

@ -15,9 +15,9 @@
<div class='databox' id='login'> <div class='databox' id='login'>
<div id='login_f' class='databox'> <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> <a href="index.php"><img src="images/pandora_logo.png" border="0"></a><br>
<?php echo $pandora_version; ?> <?php echo $pandora_version; ?>
</div> </div>

View File

@ -38,17 +38,17 @@ if (!empty($news)) {
} }
// Prints news dialog template // 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 '<div class="parent_new_dialog_tmplt">';
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 id="new_text"></span>';
echo '<span style="font-size: 12px; display: block; margin-top: 20px;" id="new_author"></span>'; echo '<span id="new_author"></span>';
echo '<span style="font-size: 12px; display: block; font-style: italic;" id="new_timestamp"></span>'; echo '<span id="new_timestamp"></span>';
echo '</div>'; echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; top: 340px; right: 10px; width: 570px">'; echo '<div id="div_btn_new_dialog">';
echo '<div style="float: right; width: 20%;">'; 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" style="width:100px;"'); 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>';
echo '</div>'; echo '</div>';

View File

@ -11,6 +11,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config;
if (file_exists('images/grafico_llave.png')) { if (file_exists('images/grafico_llave.png')) {
ui_print_page_header(__('You don\'t have access to this page'), '', false, '', true); ui_print_page_header(__('You don\'t have access to this page'), '', false, '', true);
} else { } else {
@ -18,17 +19,17 @@ if (file_exists('images/grafico_llave.png')) {
} }
?> ?>
<div id="noaccess" style="width: 500px; height:180px;"> <div id="noaccess">
<div id="noaccess-title" style=" height: 20px; width: 98%;"><?php echo __('Access to this page is restricted'); ?></div> <div id="noaccess-title"><?php echo __('Access to this page is restricted'); ?></div>
<div> <div>
<div id="noaccess-image" style="width: 15%;"> <div id="noaccess-image">
<?php <?php
if (file_exists('images/grafico_llave.png')) { if (file_exists('images/grafico_llave.png')) {
echo html_print_image('images/grafico_llave.png', true, ['alt' => __('No access')]); echo html_print_image('images/grafico_llave.png', true, ['alt' => __('No access')]);
} }
?> ?>
</div> </div>
<div id="noaccess-text" style="width: 70%;"> <div id="noaccess-text">
<?php <?php
echo __( echo __(
'Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br/> <br/> '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.php';
require_once '../include/functions_html.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 <?php
echo __('%s help system', get_product_name()); 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"> <meta http-equiv="content-type" content="text/html; charset=utf-8">
</head> </head>
<?php echo '<link rel="stylesheet" href="../include/styles/'.$config['style'].'.css" type="text/css">'; ?> <?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 <?php
$id = get_parameter('id'); $id = get_parameter('id');
$id_user = get_parameter('id_user'); $id_user = get_parameter('id_user');
@ -59,30 +59,30 @@ foreach ($files as $file) {
$logo = ui_get_custom_header_logo(true); $logo = ui_get_custom_header_logo(true);
if (! $id || ! file_exists($help_file)) { 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()) { if (!is_metaconsole()) {
echo html_print_image($logo, true, ['border' => '0']); echo html_print_image($logo, true, ['border' => '0']);
} }
echo '</div>'; echo '</div>';
echo '<div style="font-family: verdana, arial; font-size: 11px; text-align:left; background-color: #fff;">'; echo '<div id="parent_dic">';
echo '<div style="font-size: 12px; background-color: #fff; ;border:0px;" class="databox">'; echo '<div class="databox bg-white font_12px no_border">';
echo '<HR style="margin-top: 0px;">'; echo '<hr class="mgn_tp_0">';
echo '<h1 style="padding-left: 30px">'; echo '<h1 class="pdd_l_30px">';
echo __('Help system error'); echo __('Help system error');
echo '</h1>'; echo '</h1>';
echo "<div style='text-align: center; background-color: #fff'>"; echo "<div class='center bg-white'>";
echo '</div>'; 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 '<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'; include 'footer.php';
return; return;
} }
// Show help // 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()) { if (!empty($config['enterprise_installed']) && is_metaconsole()) {
echo '<img src="'.$config['homeurl'].$logo.'">'; echo '<img src="'.$config['homeurl'].$logo.'">';
} else { } else {
@ -90,7 +90,7 @@ if (!empty($config['enterprise_installed']) && is_metaconsole()) {
} }
echo '</div>'; echo '</div>';
echo '<div id="main_help_new_content" style="height: auto ! important;overfloat: auto;">'; echo '<div id="main_help_new_content">';
ob_start(); ob_start();
require_once $help_file; require_once $help_file;
$help = ob_get_contents(); $help = ob_get_contents();

View File

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

View File

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

View File

@ -142,7 +142,7 @@ unset($filter['offset']);
if (! is_ajax()) { if (! is_ajax()) {
echo '<div id="agents_loading" class="loading invisible">'; 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 __('Loading').'&hellip;';
echo '</div>'; 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; $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_url = ui_get_full_url(
$csv_img = html_print_image('images/csv_mc.png', true, ['title' => __('Export to CSV')]); 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 = [ $header_buttons = [
'csv' => [ 'csv' => [
'active' => false, 'active' => false,

View File

@ -22,7 +22,7 @@ require_once 'include/functions_agents.php';
ui_require_javascript_file('openlayers.pandora'); 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); $agentData = gis_get_data_last_position_agent($id_agente);
$updateGisData = db_get_value('update_gis_data', 'tagente', 'id_agente', $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); $agent_name = md5($agent_name);
// Map with the current position // 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)) { 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.')); 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][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] = __('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, '', 'style="margin-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; $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente;
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();'>"; echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();'>";
html_print_input_hidden('update_gis', 1); html_print_input_hidden('update_gis', 1);
html_print_table($table); 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"'); html_print_submit_button(__('Update'), '', false, 'class="sub upd"');
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';

View File

@ -18,6 +18,11 @@ require_once 'include/functions_incidents.php';
check_login(); check_login();
if (!$config['integria_enabled']) {
ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured'));
return;
}
$group = $id_grupo; $group = $id_grupo;
if (! check_acl($config['id_user'], $group, 'AW', $id_agente)) { if (! check_acl($config['id_user'], $group, 'AW', $id_agente)) {
@ -38,30 +43,25 @@ $groups = users_get_groups($config['id_user'], 'IR');
$filter = ' AND id_agent = '.$id_agent; $filter = ' AND id_agent = '.$id_agent;
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agent; $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agent;
// Select incidencts where the user has access to ($groups from $params = [
// get_user_groups), array_keys for the id, implode to pass to SQL '',
switch ($config['dbtype']) { '-10',
case 'mysql': '1',
$sql = 'SELECT * FROM tincidencia WHERE '-1',
id_grupo IN ('.implode(',', array_keys($groups)).')'.$filter.' '0',
ORDER BY actualizacion DESC LIMIT '.$offset.','.$config['block_size']; '',
break; '',
'',
agents_get_name($id_agent),
];
case 'oracle': $result = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incidents', $params, false, 'json', ',');
$sql = 'SELECT * FROM tincidencia WHERE
id_grupo IN ('.implode(',', array_keys($groups)).')'.$filter.'
AND rownum <= '.$offset.','.$config['block_size'].'
ORDER BY actualizacion DESC';
break;
}
$result = db_get_all_rows_sql($sql); $result = json_decode($result, true);
$count_sql = 'SELECT count(*) FROM tincidencia WHERE $count = count($result);
id_grupo IN ('.implode(',', array_keys($groups)).')'.$filter.'
ORDER BY actualizacion DESC';
$count = db_get_value_sql($count_sql); $result = array_slice($result, $offset, $config['block_size']);
if (empty($result)) { if (empty($result)) {
$result = []; $result = [];
@ -91,8 +91,6 @@ $table->head[2] = __('Incident');
$table->head[3] = __('Priority'); $table->head[3] = __('Priority');
$table->head[4] = __('Group'); $table->head[4] = __('Group');
$table->head[5] = __('Updated'); $table->head[5] = __('Updated');
$table->head[6] = __('Source');
$table->head[7] = __('Owner');
$table->size[0] = 43; $table->size[0] = 43;
$table->size[7] = 50; $table->size[7] = 50;
@ -115,7 +113,7 @@ foreach ($result as $row) {
$data = []; $data = [];
$data[0] = '<a href="index.php?sec=incidencias&amp;sec2=operation/incidents/incident_detail&amp;id='.$row['id_incidencia'].'">'.$row['id_incidencia'].'</a>'; $data[0] = '<a href="index.php?sec=incident&sec2=operation/incidents/dashboard_detail_integriaims_incident&incident_id='.$row['id_incidencia'].'">'.$row['id_incidencia'].'</a>';
$attach = incidents_get_attach($row['id_incidencia']); $attach = incidents_get_attach($row['id_incidencia']);
if (!empty($attach)) { if (!empty($attach)) {
@ -123,12 +121,10 @@ foreach ($result as $row) {
} }
$data[1] = incidents_print_status_img($row['estado'], true); $data[1] = incidents_print_status_img($row['estado'], true);
$data[2] = '<a href="index.php?sec=incidencias&amp;sec2=operation/incidents/incident_detail&amp;id='.$row['id_incidencia'].'">'.substr(io_safe_output($row['titulo']), 0, 45).'</a>'; $data[2] = '<a href="index.php?sec=incident&sec2=operation/incidents/dashboard_detail_integriaims_incident&incident_id='.$row['id_incidencia'].'">'.substr(io_safe_output($row['titulo']), 0, 45).'</a>';
$data[3] = incidents_print_priority_img($row['prioridad'], true); $data[3] = incidents_print_priority_img($row['prioridad'], true);
$data[4] = ui_print_group_icon($row['id_grupo'], true); $data[4] = $row['id_grupo'];
$data[5] = ui_print_timestamp($row['actualizacion'], true); $data[5] = ui_print_timestamp($row['actualizacion'], true);
$data[6] = $row['origen'];
$data[7] = ui_print_username($row['id_usuario'], true);
array_push($table->data, $data); array_push($table->data, $data);
} }
@ -139,4 +135,4 @@ echo '</div>';
unset($table); unset($table);
echo '<br><br>'; 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; return;
} }
ui_require_javascript_file('openlayers.pandora'); ui_require_javascript_file('openlayers.pandora');
$new_agent = (empty($id_agente)) ? true : false; $new_agent = (empty($id_agente)) ? true : false;
@ -207,11 +209,11 @@ $custom_id_div .= html_print_input_text(
if (!$new_agent && $alias != '') { 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"><p class="input_label">'.__('Agent name').'</p>';
$table_agent_name .= '<div class="label_select_parent">'; $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_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" style="width: 70%;">'; $table_agent_name .= '<div class="label_select_child_right agent_options_agent_name w70p">';
if ($id_agente) { 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 .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
$table_agent_name .= html_print_image( $table_agent_name .= html_print_image(
'images/zoom.png', 'images/zoom.png',
@ -219,6 +221,7 @@ if (!$new_agent && $alias != '') {
[ [
'border' => 0, 'border' => 0,
'title' => __('Agent detail'), 'title' => __('Agent detail'),
'class' => 'invert_filter',
] ]
); );
$table_agent_name .= '</a>'; $table_agent_name .= '</a>';
@ -228,7 +231,14 @@ if (!$new_agent && $alias != '') {
// Delete link from here. // Delete link from here.
if (!is_central_policies_on_node()) { 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. // Remote configuration available.
@ -245,6 +255,7 @@ if (!$new_agent && $alias != '') {
[ [
'border' => 0, 'border' => 0,
'title' => __('This agent can be remotely configured'), 'title' => __('This agent can be remotely configured'),
'class' => 'invert_filter',
] ]
); );
$table_agent_name .= '</a>'; $table_agent_name .= '</a>';
@ -578,6 +589,7 @@ if (enterprise_installed()) {
[ [
'title' => __('Delete remote configuration file'), 'title' => __('Delete remote configuration file'),
'style' => 'vertical-align: middle;', 'style' => 'vertical-align: middle;',
'class' => 'invert_filter',
] ]
).'</a>'; ).'</a>';
$table_adv_remote .= '</a>'; $table_adv_remote .= '</a>';
@ -736,11 +748,11 @@ $table_adv_agent_icon = '<div class="label_select"><p class="input_label">'.__('
if ($icon_path == '') { if ($icon_path == '') {
$display_icons = 'none'; $display_icons = 'none';
// Hack to show no icon. Use any given image to fix not found image errors. // Hack to show no icon. Use any given image to fix not found image errors.
$path_without = 'images/spinner.png'; $path_without = 'images/spinner.gif';
$path_default = 'images/spinner.png'; $path_default = 'images/spinner.gif';
$path_ok = 'images/spinner.png'; $path_ok = 'images/spinner.gif';
$path_bad = 'images/spinner.png'; $path_bad = 'images/spinner.gif';
$path_warning = 'images/spinner.png'; $path_warning = 'images/spinner.gif';
} else { } else {
$display_icons = ''; $display_icons = '';
$path_without = $path.$icon_path.'.default.png'; $path_without = $path.$icon_path.'.default.png';
@ -794,7 +806,7 @@ if ($config['activate_gis']) {
if (enterprise_installed()) { if (enterprise_installed()) {
$advanced_div = '<div class="secondary_groups_list">'; $advanced_div = '<div class="secondary_groups_list">';
} else { } else {
$advanced_div = '<div class="secondary_groups_list" style="display: none">'; $advanced_div = '<div class="secondary_groups_list invisible" >';
} }
// General display distribution. // General display distribution.
@ -913,7 +925,7 @@ foreach ($fields as $field) {
2, 2,
65, 65,
$custom_value, $custom_value,
'style="min-height: 30px;"', 'class="min-height-30px',
true 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>';
} }
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. // The context help about the learning mode.
if ($modo == 0) { 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 { } 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'); 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 '<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'); html_print_select($select, 'template_id', '', '', '', 0, false, false, true, '', false, 'max-width: 200px !important');
echo '</td>'; echo '</td>';
echo '<td class="datos">'; 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 '</td>';
echo '</tr>'; echo '</tr>';
echo '</form>'; echo '</form>';
@ -246,7 +246,7 @@ foreach ($result as $row) {
$data[0] = '<span>'.$row['nombre']; $data[0] = '<span>'.$row['nombre'];
if ($row['id_tipo_modulo'] > 0) { 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 { } else {
$data[1] = ''; $data[1] = '';
} }
@ -254,8 +254,8 @@ foreach ($result as $row) {
$data[2] = mb_substr($row['descripcion'], 0, 60); $data[2] = mb_substr($row['descripcion'], 0, 60);
$table->cellclass[][3] = 'action_buttons'; $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&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, ['border' => '0', 'alt' => __('Update')]).'</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); array_push($table->data, $data);
} }

View File

@ -366,7 +366,14 @@ $img_style = [
if ($id_agente) { if ($id_agente) {
// View tab. // 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/eye.png',
true,
[
'title' => __('View'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'view') { if ($tab == 'view') {
$viewtab['active'] = true; $viewtab['active'] = true;
@ -377,7 +384,14 @@ if ($id_agente) {
$viewtab['operation'] = 1; $viewtab['operation'] = 1;
// Main tab. // 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') { if ($tab == 'main') {
$maintab['active'] = true; $maintab['active'] = true;
} else { } else {
@ -385,7 +399,14 @@ if ($id_agente) {
} }
// Module tab. // 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') { if ($tab == 'module') {
$moduletab['active'] = true; $moduletab['active'] = true;
@ -394,7 +415,14 @@ if ($id_agente) {
} }
// Alert tab. // 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') { if ($tab == 'alert') {
$alerttab['active'] = true; $alerttab['active'] = true;
@ -403,7 +431,14 @@ if ($id_agente) {
} }
// Template tab. // 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') { if ($tab == 'template') {
$templatetab['active'] = true; $templatetab['active'] = true;
@ -446,7 +481,14 @@ if ($id_agente) {
} }
// Group tab. // 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; $grouptab['active'] = false;
@ -454,7 +496,14 @@ if ($id_agente) {
// GIS tab. // GIS tab.
if ($config['activate_gis']) { 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') { if ($tab == 'gis') {
$gistab['active'] = true; $gistab['active'] = true;
@ -464,18 +513,46 @@ if ($id_agente) {
} }
// Agent wizard tab. // 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. // Hidden subtab layer.
$agent_wizard['sub_menu'] = '<ul class="mn subsubmenu" style="display:none; float:none;">'; $agent_wizard['sub_menu'] = '<ul class="mn subsubmenu invisible float-none">';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">'; $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')]).'</a>'; $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>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">'; $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')]).'</a>'; $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>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">'; $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')]).'</a>'; $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'] .= '</li>';
$agent_wizard['sub_menu'] .= '</ul>'; $agent_wizard['sub_menu'] .= '</ul>';
@ -491,7 +568,14 @@ if ($id_agente) {
// Incident tab. // Incident tab.
if ($total_incidents > 0) { if ($total_incidents > 0) {
$incidenttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=incident&amp;id_agente='.$id_agente.'">'.html_print_image('images/book_edit.png', true, ['title' => __('Incidents')]).'</a>'; $incidenttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=incident&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/book_edit.png',
true,
[
'title' => __('Incidents'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'incident') { if ($tab == 'incident') {
$incidenttab['active'] = true; $incidenttab['active'] = true;
@ -509,7 +593,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( $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', 'images/remote_configuration.png',
true, true,
['title' => __('Remote configuration')] [
'title' => __('Remote configuration'),
'class' => 'invert_filter',
]
).'</a>'; ).'</a>';
if ($tab == 'remote_configuration') { if ($tab == 'remote_configuration') {
$remote_configuration_tab['active'] = true; $remote_configuration_tab['active'] = true;
@ -725,7 +812,7 @@ if ($id_agente) {
// Create agent. // Create agent.
ui_print_page_header( ui_print_page_header(
__('Agent manager'), __('Agent manager'),
'images/bricks.png', 'images/agent.png',
false, false,
'create_agent', 'create_agent',
true, true,
@ -2402,7 +2489,7 @@ switch ($tab) {
width: 600, width: 600,
title: 'Changing the module name of a satellite agent', title: 'Changing the module name of a satellite agent',
open: function(){ 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: [{ buttons: [{
text: "Ok", text: "Ok",
@ -2436,7 +2523,7 @@ switch ($tab) {
width: 650, width: 650,
title: 'Changing snmp module name', title: 'Changing snmp module name',
open: function(){ 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: [{ buttons: [{
text: "Ok", text: "Ok",

View File

@ -49,20 +49,20 @@ $table->style[2] = 'font-weight: bold';
$table->style[4] = 'font-weight: bold'; $table->style[4] = 'font-weight: bold';
$table->style[6] = 'font-weight: bold'; $table->style[6] = 'font-weight: bold';
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>"; echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
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 "<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>';
echo "<div id='message_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>"; echo "<div id='message_set_combo' title='".__('Agent Custom Fields Information')."' class='invisible'>";
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 "<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>';
echo "<div id='message_no_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>"; echo "<div id='message_no_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Enabled combo the Password type will be disabled.').'</p>'; echo "<p class='center bolder'>".__('If you select Enabled combo the Password type will be disabled.').'</p>';
echo '</div>'; echo '</div>';
echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>"; echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>'; echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>'; echo '</div>';

View File

@ -141,14 +141,18 @@ foreach ($fields as $field) {
$data[1] = '<b>'.$field['name'].'</b>'; $data[1] = '<b>'.$field['name'].'</b>';
if ($field['display_on_front']) { 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 { } 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'; $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/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']).'</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); array_push($table->data, $data);
} }

View File

@ -32,7 +32,16 @@ if (($ag_group == -1) && ($group_id != 0)) {
$ag_group = $group_id; $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( db_pandora_audit(
'ACL Violation', 'ACL Violation',
'Trying to access agent manager' 'Trying to access agent manager'
@ -51,7 +60,14 @@ $search = get_parameter('search', '');
$tab = 'view'; $tab = 'view';
// Setup tab. // 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; $viewtab['operation'] = true;
@ -60,10 +76,19 @@ $viewtab['active'] = false;
$onheader = ['view' => $viewtab]; $onheader = ['view' => $viewtab];
// Header. // 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()) { 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. // Perform actions.
@ -72,9 +97,13 @@ $enable_agent = (int) get_parameter('enable_agent');
$disable_agent = (int) get_parameter('disable_agent'); $disable_agent = (int) get_parameter('disable_agent');
if ($disable_agent != 0) { 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) { } 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; 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()) { if (enterprise_installed()) {
// Check if the remote config file still exist. // Check if the remote config file still exist.
if (isset($config['remote_config'])) { if (isset($config['remote_config'])) {
enterprise_include_once('include/functions_config_agents.php'); enterprise_include_once(
if (enterprise_hook('config_agents_has_remote_configuration', [$id_agente])) { 'include/functions_config_agents.php'
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted')); );
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) { 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)); $alias = io_safe_output(agents_get_alias($enable_agent));
if ($result) { if ($result) {
// Update the agent from the metaconsole cache. // Update the agent from the metaconsole cache.
enterprise_include_once('include/functions_agents.php'); enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 0]; $values = ['disabled' => 0];
enterprise_hook('agent_update_from_cache', [$enable_agent, $values, $server_name]); enterprise_hook(
enterprise_hook('config_agents_update_config_token', [$enable_agent, 'standby', 0]); 'agent_update_from_cache',
db_pandora_audit('Agent management', 'Enable '.$alias); [
$enable_agent,
$values,
$server_name,
]
);
enterprise_hook(
'config_agents_update_config_token',
[
$enable_agent,
'standby',
0,
]
);
db_pandora_audit(
'Agent management',
'Enable '.$alias
);
} else { } else {
db_pandora_audit('Agent management', 'Fail to enable '.$alias); db_pandora_audit(
'Agent management',
'Fail to enable '.$alias
);
} }
ui_print_result_message( ui_print_result_message(
@ -143,12 +208,32 @@ if ($disable_agent) {
// Update the agent from the metaconsole cache. // Update the agent from the metaconsole cache.
enterprise_include_once('include/functions_agents.php'); enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 1]; $values = ['disabled' => 1];
enterprise_hook('agent_update_from_cache', [$disable_agent, $values, $server_name]); enterprise_hook(
enterprise_hook('config_agents_update_config_token', [$disable_agent, 'standby', 1]); '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 { } else {
db_pandora_audit('Agent management', 'Fail to disable '.$alias); db_pandora_audit(
'Agent management',
'Fail to disable '.$alias
);
} }
ui_print_result_message( 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>"; <tr>";
echo "<form method='post' echo "<form method='post'
action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'>"; action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'>";
@ -167,14 +252,33 @@ echo '<td>';
echo __('Group').'&nbsp;'; echo __('Group').'&nbsp;';
$own_info = get_user_info($config['id_user']); $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; $return_all_group = false;
} else { } else {
$return_all_group = true; $return_all_group = true;
} }
echo '<div class="w250px inline">'; 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 '</div>';
echo '<td>'; echo '<td>';
echo __('Show Agents').'&nbsp;'; echo __('Show Agents').'&nbsp;';
@ -183,14 +287,21 @@ $fields = [
1 => __('Only disabled'), 1 => __('Only disabled'),
0 => __('Only enabled'), 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 '<td>'; echo '<td>';
echo __('Operative System').'&nbsp;'; 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 = []; $fields = [];
foreach ($pre_fields as $key => $value) { foreach ($pre_fields as $key => $value) {
@ -203,13 +314,23 @@ echo '</td>';
echo '<td>'; echo '<td>';
echo __('Recursion').'&nbsp;'; 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 '</td><td>';
echo __('Search').'&nbsp;'; echo __('Search').'&nbsp;';
html_print_input_text('search', $search, '', 12); 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 '</td><td>';
echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>"; echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>";
@ -495,7 +616,7 @@ if ($agents !== false) {
echo '<th>'.__('Type').'</th>'; echo '<th>'.__('Type').'</th>';
echo '<th>'.__('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown).'</th>'; echo '<th>'.__('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown).'</th>';
echo '<th>'.__('Description').'</th>'; echo '<th>'.__('Description').'</th>';
echo "<th style='text-align:left'>".__('Actions').'</th>'; echo "<th class='context_help_body'>".__('Actions').'</th>';
echo '</tr></thead>'; echo '</tr></thead>';
$color = 1; $color = 1;
@ -503,16 +624,35 @@ if ($agents !== false) {
$iterator = 0; $iterator = 0;
foreach ($agents as $agent) { foreach ($agents as $agent) {
// Begin Update tagente.remote 0/1 with remote agent function return. // Begin Update tagente.remote 0/1 with remote agent function return.
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) { if (enterprise_hook(
db_process_sql_update('tagente', ['remote' => 1], 'id_agente = '.$agent['id_agente'].''); 'config_agents_has_remote_configuration',
[$agent['id_agente']]
)
) {
db_process_sql_update(
'tagente',
['remote' => 1],
'id_agente = '.$agent['id_agente'].''
);
} else { } else {
db_process_sql_update('tagente', ['remote' => 0], 'id_agente = '.$agent['id_agente'].''); db_process_sql_update('tagente', ['remote' => 0], 'id_agente = '.$agent['id_agente'].'');
} }
// End Update tagente.remote 0/1 with remote agent function return. // End Update tagente.remote 0/1 with remote agent function return.
$all_groups = agents_get_all_groups_agent($agent['id_agente'], $agent['id_grupo']); $all_groups = agents_get_all_groups_agent(
$check_aw = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW'); $agent['id_agente'],
$check_ad = check_acl_one_of_groups($config['id_user'], $all_groups, 'AD'); $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']); $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']) { if ($agent['quiet']) {
echo '&nbsp;'; 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) { 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 '</em>';
} }
echo '</span><div class="left actions" style="visibility: hidden; clear: left">'; echo '</span><div class="left actions clear_left" style=" visibility: hidden">';
if ($check_aw) { if ($check_aw) {
if ($agent['id_os'] == CLUSTER_OS_ID) { if ($agent['id_os'] == CLUSTER_OS_ID) {
if (enterprise_installed()) { if (enterprise_installed()) {
@ -664,7 +816,15 @@ if ($agents !== false) {
enterprise_include_once('include/functions_config_agents.php'); enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) { 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 "<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>'; echo '</a>';
} }
} }
@ -702,7 +862,7 @@ if ($agents !== false) {
$offsetArg = $offset; $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']) { if ($agent['disabled']) {
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente& 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 ' 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()) { 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 ' 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>'; echo '</td>';
@ -752,7 +912,7 @@ if ($agents !== false) {
if (check_acl($config['id_user'], 0, 'AW')) { if (check_acl($config['id_user'], 0, 'AW')) {
// Create agent button. // 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">'; echo '<form method="post" action="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente">';
html_print_submit_button( html_print_submit_button(
__('Create agent'), __('Create agent'),

View File

@ -45,7 +45,7 @@ if (!isset($policy_page)) {
echo '<form id="create_module_type" method="post" action="'.$url.'">'; echo '<form id="create_module_type" method="post" action="'.$url.'">';
echo '<table width="100%" cellpadding="2" cellspacing="2" class="databox filters" >'; 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( echo __('Search').' '.html_print_input_text(
'search_string', 'search_string',
$search_string, $search_string,
@ -63,10 +63,10 @@ if (($policy_page) || (isset($agent))) {
} }
echo '</td>'; echo '</td>';
echo "<td class='datos' style='width:10%'>"; echo "<td class='datos w10p'>";
html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"'); html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"');
echo '</td>'; echo '</td>';
echo "<td class='datos' style='width:10%'></td>"; echo "<td class='datos w10p'></td>";
echo '</form>'; echo '</form>';
// Check if there is at least one server of each type available to assign that // 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. // 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. // Create module/type combo.
echo '<form id="create_module_type" method="post" action="'.$url.'">'; echo '<form id="create_module_type" method="post" action="'.$url.'">';
if (!$policy_page) { if (!$policy_page) {
echo '<td class="datos" style="font-weight: bold; width:20%;">'; echo '<td class="datos w20p bolder">';
echo __('Show in hierachy mode'); echo __('Show in hierachy mode');
if ($checked == 'true') { if ($checked == 'true') {
$checked = true; $checked = true;
@ -181,7 +181,7 @@ if (($policy_page) || (isset($agent))) {
echo '</td>'; echo '</td>';
} }
echo '<td class="datos" style="font-weight: bold; width:20%;">'; echo '<td class="datos w20p bolder">';
echo __('<p>Type</p>'); echo __('<p>Type</p>');
html_print_select( html_print_select(
$modules, $modules,
@ -199,7 +199,7 @@ if (($policy_page) || (isset($agent))) {
); );
html_print_input_hidden('edit_module', 1); html_print_input_hidden('edit_module', 1);
echo '</td>'; 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 '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('Create').'">';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
@ -210,9 +210,9 @@ if (($policy_page) || (isset($agent))) {
echo '</table>'; echo '</table>';
if (!$config['disable_help']) { 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 '<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 '</strong>';
echo '</div>'; echo '</div>';
} }
@ -899,7 +899,10 @@ foreach ($modules as $module) {
$data[0] .= html_print_image( $data[0] .= html_print_image(
'images/icono_escuadra.png', 'images/icono_escuadra.png',
true, true,
['style' => 'padding-bottom: inherit;'] [
'style' => 'padding-bottom: inherit;',
'class' => 'invert_filter',
]
).'&nbsp;&nbsp;'; ).'&nbsp;&nbsp;';
} }
@ -968,7 +971,7 @@ foreach ($modules as $module) {
$img = 'images/policies_brick.png'; $img = 'images/policies_brick.png';
$title = '('.__('Adopted').') '.$policyInfo['name_policy']; $title = '('.__('Adopted').') '.$policyInfo['name_policy'];
} else { } else {
$img = 'images/policies.png'; $img = 'images/policies_mc.png';
$title = $policyInfo['name_policy']; $title = $policyInfo['name_policy'];
} }
} else { } else {
@ -1078,6 +1081,7 @@ foreach ($modules as $module) {
[ [
'alt' => __('Disable module'), 'alt' => __('Disable module'),
'title' => __('Disable module'), 'title' => __('Disable module'),
'class' => 'invert_filter',
] ]
).'</a>'; ).'</a>';
} }
@ -1088,7 +1092,10 @@ foreach ($modules as $module) {
$data[8] .= html_print_image( $data[8] .= html_print_image(
'images/copy.png', 'images/copy.png',
true, true,
['title' => __('Duplicate')] [
'title' => __('Duplicate'),
'class' => 'invert_filter',
]
); );
$data[8] .= '</a> '; $data[8] .= '</a> ';
@ -1097,9 +1104,12 @@ foreach ($modules as $module) {
if ($numericModules[$type] === true) { 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] .= '<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( $data[8] .= html_print_image(
'images/chart_curve.png', 'images/chart.png',
true, true,
['title' => __('Normalize')] [
'title' => __('Normalize'),
'class' => 'invert_filter',
]
); );
$data[8] .= '</a>'; $data[8] .= '</a>';
} }
@ -1119,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'].'" $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;">'; onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image( $data[8] .= html_print_image(
'images/network.png', 'images/op_network.png',
true, true,
['title' => __('Create network component')] [
'title' => __('Create network component'),
'class' => 'invert_filter',
]
); );
$data[8] .= '</a> '; $data[8] .= '</a> ';
} else { } else {
@ -1141,7 +1154,10 @@ foreach ($modules as $module) {
$data[9] .= html_print_image( $data[9] .= html_print_image(
'images/cross.png', 'images/cross.png',
true, true,
['title' => __('Delete')] [
'title' => __('Delete'),
'class' => 'invert_filter',
]
); );
$data[9] .= '</a> '; $data[9] .= '</a> ';
} }

View File

@ -19,7 +19,7 @@ require_once $config['homedir'].'/include/graphs/functions_d3.php';
include_javascript_d3(); include_javascript_d3();
function prepend_table_simple($row, $id=false) global $config;function prepend_table_simple($row, $id=false)
{ {
global $table_simple; global $table_simple;
@ -119,7 +119,7 @@ function add_component_selection($id_network_component_type)
); );
$data[1] .= '</span>'; $data[1] .= '</span>';
$data[1] .= ' <span id="component_loading" class="invisible">'; $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>'; $data[1] .= '</span>';
$table_simple->colspan['module_component'][1] = 3; $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( $table_simple->data[0][1] .= html_print_image(
'images/cross.png', 'images/cross.png',
true, true,
['title' => __('Delete module')] [
'title' => __('Delete module'),
'class' => 'invert_filter',
]
); );
$table_simple->data[0][1] .= '</a> '; $table_simple->data[0][1] .= '</a> ';
} }
@ -635,7 +638,14 @@ $table_advanced->data[3][1] = html_print_extended_select_for_time(
$classdisabledBecauseInPolicy, $classdisabledBecauseInPolicy,
$disabledBecauseInPolicy $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][2] = 'hide_dinamic';
$table_advanced->cellclass[3][3] = 'hide_dinamic'; $table_advanced->cellclass[3][3] = 'hide_dinamic';
@ -717,6 +727,10 @@ $table_advanced->colspan[4][4] = 3;
// FF stands for Flip-flop. // 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][0] = __('FF threshold').' ';
$table_advanced->data[5][1] .= __('Keep counters'); $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')]); $table_advanced->data[7][2] = html_print_image(
// html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module'))); 'images/darrowright.png',
$table_advanced->data[7][2] .= '<br><br><br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'left', 'title' => __('Delete tags to module')]); true,
// html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module'))); [
'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][3] = '<b>'.__('Tags selected').'</b>';
$table_advanced->data[7][4] = html_print_select_from_sql( $table_advanced->data[7][4] = html_print_select_from_sql(
"SELECT a.id_tag, name "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->colspan[8][4] = 3;
$table_advanced->data[8][4] = html_print_select($cps_array, 'cps_module', $cps_module, '', '', 0, true, false, true, '', $disabledBecauseInPolicy); $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->data[9][0] = __('Description');
$table_advanced->colspan[9][1] = 6; $table_advanced->colspan[9][1] = 6;
@ -1128,7 +1156,7 @@ $table_macros->data = [];
$table_macros->style = []; $table_macros->style = [];
$table_macros->style[0] = 'font-weight: bold;'; $table_macros->style[0] = 'font-weight: bold;';
$table_macros->style[2] = '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 = []; $table_macros->colspan = [];
$macro_count = 0; $macro_count = 0;
@ -1140,7 +1168,7 @@ if (isset($module_macros)) {
$table_macros->data[$macro_count][2] = __('Value'); $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); $table_macros->data[$macro_count][3] = html_print_input_text('module_macro_values[]', $macro_value, '', 50, 60, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
if (!$disabledBecauseInPolicy) { 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++; $macro_count++;
@ -1149,7 +1177,7 @@ if (isset($module_macros)) {
} }
if (!$disabledBecauseInPolicy) { 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; $table_macros->colspan[$macro_count][0] = 5;
} }
@ -1211,7 +1239,7 @@ $table_new_relations->data[0][6] = html_print_button(
'class="sub add"', 'class="sub add"',
true 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. // Relationship list.
$table_relations = new stdClass(); $table_relations = new stdClass();
@ -1237,14 +1265,23 @@ $table_relations->data[-1][0] = '';
$table_relations->data[-1][1] = ''; $table_relations->data[-1][1] = '';
$table_relations->data[-1][2] = ''; $table_relations->data[-1][2] = '';
$table_relations->data[-1][3] = '<a id="disable_updates_button" class="alpha50" href="">'; $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] = '<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; $relations_count = 0;
if ($id_agent_module) { 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) { if (!$module_relations) {
$module_relations = []; $module_relations = [];
@ -1280,13 +1317,28 @@ if ($id_agent_module) {
// Agent name. // Agent name.
$table_relations->data[$relations_count][0] = $agent_name; $table_relations->data[$relations_count][0] = $agent_name;
// Module 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. // Type.
$table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover'); $table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
// Lock relationship updates. // 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. // 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++; $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 + '-0"><b>' + agent_b_name + '</b></td>' +
'<td id="module_relations-' + relationsCount + '-1">' + module_b_name + '</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 + '-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 + ');">' + '<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>' + '</a>' +
'</td>' + '</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 + ');">' + '<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>' + '</a>' +
'</td>' + '</td>' +
'</tr>'; '</tr>';

View File

@ -40,7 +40,7 @@ html_print_input_hidden(
'custom_action', 'custom_action',
urlencode( urlencode(
base64_encode( 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 false
@ -225,7 +225,7 @@ push_table_simple($data, 'snmp_1');
$data = []; $data = [];
$data[0] = __('SNMP OID'); $data[0] = __('SNMP OID');
$data[1] = '<span class="left"; style="width: 50%">'; $data[1] = '<span class="left w50p">';
$data[1] .= html_print_input_text( $data[1] .= html_print_input_text(
'snmp_oid', 'snmp_oid',
$snmp_oid, $snmp_oid,
@ -261,7 +261,7 @@ $data[1] .= html_print_image(
] ]
); );
$data[1] .= '</span>'; $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( $data[1] .= html_print_button(
__('SNMP walk'), __('SNMP walk'),
'snmp_walk', 'snmp_walk',

View File

@ -71,7 +71,7 @@ if (!empty($id_plugin)) {
$preload = ''; $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'); push_table_simple($data, 'plugin_1');

View File

@ -108,7 +108,7 @@ if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
$data[0] = ''; $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/>'; $data[1] .= html_print_label(__('Agent'), 'agent_name', true).'<br/>';
// Get module and agent of the target prediction module // Get module and agent of the target prediction module

File diff suppressed because it is too large Load Diff

View File

@ -364,12 +364,12 @@ else if (!$downtimes) {
// Info message. // Info message.
echo '<div class="nf">'.__('No planned downtime').'</div>'; echo '<div class="nf">'.__('No planned downtime').'</div>';
echo '<div class="action-buttons" style="width: 100%">'; echo '<div class="action-buttons w100p" >';
// Create button. // Create button.
if ($write_permisson) { if ($write_permisson) {
echo '&nbsp;'; 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"'); html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
echo '</form>'; echo '</form>';
} }
@ -493,9 +493,9 @@ else {
|| check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD') || check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD')
) { ) {
// Edit. // 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. // 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 { } else {
$data['edit'] = ''; $data['edit'] = '';
$data['delete'] = ''; $data['delete'] = '';
@ -505,7 +505,7 @@ else {
|| check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD') || check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD')
) { ) {
// Edit. // 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. // Delete.
$data['delete'] = __('N/A'); $data['delete'] = __('N/A');
} else { } else {
@ -539,7 +539,7 @@ else {
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
// CSV export button. // CSV export button.
echo '<div style="display: inline;">'; echo '<div class="display_in">';
html_print_button( html_print_button(
__('Export to CSV'), __('Export to CSV'),
'csv_export', 'csv_export',
@ -552,7 +552,7 @@ else {
// Create button. // Create button.
if ($write_permisson) { if ($write_permisson) {
echo '&nbsp;'; 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"'); html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
echo '</form>'; echo '</form>';
} }

View File

@ -27,6 +27,8 @@ if (! check_acl($config['id_user'], 0, 'AR')
return; return;
} }
$update = get_parameter('upd_button', ''); $update = get_parameter('upd_button', '');
$default = (int) get_parameter('default', 0); $default = (int) get_parameter('default', 0);
@ -169,6 +171,7 @@ $table->data[1][1] = '<a href="javascript:">'.html_print_image(
[ [
'id' => 'right', 'id' => 'right',
'title' => __('Add fields to select'), 'title' => __('Add fields to select'),
'class' => 'invert_filter',
] ]
).'</a>'; ).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image( $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', 'id' => 'left',
'title' => __('Delete fields to select'), 'title' => __('Delete fields to select'),
'class' => 'invert_filter',
] ]
).'</a>'; ).'</a>';
@ -235,7 +239,7 @@ $(document).ready (function () {
if(selected_fields_total === current_fields_size){ if(selected_fields_total === current_fields_size){
display_confirm_dialog( 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 __('Confirm'); ?>",
"<?php echo __('Cancel'); ?>", "<?php echo __('Cancel'); ?>",
function () { function () {

View File

@ -36,6 +36,8 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
check_login(); check_login();
enterprise_hook('open_meta_frame'); enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'LM')) { if (! check_acl($config['id_user'], 0, 'LM')) {
@ -429,9 +431,9 @@ foreach ($actions as $action) {
$text_confirm = __('Are you sure?'); $text_confirm = __('Are you sure?');
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions" $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" $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); array_push($table->data, $data);

View File

@ -62,7 +62,7 @@ if (is_ajax()) {
$command = alerts_get_alert_command($id); $command = alerts_get_alert_command($id);
// If is setted a description, we change the carriage return by <br> tags // If a description is set, change the carriage return by <br> tags.
if (isset($command['description'])) { if (isset($command['description'])) {
$command['description'] = str_replace( $command['description'] = str_replace(
[ [
@ -96,9 +96,15 @@ if (is_ajax()) {
if (!empty($field_description)) { if (!empty($field_description)) {
// If the value is 5, this because severity in snmp alerts is not permit to show. // If the value is 5, this because severity in snmp alerts is not permit to show.
if (($i > 5) && ($command['id'] == 3)) { 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 { } 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. // If the field is the number one, print the help message.
@ -131,7 +137,7 @@ if (is_ajax()) {
$field_value = io_safe_output($field_value); $field_value = io_safe_output($field_value);
// HTML type. // HTML type.
if (preg_match('/^_html_editor_$/i', $field_value)) { 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 .= __('Basic');
$editor_type_chkbx .= ui_print_help_tip( $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>'), __('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: <pre></pre>'),
@ -172,7 +178,7 @@ if (is_ajax()) {
$is_central_policies_on_node $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 .= __('Basic').'&nbsp;&nbsp;';
$editor_type_chkbx .= html_print_radio_button_extended( $editor_type_chkbx .= html_print_radio_button_extended(
'editor_type_recovery_value_'.$i, 'editor_type_recovery_value_'.$i,
@ -209,7 +215,7 @@ if (is_ajax()) {
$is_central_policies_on_node $is_central_policies_on_node
); );
} else if (preg_match('/^_content_type_$/i', $field_value)) { } 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 .= __('Text/plain');
$editor_type_chkbx .= ui_print_help_tip( $editor_type_chkbx .= ui_print_help_tip(
__('For sending emails only text plain'), __('For sending emails only text plain'),
@ -240,7 +246,7 @@ if (is_ajax()) {
$editor_type_chkbx .= '</small></b></div>'; $editor_type_chkbx .= '</small></b></div>';
$ffield = $editor_type_chkbx; $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 .= __('Text/plain');
$editor_type_chkbx .= ui_print_help_tip( $editor_type_chkbx .= ui_print_help_tip(
__('For sending emails only text plain'), __('For sending emails only text plain'),
@ -271,6 +277,76 @@ if (is_ajax()) {
$editor_type_chkbx .= '</small></b></div>'; $editor_type_chkbx .= '</small></b></div>';
$rfield = $editor_type_chkbx; $rfield = $editor_type_chkbx;
// Select type. // Select type.
} else if (preg_match('/^_integria_type_custom_field_$/i', $field_value)) {
$ffield = '';
$rfield = '';
$ffield .= '<div name="field'.$i.'_value_container">'.html_print_switch(
[
'name' => 'field'.$i.'_value[]',
'value' => '',
]
).'</div>';
$rfield .= '<div name="field'.$i.'_recovery_value_container">'.html_print_switch(
[
'name' => 'field'.$i.'_recovery_value[]',
'value' => '',
]
).'</div>';
$ffield .= html_print_select(
'',
'field'.$i.'_value[]',
'',
'',
__('None'),
'',
true,
false,
false,
'fields',
$is_central_policies_on_node
);
$rfield .= html_print_select(
'',
'field'.$i.'_recovery_value[]',
'',
'',
__('None'),
'',
true,
false,
false,
'fields',
$is_central_policies_on_node
);
$ffield .= html_print_input_text('field'.$i.'_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
$rfield .= html_print_input_text('field'.$i.'_recovery_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
$ffield .= html_print_textarea(
'field'.$i.'_value[]',
1,
1,
'',
'style="min-height:40px; '.$style.'" class="fields"',
true,
'',
$is_central_policies_on_node
);
$rfield .= html_print_textarea(
'field'.$i.'_recovery_value[]',
1,
1,
'',
'style="min-height:40px; '.$style.'" class="fields_recovery',
true,
'',
$is_central_policies_on_node
);
} else { } else {
$fields_value_select = []; $fields_value_select = [];
$fv = explode(';', $field_value); $fv = explode(';', $field_value);
@ -310,7 +386,7 @@ if (is_ajax()) {
'field'.$i.'_recovery_value', 'field'.$i.'_recovery_value',
'', '',
'', '',
'', __('None'),
0, 0,
true, true,
false, false,
@ -324,7 +400,7 @@ if (is_ajax()) {
1, 1,
1, 1,
$fv[0], $fv[0],
'style="min-height:40px; '.$style.'" class="fields"', 'style="'.$style.'" class="fields min-height-40px"',
true, true,
'', '',
$is_central_policies_on_node $is_central_policies_on_node
@ -334,7 +410,7 @@ if (is_ajax()) {
1, 1,
1, 1,
$fv[0], $fv[0],
'style="min-height:40px; '.$style.'" class="fields_recovery', 'style="'.$style.'" class="fields_recovery min-height-40px',
true, true,
'', '',
$is_central_policies_on_node $is_central_policies_on_node
@ -347,7 +423,7 @@ if (is_ajax()) {
1, 1,
1, 1,
'', '',
'style="min-height:40px; '.$style.'" class="fields"', 'style="'.$style.'" class="fields min-height-40px"',
true, true,
'', '',
$is_central_policies_on_node $is_central_policies_on_node
@ -357,7 +433,7 @@ if (is_ajax()) {
1, 1,
1, 1,
'', '',
'style="min-height:40px; '.$style.'" class="fields_recovery"', 'style="'.$style.'" class="fields_recovery min-height-40px"',
true, true,
'', '',
$is_central_policies_on_node $is_central_policies_on_node
@ -370,7 +446,7 @@ if (is_ajax()) {
$fields_rows[$i] = ''; $fields_rows[$i] = '';
} else { } else {
$fields_rows[$i] = '<tr id="table_macros-field'.$i.'" class="datos">'; $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>'; $fields_rows[$i] .= '<td class="datos">'.$ffield.'</td>';
if ($get_recovery_fields) { if ($get_recovery_fields) {
$fields_rows[$i] .= '<td class="datos recovery_col">'.$rfield.'</td>'; $fields_rows[$i] .= '<td class="datos recovery_col">'.$rfield.'</td>';
@ -561,7 +637,7 @@ if ($commands === false) {
foreach ($commands as $command) { foreach ($commands as $command) {
$data = []; $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. // (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'], 'PM')) { if (!$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'PM')) {
@ -590,12 +666,12 @@ foreach ($commands as $command) {
$table->cellclass[]['action'] = 'action_buttons'; $table->cellclass[]['action'] = 'action_buttons';
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group. // (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'], 'PM')) { 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.'" $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.'" $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>'; $data['action'] .= '</span>';
} }

View File

@ -90,14 +90,21 @@ $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="latest_value" class="invisible">'.__('Latest value').': ';
$table->data[0][1] .= '<span id="value">&nbsp;</span></span>'; $table->data[0][1] .= '<span id="value">&nbsp;</span></span>';
$table->data[0][1] .= ' <span id="module_loading" class="invisible">'; $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'); $table->data[1][0] = __('Actions');
$groups_user = users_get_groups($config['id_user']); $groups_user = users_get_groups($config['id_user']);
if (!empty($groups_user)) { if (!empty($groups_user)) {
$groups = implode(',', array_keys($groups_user)); $groups = implode(',', array_keys($groups_user));
$sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)";
if ($config['integria_enabled'] == 0) {
$integria_command = 'Integria&#x20;IMS&#x20;Ticket';
$sql = sprintf('SELECT taa.id, taa.name FROM talert_actions taa INNER JOIN talert_commands tac ON taa.id_alert_command = tac.id WHERE tac.name <> "%s" AND taa.id_group IN (%s)', $integria_command, $groups);
} else {
$sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)";
}
$actions = db_get_all_rows_sql($sql); $actions = db_get_all_rows_sql($sql);
} }
@ -124,8 +131,8 @@ $table->data[1][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
$table->data[1][1] .= '</span>'; $table->data[1][1] .= '</span>';
if (check_acl($config['id_user'], 0, 'LM')) { 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] .= '<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] .= html_print_image('images/add.png', true, ['class' => 'invert_filter']);
$table->data[1][1] .= '<span style="margin-left:0.5em;">'.__('Create Action').'</span>'; $table->data[1][1] .= '<span class="mrgn_lft_05em">'.__('Create Action').'</span>';
$table->data[1][1] .= '</a>'; $table->data[1][1] .= '</a>';
} }
@ -157,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>'; $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')) { 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] .= '<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] .= html_print_image('images/add.png', true, ['class' => 'invert_filter']);
$table->data[2][1] .= '<span style="margin-left:0.5em;">'.__('Create Template').'</span>'; $table->data[2][1] .= '<span class=""mrgn_lft_05em>'.__('Create Template').'</span>';
$table->data[2][1] .= '</a>'; $table->data[2][1] .= '</a>';
} }
@ -190,7 +197,7 @@ if ($own_info['is_admin']) {
if (!isset($step)) { if (!isset($step)) {
if ($id_cluster) { 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"'); html_print_submit_button(__('Add alert'), 'add', false, 'class="sub wand"');

View File

@ -50,9 +50,9 @@ if ($id_agente) {
// Table for filter controls // 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 = '<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 .= "<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 .= '<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 .= html_print_input_text('template_name', $templateName, '', 12, 255, true);
$form_filter .= '</td>'; $form_filter .= '</td>';
$temp = agents_get_agents(); $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 = [];
$params['return'] = true; $params['return'] = true;
@ -80,7 +80,7 @@ $form_filter .= ui_print_agent_autocomplete_input($params);
$form_filter .= '</td>'; $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 .= html_print_input_text('module_name', $moduleName, '', 12, 255, true);
$form_filter .= '</td>'; $form_filter .= '</td>';
$form_filter .= '</tr>'; $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 .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true);
$form_filter .= '</td>'; $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 .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true);
$form_filter .= '</td>'; $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 .= 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 .= '<tr>'; $form_filter .= '<tr>';
$form_filter .= "<td style='font-weight: bold;'>".__('Status').'</td><td>'; $form_filter .= "<td class='bolder'>".__('Status').'</td><td>';
$ed_list = []; $ed_list = [];
$alert_status_filter = []; $alert_status_filter = [];
$alert_status_filter['all_enabled'] = __('All (Enabled)'); $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['notfired'] = __('Not fired');
$alert_status_filter['disabled'] = __('Disabled'); $alert_status_filter['disabled'] = __('Disabled');
$form_filter .= html_print_select($alert_status_filter, 'status_alert', $status_alert, '', '', '', true); $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 = [];
$sb_list[1] = __('Standby on'); $sb_list[1] = __('Standby on');
$sb_list[0] = __('Standby off'); $sb_list[0] = __('Standby off');
$form_filter .= html_print_select($sb_list, 'standby', $standby, '', __('All'), -1, true); $form_filter .= html_print_select($sb_list, 'standby', $standby, '', __('All'), -1, true);
$form_filter .= '</td>'; $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']); $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; $return_all_group = false;
@ -158,7 +158,7 @@ if (defined('METACONSOLE')) {
$form_filter .= '</table>'; $form_filter .= '</table>';
} else { } else {
$form_filter .= '</table>'; $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 .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true);
$form_filter .= '</div>'; $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.'">'; $data[0] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab='.$main_tab.'&id_agente='.$id_agent.'">';
if ($alert['disabled']) { 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); $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" $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'].'">'; 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> '; $data[2] .= '</a> ';
if (check_acl($config['id_user'], $template_group, 'LW') || check_acl($config['id_user'], $template_group, 'LM')) { 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']); $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 // Get and show default actions for this alert
$default_action = db_get_sql( $default_action = db_get_sql(
'SELECT id_alert_action 'SELECT id_alert_action
@ -603,12 +610,12 @@ foreach ($simple_alerts as $alert) {
} }
foreach ($actions as $action_id => $action) { 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] .= '<td>';
$data[3] .= '<ul class="action_list" style="display:inline;">'; $data[3] .= '<ul class="action_list inline_line">';
$data[3] .= '<li style="display:inline;">'; $data[3] .= '<li class="inline_line">';
if ($alert['disabled']) { if ($alert['disabled']) {
$data[3] .= '<font class="action_name" style="font-style: italic; color: #aaaaaa;">'; $data[3] .= '<font class="action_name italic_a">';
} else { } else {
$data[3] .= '<font class="action_name">'; $data[3] .= '<font class="action_name">';
} }
@ -642,12 +649,11 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>'; $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); $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 // 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')) { 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 display_in">';
$data[3] .= '<form method="post" action="'.$url.'" class="delete_link" style="display: inline;">';
$data[3] .= html_print_input_image( $data[3] .= html_print_input_image(
'delete', 'delete',
'images/cross.png', 'images/cross.png',
@ -656,7 +662,7 @@ foreach ($simple_alerts as $alert) {
true, true,
[ [
'title' => __('Delete action'), 'title' => __('Delete action'),
'class' => 'action_button_img', 'class' => 'action_button_img invert_filter',
] ]
); );
$data[3] .= html_print_input_hidden('delete_action', 1, true); $data[3] .= html_print_input_hidden('delete_action', 1, true);
@ -671,7 +677,7 @@ foreach ($simple_alerts as $alert) {
true, true,
[ [
'title' => __('Update action'), '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'].'\')', '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] .= '</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] .= '</div>';
$data[3] .= '</table>'; $data[3] .= '</table>';
// Is possible manage actions if have LW permissions in the agent group of the alert module // 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.')'); $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] .= '<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('add_action', 1, true);
$data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true); $data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true);
if (! $id_agente) { if (! $id_agente) {
$data[3] .= '<tr class="datos2">'; $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] .= __('Agent');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos">'; $data[3] .= '<td class="datos">';
@ -718,7 +724,7 @@ foreach ($simple_alerts as $alert) {
} }
$data[3] .= '<tr class="datos">'; $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] .= __('Module');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos">'; $data[3] .= '<td class="datos">';
@ -726,7 +732,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '</tr>'; $data[3] .= '</tr>';
$data[3] .= '<tr class="datos2">'; $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] .= __('Action');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos2">'; $data[3] .= '<td class="datos2">';
@ -734,7 +740,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '</tr>'; $data[3] .= '</tr>';
$data[3] .= '<tr class="datos">'; $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] .= __('Number of alerts match from');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos">'; $data[3] .= '<td class="datos">';
@ -758,7 +764,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '</tr>'; $data[3] .= '</tr>';
$data[3] .= '<tr class="datos2">'; $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] .= __('Threshold');
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '<td class="datos2">'; $data[3] .= '<td class="datos2">';
@ -782,7 +788,13 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>'; $data[3] .= '</td>';
$data[3] .= '</tr>'; $data[3] .= '</tr>';
$data[3] .= '</table>'; $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] .= '</form>';
$data[3] .= '</div>'; $data[3] .= '</div>';
} }
@ -791,12 +803,24 @@ foreach ($simple_alerts as $alert) {
1 => 'action_buttons', 1 => 'action_buttons',
4 => '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']) { 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); $data[4] .= html_print_input_hidden('enable_alert', 1, true);
} else { } 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); $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 // To manage alert is necessary LW permissions in the agent group
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) { 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']) { 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); $data[4] .= html_print_input_hidden('standbyon_alert', 1, true);
} else { } 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); $data[4] .= html_print_input_hidden('standbyoff_alert', 1, true);
} }
@ -825,7 +863,7 @@ foreach ($simple_alerts as $alert) {
if ($policyInfo === false) { if ($policyInfo === false) {
$data[1] .= ''; $data[1] .= '';
} else { } 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>'; $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 // To manage alert is necessary LW permissions in the agent group
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) { 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'); $is_cluster = (bool) get_parameter('id_cluster');
if (!$is_cluster) { if (!$is_cluster) {
if ($alert['disabled']) { if ($alert['disabled']) {
@ -845,20 +883,20 @@ foreach ($simple_alerts as $alert) {
); );
} else { } else {
$data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">'; $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] .= '</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('delete_alert', 1, true);
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true); $data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
$data[4] .= '</form>'; $data[4] .= '</form>';
if ($is_cluster) { 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('upd_alert', 1, true);
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], 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')) { 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] .= '<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/eye.png', 1, '', true, ['title' => __('View alert advanced details')]); $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] .= html_print_input_hidden('id_alert', $alert['id'], true);
$data[4] .= '</form>'; $data[4] .= '</form>';
} }
@ -943,37 +981,109 @@ if (! $id_agente) {
$("input[name=disable]").attr ("title", "<?php echo __('Disable'); ?>") $("input[name=disable]").attr ("title", "<?php echo __('Disable'); ?>")
.hover (function () { .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 () { 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'); ?>") $("input[name=enable]").attr ("title", "<?php echo __('Enable'); ?>")
.hover (function () { .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 () { 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'); ?>") $("input[name=standby_on]").attr ("title", "<?php echo __('Set off standby'); ?>")
.hover (function () { .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 () { 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'); ?>") $("input[name=standby_off]").attr ("title", "<?php echo __('Set standby'); ?>")
.hover (function () { .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 () { 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 = [ $buttons = [
'list' => [ 'list' => [
'active' => false, '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' => [ 'builder' => [
'active' => false, '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% echo "<table cellpadding='4' cellspacing='4' class='databox upload bolder margin-bottom-10' width='100%
' style='font-weight: bold; margin-bottom: 10px;'><tr>"; '><tr>";
echo "<form method='post' enctype='multipart/form-data' action='index.php?sec=gagente&sec2=godmode/alerts/alert_special_days'>"; echo "<form method='post' enctype='multipart/form-data' action='index.php?sec=gagente&sec2=godmode/alerts/alert_special_days'>";
echo '<td>'; echo '<td>';
echo __('iCalendar(.ics) file').'&nbsp;'; echo __('iCalendar(.ics) file').'&nbsp;';
@ -329,12 +329,12 @@ if ($display_range) {
$html .= '">&lt;&lt;&nbsp;</a>'; $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 .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= ($display_range + 1); $html .= ($display_range + 1);
$html .= '">&nbsp;&gt;&gt;</a>'; $html .= '">&nbsp;&gt;&gt;</a>';
} else { } 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 .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_special_days&display_range=';
$html .= ($this_year - 1); $html .= ($this_year - 1);
$html .= '">&lt;&lt;&nbsp;</a>'; $html .= '">&lt;&lt;&nbsp;</a>';
@ -472,7 +472,7 @@ for ($month = 1; $month <= 12; $month++) {
if ($special_days != '') { if ($special_days != '') {
foreach ($special_days as $special_day) { 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') { if ($special_day['same_day'] == 'sunday' || $special_day['same_day'] == 'saturday') {
$cal_table->data[$cal_line][$week] .= 'color: red;'; $cal_table->data[$cal_line][$week] .= '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)) { 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] .= '<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] .= __('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] .= '<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] .= __('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] .= '<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] .= __('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_mc.png',
true,
['class' => 'invert_filter']
).'</a>';
if ($week == 6) { if ($week == 6) {
$cal_line++; $cal_line++;

View File

@ -414,7 +414,7 @@ foreach ($templates as $template) {
&& check_acl_restricted_all($config['id_user'], $template['id_group'], 'LM') && check_acl_restricted_all($config['id_user'], $template['id_group'], 'LM')
) { ) {
$table->cellclass[][4] = 'action_buttons'; $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('duplicate_template', 1, true);
$data[4] .= html_print_input_hidden('source_id', $template['id'], true); $data[4] .= html_print_input_hidden('source_id', $template['id'], true);
$data[4] .= html_print_input_image( $data[4] .= html_print_input_image(
@ -427,7 +427,7 @@ foreach ($templates as $template) {
); );
$data[4] .= '</form> '; $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('delete_template', 1, true);
$data[4] .= html_print_input_hidden('id', $template['id'], true); $data[4] .= html_print_input_hidden('id', $template['id'], true);
$data[4] .= html_print_input_image( $data[4] .= html_print_input_image(

View File

@ -58,11 +58,11 @@ $table_details->style[0] = 'font-weight: bold;';
$data = []; $data = [];
$data[0] = __('List alerts'); $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; $table_details->data[] = $data;
$data[0] = __('Agent'); $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; $table_details->data[] = $data;
$data[0] = __('Module'); $data[0] = __('Module');
@ -89,13 +89,17 @@ if ($alert['times_fired'] > 0) {
} }
$data[0] = __('Status'); $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; $table_details->data[] = $data;
$priorities = get_priorities(); $priorities = get_priorities();
$data[0] = __('Priority'); $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; $table_details->data[] = $data;
$data[0] = __('Stand by'); $data[0] = __('Stand by');
@ -107,7 +111,7 @@ if (enterprise_installed() && $alert['id_policy_alerts'] != 0) {
if ($policyInfo === false) { if ($policyInfo === false) {
$policy = __('N/A'); $policy = __('N/A');
} else { } 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>'; $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->data = [];
$table->styleTable = 'text-align: center;'; $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->head[0] = __('Actions');
$table->style[0] = 'font-weight: bold; text-align: left;'; $table->style[0] = 'font-weight: bold; text-align: left;';
@ -418,7 +422,7 @@ $modes = [];
$modes['firing'] = __('Firing'); $modes['firing'] = __('Firing');
$modes['recovering'] = __('Recovering'); $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); html_print_table($table);
unset($table); unset($table);
@ -463,7 +467,10 @@ foreach ($actions as $kaction => $action) {
$data[0] = '<b>'.$data[0].'</b><br>'; $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[1] = $template[$field];
$data[2] = $action[$field]; $data[2] = $action[$field];
$data[3] = $firing_fields[$kaction]['value'][$field] = empty($action[$field]) ? $template[$field] : $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; $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); html_print_table($table);
unset($table); unset($table);
foreach ($actions as $kaction => $action) { 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]); ui_print_info_message(['title' => __('Command preview'), 'message' => $firing_fields[$kaction]['command_preview'], 'no_close' => true]);
echo '</div>'; echo '</div>';
} }
echo '</div>'; echo '</div>';
// Firing table // 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) { if ($template['recovery_notify'] == 0) {
ui_print_info_message(['title' => __('Disabled'), 'message' => __('The alert recovering is disabled on this template.'), 'no_close' => true]); ui_print_info_message(['title' => __('Disabled'), 'message' => __('The alert recovering is disabled on this template.'), 'no_close' => true]);
} else { } else {
@ -541,7 +548,10 @@ if ($template['recovery_notify'] == 0) {
$data[0] = '<b>'.$data[0].'</b><br>'; $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[1] = $firing_fields[$kaction]['value'][$field];
$data[2] = $template[$field.'_recovery']; $data[2] = $template[$field.'_recovery'];
$data[3] = $firing_fields[$kaction][$field.'_recovery']; $data[3] = $firing_fields[$kaction][$field.'_recovery'];

View File

@ -16,6 +16,7 @@ global $config;
require_once $config['homedir'].'/include/functions_alerts.php'; require_once $config['homedir'].'/include/functions_alerts.php';
require_once $config['homedir'].'/include/functions_users.php'; require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_integriaims.php';
enterprise_include_once('meta/include/functions_alerts_meta.php'); enterprise_include_once('meta/include/functions_alerts_meta.php');
check_login(); check_login();
@ -36,6 +37,19 @@ $id = (int) get_parameter('id');
$al_action = alerts_get_alert_action($id); $al_action = alerts_get_alert_action($id);
$pure = get_parameter('pure', 0); $pure = get_parameter('pure', 0);
if (is_ajax()) {
$get_integria_ticket_custom_types = (bool) get_parameter('get_integria_ticket_custom_types');
if ($get_integria_ticket_custom_types) {
$ticket_type_id = get_parameter('ticket_type_id');
$api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incident_fields', $ticket_type_id, false, 'json');
echo $api_call;
return;
}
}
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$sec = 'advanced'; $sec = 'advanced';
} else { } else {
@ -101,6 +115,7 @@ if ($id) {
$group = $action['id_group']; $group = $action['id_group'];
$action_threshold = $action['action_threshold']; $action_threshold = $action['action_threshold'];
$create_wu_integria = $action['create_wu_integria'];
if (!check_acl_restricted_all($config['id_user'], $action['id_group'], 'LM')) { if (!check_acl_restricted_all($config['id_user'], $action['id_group'], 'LM')) {
db_pandora_audit( db_pandora_audit(
@ -200,10 +215,18 @@ $table->data[1][1] = '<div class="w250px inline">'.html_print_select_groups(
).'</div>'; ).'</div>';
$table->colspan[1][1] = 2; $table->colspan[1][1] = 2;
$create_ticket_command_id = db_get_value('id', 'talert_commands', 'name', io_safe_input('Integria IMS Ticket'));
$sql_exclude_command_id = '';
if ($config['integria_enabled'] == 0 && $create_ticket_command_id !== false) {
$sql_exclude_command_id = ' AND id <> '.$create_ticket_command_id;
}
$table->data[2][0] = __('Command'); $table->data[2][0] = __('Command');
$commands_sql = db_get_all_rows_filter( $commands_sql = db_get_all_rows_filter(
'talert_commands', 'talert_commands',
['id_group' => array_keys(users_get_groups(false, 'LW'))], 'id_group IN ('.implode(',', array_keys(users_get_groups(false, 'LW'))).')'.$sql_exclude_command_id,
[ [
'id', 'id',
'name', 'name',
@ -234,7 +257,7 @@ if ($is_central_policies_on_node === false
$table->data[2][1] .= '</a>'; $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->colspan[2][1] = 2;
$table->data[3][0] = __('Threshold'); $table->data[3][0] = __('Threshold');
@ -281,6 +304,12 @@ $table->data[5][2] = html_print_textarea(
true true
); );
$table->data[6][0] = __('Create workunit on recovery').ui_print_help_tip(
__('If closed status is set on recovery, a workunit will be added to the ticket in Integria IMS rather that closing the ticket.'),
true
);
$table->data[6][1] = html_print_checkbox_switch_extended('create_wu_integria', 1, $create_wu_integria, false, '', '', true);
for ($i = 1; $i <= $config['max_macro_fields']; $i++) { for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
$table->data['field'.$i][0] = html_print_image( $table->data['field'.$i][0] = html_print_image(
'images/spinner.gif', 'images/spinner.gif',
@ -371,6 +400,173 @@ $(document).ready (function () {
render_command_description(command_description); render_command_description(command_description);
} }
function ajax_get_integria_custom_fields(ticket_type_id, values, recovery_values) {
var values = values || [];
var recovery_values = recovery_values || [];
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
if (ticket_type_id === null || ticket_type_id === '' || (Array.isArray(values) && values.length === 0 && Array.isArray(recovery_values) && recovery_values.length === 0)) {
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').val('');
$('[name=field'+i+'_recovery_value\\[\\]').val('');
}
}
// On ticket type change, hide all table rows and inputs corresponding to custom fields, regardless of what its type is.
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
jQuery.post(
"ajax.php",
{
page: "godmode/alerts/configure_alert_action",
get_integria_ticket_custom_types: 1,
ticket_type_id: ticket_type_id
},
function(data) {
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
data.forEach(function(custom_field, key) {
var custom_field_key = key+8; // Custom fields start from field 8.
if (custom_field_key > max_macro_fields) {
return;
}
// Display field row for current input.
var custom_field_row = $('#table_macros-field'+custom_field_key);
custom_field_row.show();
// Replace label text of field row for current input.
var label_html = $('#table_macros-field'+custom_field_key+' td').first().html();
var label_name = label_html.split('<br>')[0];
var new_html_content = custom_field_row.html().replace(label_name, custom_field.label);
custom_field_row.html(new_html_content);
switch (custom_field.type) {
case 'checkbox':
var checkbox_selector = $('input:not(.datepicker)[name=field'+custom_field_key+'_value\\[\\]]');
var checkbox_recovery_selector = $('input:not(.datepicker)[name=field'+custom_field_key+'_recovery_value\\[\\]]');
checkbox_selector.on('change', function() {
if (checkbox_selector.prop('checked')) {
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.attr('value', "0");
}
});
checkbox_recovery_selector.on('change', function() {
if (checkbox_recovery_selector.prop('checked')) {
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.attr('value', "0");
}
});
if (typeof values[key] !== "undefined") {
if (values[key] == 1) {
checkbox_selector.prop('checked', true);
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.prop('checked', false);
checkbox_selector.attr('value', "0");
}
}
if (typeof recovery_values[key] !== "undefined") {
if (recovery_values[key] == 1) {
checkbox_recovery_selector.prop('checked', true);
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.prop('checked', false);
checkbox_recovery_selector.attr('value', "0");
}
}
$('[name=field'+custom_field_key+'_value_container]').show();
$('[name=field'+custom_field_key+'_recovery_value_container]').show();
$('input:not(.datepicker)[name=field'+custom_field_key+'_value\\[\\]]').show();
$('input:not(.datepicker)[name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'combo':
var combo_input = $('select[name=field'+custom_field_key+'_value\\[\\]]');
var combo_input_recovery = $('select[name=field'+custom_field_key+'_recovery_value\\[\\]]');
combo_input.find('option').remove();
combo_input_recovery.find('option').remove();
var combo_values_array = custom_field.combo_value.split(',');
combo_values_array.forEach(function(value) {
combo_input.append($('<option>', {
value: value,
text: value
}));
combo_input_recovery.append($('<option>', {
value: value,
text: value
}));
});
if (typeof values[key] !== "undefined") {
combo_input.val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
combo_input_recovery.val(recovery_values[key]);
}
combo_input.show();
combo_input_recovery.show();
break;
case 'date':
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
if (typeof values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
break;
case 'text':
case 'textarea':
case 'numeric':
if (typeof values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').show();
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
}
});
},
"json"
);
}
$("#id_command").change (function () { $("#id_command").change (function () {
values = Array (); values = Array ();
values.push({ values.push({
@ -406,6 +602,9 @@ $(document).ready (function () {
$("#group").val(0); $("#group").val(0);
} }
var integria_custom_fields_values = [];
var integria_custom_fields_rvalues = [];
for (i = 1; i <= max_fields; i++) { for (i = 1; i <= max_fields; i++) {
var old_value = ''; var old_value = '';
var old_recovery_value = ''; var old_recovery_value = '';
@ -474,6 +673,12 @@ $(document).ready (function () {
.val()); .val());
} }
} }
if ($("#id_command option:selected").text() === "Integria IMS Ticket" && i > 7) {
integria_custom_fields_values.push(old_value);
integria_custom_fields_rvalues.push(old_recovery_value);
}
// Add help hint only in first field // Add help hint only in first field
if (i == 1) { if (i == 1) {
var td_content = $table_macros_field.find('td').eq(0); var td_content = $table_macros_field.find('td').eq(0);
@ -487,6 +692,29 @@ $(document).ready (function () {
$table_macros_field.show(); $table_macros_field.show();
} }
// Ad-hoc solution for Integria IMS command: get Integia IMS Ticket custom fields only when this command is selected and we selected a ticket type to retrieve fields from.
// Check command by name since it is unvariable in any case, unlike its ID.
if ($("#id_command option:selected").text() === "Integria IMS Ticket") {
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
// At start hide all rows and inputs corresponding to custom fields, regardless of what its type is.
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
if ($('#field5_value').val() !== '') {
ajax_get_integria_custom_fields($('#field5_value').val(), integria_custom_fields_values, integria_custom_fields_rvalues);
}
$('#field5_value').on('change', function() {
ajax_get_integria_custom_fields($(this).val());
});
}
var added_config = { var added_config = {
"selector": "textarea.tiny-mce-editor", "selector": "textarea.tiny-mce-editor",
"plugins": "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable", "plugins": "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable",

View File

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

View File

@ -835,7 +835,7 @@ if ($step == 2) {
'', '',
$is_central_policies_on_node $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] .= '&nbsp;'.html_print_checkbox('matches_value', 1, $matches, true);
$table->data[6][1] .= html_print_label( $table->data[6][1] .= html_print_label(
__('Trigger when matches the value'), __('Trigger when matches the value'),
@ -959,7 +959,7 @@ if ($step == 2) {
// TinyMCE. // TinyMCE.
// triggering fields. // triggering fields.
// Basic. // 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] .= __('Basic').'&nbsp;&nbsp;';
$table->data['field'.$i][1] .= html_print_radio_button_extended( $table->data['field'.$i][1] .= html_print_radio_button_extended(
'editor_type_value_'.$i, 'editor_type_value_'.$i,
@ -992,7 +992,7 @@ if ($step == 2) {
1, 1,
1, 1,
isset($fields[$i]) ? $fields[$i] : '', isset($fields[$i]) ? $fields[$i] : '',
'style="min-height:40px;" class="fields"', 'class="fields" min-height-40px',
true, true,
'', '',
$is_central_policies_on_node $is_central_policies_on_node
@ -1000,7 +1000,7 @@ if ($step == 2) {
// Recovery. // Recovery.
// Basic. // 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] .= __('Basic').'&nbsp;&nbsp;';
$table->data['field'.$i][2] .= html_print_radio_button_extended( $table->data['field'.$i][2] .= html_print_radio_button_extended(
'editor_type_recovery_value_'.$i, 'editor_type_recovery_value_'.$i,
@ -1033,7 +1033,7 @@ if ($step == 2) {
1, 1,
1, 1,
isset($fields_recovery[$i]) ? $fields_recovery[$i] : '', isset($fields_recovery[$i]) ? $fields_recovery[$i] : '',
'style="min-height:40px" class="fields"', 'class="fields min-height-40px"',
true, true,
'', '',
$is_central_policies_on_node $is_central_policies_on_node

View File

@ -38,14 +38,28 @@ if (defined('METACONSOLE')) {
$buttons = [ $buttons = [
'list' => [ 'list' => [
'active' => false, '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 { } else {
$buttons = [ $buttons = [
'list' => [ 'list' => [
'active' => false, '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')) { 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[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/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image(
$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>'; '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 { } 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>'; $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'; $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/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image(
$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>'; '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); array_push($table->data, $data);
@ -145,7 +175,7 @@ if (!empty($result)) {
} }
// Form to add new categories or search categories // Form to add new categories or search categories
echo "<div style='width=100%; float:right;'>"; echo "<div class='w100p right_align'>";
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
echo '<form method="post" action="index.php?sec=advanced&sec2=godmode/category/edit_category&action=new&pure='.(int) $config['pure'].'">'; echo '<form method="post" action="index.php?sec=advanced&sec2=godmode/category/edit_category&action=new&pure='.(int) $config['pure'].'">';
} else { } else {

View File

@ -37,14 +37,28 @@ if (defined('METACONSOLE')) {
$buttons = [ $buttons = [
'list' => [ 'list' => [
'active' => false, '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 { } else {
$buttons = [ $buttons = [
'list' => [ 'list' => [
'active' => false, '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">'; 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')) { if (!defined('METACONSOLE')) {
echo '<div align=left style="width: 100%" class="pandora_form">'; echo '<div align=left class="pandora_form w100p">';
} else { } 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%>"; echo "<table border=0 cellpadding=4 cellspacing=4 class='databox filters' width=100%>";
@ -146,7 +160,7 @@ if (defined('METACONSOLE')) {
} }
echo '<tr>'; echo '<tr>';
echo "<td style='font-weight: bold'>"; echo "<td class='bolder'>";
html_print_label(__('Name'), 'name'); html_print_label(__('Name'), 'name');
echo '</td>'; echo '</td>';

View File

@ -198,7 +198,7 @@ $(document).ready (function () {
if(selected_fields_total === current_fields_size){ if(selected_fields_total === current_fields_size){
display_confirm_dialog( 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 __('Confirm'); ?>",
"<?php echo __('Cancel'); ?>", "<?php echo __('Cancel'); ?>",
function () { function () {

View File

@ -29,6 +29,8 @@ if (!$event_w && !$event_m) {
return; return;
} }
$delete = (bool) get_parameter('delete', 0); $delete = (bool) get_parameter('delete', 0);
$multiple_delete = (bool) get_parameter('multiple_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') || check_acl_restricted_all($config['id_user'], $filter['id_group'], 'EM')
) { ) {
$table->cellclass[][6] = 'action_buttons'; $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); array_push($table->data, $data);
@ -194,9 +203,9 @@ if (isset($data)) {
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
if (!is_metaconsole()) { if (!is_metaconsole()) {
echo "<div style='padding-bottom: 20px; text-align: right;'>"; echo "<div class='pdd_b_20px right'>";
} else { } else {
echo "<div style='float:right; '>"; echo "<div class='right'>";
} }
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
@ -207,9 +216,9 @@ if (isset($data)) {
} }
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
echo "<div style='padding-bottom: 20px; text-align: right; width:100%;'>"; echo "<div class='pdd_b_20px right w100p'>";
} else { } 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'].'">'; 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; $table->data[3] = $data;
$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( $data[1] = html_print_textarea(
'target', 'target',
3, 3,
1, 1,
$event_response['target'], $event_response['target'],
'style="min-height:initial;"', 'class="mh_initial"',
true 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[2] = '<div id="server_to_exec_label" class="labels invisible">'.__('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[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; $table->data[4] = $data;
$data = []; $data = [];
$data[0] = '<div id="command_timeout_label" style="display:none;" class="labels">'.__('Command timeout (s)'); $data[0] = '<div id="command_timeout_label" class="labels invisible">'.__('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[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; $table->data[5] = $data;
if ($event_response_id == 0) { 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'].'">'; 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); html_print_table($table);
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
echo '<div style="width:100%;text-align:right;">'; echo '<div class="w100p right">';
} else { } 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']); 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'].'">'; 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); html_print_table($table);
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
echo '<div style="width:100%;text-align:right;">'; echo '<div class="w100p right">';
} else { } 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']); 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[1] = $response['description'];
$data[2] = ui_print_group_icon($response['id_group'], true); $data[2] = ui_print_group_icon($response['id_group'], true);
$table->cellclass[][3] = 'action_buttons'; $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&action=delete_response&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image(
$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>'; '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; $table->data[] = $data;
} }
html_print_table($table); 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'].'">'; 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 '</form>';
echo '</div>'; 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')) { if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EM')) {
$buttons['view'] = [ $buttons['view'] = [
'active' => false, '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, 'operation' => true,
]; ];
$buttons['filter'] = [ $buttons['filter'] = [
'active' => false, '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')) { if (check_acl($config['id_user'], 0, 'PM')) {
$buttons['responses'] = [ $buttons['responses'] = [
'active' => false, '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'] = [ $buttons['fields'] = [
'active' => false, '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. // GNU General Public License for more details.
check_login(); check_login();
global $config;
if (! check_acl($config['id_user'], 0, 'PM')) { if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit( db_pandora_audit(
'ACL Violation', 'ACL Violation',
@ -144,11 +146,6 @@ $table->head[] = __('Login Function');
$table->head[] = __('Agent operation tab'); $table->head[] = __('Agent operation tab');
$table->head[] = __('Agent godmode tab'); $table->head[] = __('Agent godmode tab');
$table->head[] = __('Operation'); $table->head[] = __('Operation');
/*
$table->width = array();
$table->width[] = '30%';
$table->width[] = '30%';
*/
$table->width = '100%'; $table->width = '100%';
$table->class = 'info_table'; $table->class = 'info_table';
@ -174,7 +171,7 @@ foreach ($extensions as $file => $extension) {
if (!$extension['enabled']) { if (!$extension['enabled']) {
$on = html_print_image('images/dot_green.disabled.png', true); $on = html_print_image('images/dot_green.disabled.png', true);
$off = html_print_image('images/dot_red.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 // Get version of this extensions
if ($config['extensions'][$file]['operation_menu']) { if ($config['extensions'][$file]['operation_menu']) {
@ -259,7 +256,7 @@ foreach ($extensions as $file => $extension) {
if (!$extension['enabled']) { 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>'; $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 { } 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 { } else {
$data[] = ''; $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( 'text' => '<a href="index.php?sec=godgismaps&sec2=operation/gis_maps/gis_map">'.html_print_image(
'images/list.png', 'images/list.png',
true, true,
['title' => __('GIS Maps list')] [
'title' => __('GIS Maps list'),
'class' => 'invert_filter',
]
).'</a>', ).'</a>',
]; ];
if ($idMap) { 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( 'text' => '<a href="index.php?sec=gismaps&sec2=operation/gis_maps/render_view&map_id='.$idMap.'">'.html_print_image(
'images/op_gis.png', 'images/op_gis.png',
true, true,
['title' => __('View GIS')] [
'title' => __('View GIS'),
'class' => 'invert_filter',
]
).'</a>', ).'</a>',
]; ];
} }
@ -448,13 +454,17 @@ foreach ($listConnectionTemp as $connectionTemp) {
} }
$table->data[1][0] = __('Add Map connection').$iconError; $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> <tr>
<td style='padding:0px;' > <td >
".html_print_select($listConnection, 'map_connection', '', '', '', '0', true)." ".html_print_select($listConnection, 'map_connection', '', '', '', '0', true)."
</td> </td>
<td style='padding:0px;' > <td >
<a href='javascript: addConnectionMap();'>".html_print_image('images/add.png', true)."</a> <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='map_connection_list' value='' id='map_connection_list' />
<input type='hidden' name='layer_list' value='' id='layer_list' /> <input type='hidden' name='layer_list' value='' id='layer_list' />
</td> </td>
@ -526,10 +536,10 @@ $table->valign[1] = 'top';
$table->data = []; $table->data = [];
$table->data[0][0] = '<h4>'.__('List of layers').'</h4>'; $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][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"> <table id="form_layer_table" class="" border="0" cellpadding="4" cellspacing="4">
<tr> <tr>
<td>'.__('Layer name').':</td> <td>'.__('Layer name').':</td>
@ -653,7 +663,18 @@ echo '</form>';
<tr class="row_0"> <tr class="row_0">
<td><?php html_print_input_text('map_connection_name', $map_name, '', 20, 40, false, true); ?></td> <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><?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> </tr>
</tbody> </tbody>
</table> </table>
@ -951,7 +972,15 @@ function getAgentRow (layerId, agentId, agentAlias) {
var $deleteCol = $("<td />"); var $deleteCol = $("<td />");
var $agentAlias = $("<span class=\"agent_alias\" data-agent-id=\"" + agentId + "\">" + agentAlias + "</span>"); 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) { $removeBtn.click(function (event) {
var $layerRow = $("tr#layer_row_" + layerId); var $layerRow = $("tr#layer_row_" + layerId);
@ -1007,7 +1036,7 @@ function getGroupRow (layerId, groupId, groupName, agentId, agentAlias) {
+ "<i>" + agentAlias + "</i>" + "<i>" + agentAlias + "</i>"
+ ")" + ")"
+ "</span>"); + "</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) { $removeBtn.click(function (event) {
var $layerRow = $("tr#layer_row_" + layerId); var $layerRow = $("tr#layer_row_" + layerId);
@ -1085,8 +1114,8 @@ function getLayerRow (layerId, layerData) {
var $layerName = $("<span class=\"layer_name\">" + layerData.name + "</span>"); var $layerName = $("<span class=\"layer_name\">" + layerData.name + "</span>");
var $sortUpBtn = $("<a class=\"up_arrow\" href=\"javascript:;\" />"); var $sortUpBtn = $("<a class=\"up_arrow\" href=\"javascript:;\" />");
var $sortDownBtn = $("<a class=\"down_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 $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); ?></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); $sortUpBtn.click(moveLayerRowUpOnClick);
$sortDownBtn.click(moveLayerRowDownOnClick); $sortDownBtn.click(moveLayerRowDownOnClick);

View File

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

View File

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

View File

@ -286,7 +286,7 @@ echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>'; echo '<h3 class="error invisible" id="message"> </h3>';
// Hack to translate text "none" in PHP to javascript. // 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('form');
ui_require_jquery_file('pandora.controls'); ui_require_jquery_file('pandora.controls');

View File

@ -341,7 +341,7 @@ attachActionButton('delete', 'delete', $table->width);
echo '</form>'; echo '</form>';
// Hack to translate text "none" in PHP to javascript // 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>'; echo '<h3 class="error invisible" id="message"> </h3>';

View File

@ -311,8 +311,8 @@ $table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold'; $table->style[2] = 'font-weight: bold';
$table->data['selection_mode'][0] = __('Selection mode'); $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 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 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 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->rowclass['form_modules_1'] = 'select_modules_row';
$table->data['form_modules_1'][0] = __('Module type'); $table->data['form_modules_1'][0] = __('Module type');
@ -341,7 +341,7 @@ $table->data['form_modules_1'][3] = __('Select all modules of this type').' '.ht
'', '',
'', '',
false, false,
'style="margin-right: 40px;"', 'class="mrgn_right_40px"',
true, true,
'' ''
); );
@ -386,7 +386,7 @@ $table->data['form_agents_1'][3] = __('Select all modules of this group').' '.ht
'', '',
false, false,
'', '',
'style="margin-right: 40px;"', 'class="mrgn_right_40px"',
true true
); );
@ -586,8 +586,8 @@ echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_jquery_file('form'); ui_require_jquery_file('form');
// Hack to translate text "none" in PHP to javascript // 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 '<span id ="select_agent_first_text" style="display: none;">'.__('Please, select an agent first').'</span>'; echo '<span id ="select_agent_first_text" class="invisible">'.__('Please, select an agent first').'</span>';
// Load JS files. // Load JS files.
ui_require_javascript_file('pandora_modules'); ui_require_javascript_file('pandora_modules');

View File

@ -506,7 +506,7 @@ $id_os = 0;
$server_name = 0; $server_name = 0;
$description = ''; $description = '';
echo '<div id="form_agents" style="display: none;">'; echo '<div id="form_agents" class="invisible">';
$table = new StdClass(); $table = new StdClass();
$table->width = '100%'; $table->width = '100%';
@ -668,26 +668,26 @@ $table->data[0][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255,
// Learn mode / Normal mode // Learn mode / Normal mode
$table->data[1][0] = __('Module definition'); $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] = __('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, '', 'style="margin-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, '', 'style="margin-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, '', 'style="margin-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) // Status (Disabled / Enabled)
$table->data[2][0] = __('Status'); $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] = __('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, '', '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, '', 'class="mrgn_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] .= __('Active').' '.html_print_radio_button_extended('disabled', 0, '', $disabled, false, '', 'class="mrgn_right_40px"', true);
// Remote configuration // Remote configuration
$table->data[3][0] = __('Remote configuration'); $table->data[3][0] = __('Remote configuration');
// Delete 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] .= '<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(); $listIcons = gis_get_array_list_icons();
@ -720,9 +720,9 @@ $table->data[4][1] = html_print_select($arraySelectIcon, 'icon_path', $icon_path
if ($config['activate_gis']) { if ($config['activate_gis']) {
$table->data[5][0] = __('Ignore new GIS data:'); $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] = __('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, '', 'style="margin-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, '', 'style="margin-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'); $table->data[6][0] = __('Quiet');
@ -815,7 +815,7 @@ foreach ($fields as $field) {
true true
); );
} else { } 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'] !== '') { if ($field['combo_values'] !== '') {

View File

@ -290,8 +290,8 @@ $table->width = '100%';
$table->data = []; $table->data = [];
$table->data['selection_mode'][0] = __('Selection mode'); $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 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 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 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->rowclass['form_modules_1'] = 'select_modules_row';
$table->data['form_modules_1'][0] = __('Module type'); $table->data['form_modules_1'][0] = __('Module type');
@ -316,7 +316,7 @@ $table->data['form_modules_1'][3] = __('Select all modules of this type').' '.ht
'', '',
'', '',
false, false,
'style="margin-right: 40px;"', 'class="mrgn_right_40px"',
true, true,
'' ''
); );
@ -363,7 +363,7 @@ $table->data['form_agents_1'][3] = __('Select all modules of this group').' '.ht
'', '',
false, false,
'', '',
'style="margin-right: 40px;"' 'class="mrgn_right_40px"'
); );
$table->rowclass['form_modules_3'] = ''; $table->rowclass['form_modules_3'] = '';
@ -803,11 +803,11 @@ $table->data['edit1'][1] = '<table width="100%">';
true true
); );
$table->data['edit36'][2] = __('Auth password').ui_print_help_tip(__('The pass length must be eight character minimum.'), true); $table->data['edit36'][2] = __('Auth password').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
$table->data['edit36'][3] = html_print_input_text('plugin_pass_snmp', '', '', 15, 60, true); $table->data['edit36'][3] = html_print_input_password('plugin_pass_snmp', '', '', 15, 60, true);
$table->data['edit37'][0] = __('Privacy method'); $table->data['edit37'][0] = __('Privacy method');
$table->data['edit37'][1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'custom_string_1', '', '', __('No change'), '', true); $table->data['edit37'][1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_privacy_method', '', '', __('No change'), '', true);
$table->data['edit37'][2] = __('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true); $table->data['edit37'][2] = __('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
$table->data['edit37'][3] = html_print_input_text('custom_string_2', '', '', 15, 60, true); $table->data['edit37'][3] = html_print_input_password('snmp3_privacy_pass', '', '', 15, 60, true);
$table->data['edit38'][0] = __('Auth method'); $table->data['edit38'][0] = __('Auth method');
$table->data['edit38'][1] = html_print_select(['MD5' => __('MD5'), 'SHA' => __('SHA')], 'plugin_parameter', '', '', __('No change'), '', true); $table->data['edit38'][1] = html_print_select(['MD5' => __('MD5'), 'SHA' => __('SHA')], 'plugin_parameter', '', '', __('No change'), '', true);
$table->data['edit38'][2] = __('Security level'); $table->data['edit38'][2] = __('Security level');
@ -1187,7 +1187,7 @@ $table->data['edit1'][1] = '<table width="100%">';
} }
$table->data['edit21'][1] = sprintf( $table->data['edit21'][1] = sprintf(
'<span style="font-weight: normal;" id="plugin_description">%s</span>', '<span class="normal" id="plugin_description">%s</span>',
$preload $preload
); );
@ -1200,8 +1200,8 @@ $table->data['edit1'][1] = '<table width="100%">';
echo '<h3 class="error invisible" id="message"> </h3>'; echo '<h3 class="error invisible" id="message"> </h3>';
// Hack to translate text "none" in PHP to javascript. // 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 '<span id ="select_agent_first_text" style="display: none;">'.__('Please, select an agent first').'</span>'; echo '<span id ="select_agent_first_text" class="invisible">'.__('Please, select an agent first').'</span>';
// Load JS files. // Load JS files.
ui_require_javascript_file('pandora_modules'); ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('pandora.controls'); ui_require_jquery_file('pandora.controls');
@ -1670,7 +1670,7 @@ $(document).ready (function () {
} }
}); });
$('#tcp_send').change(function() { $('#snmp_version').change(function() {
if($(this).val() == 3) { if($(this).val() == 3) {
$("tr#delete_table-edit36, tr#delete_table-edit37, tr#delete_table-edit38").show(); $("tr#delete_table-edit36, tr#delete_table-edit37, tr#delete_table-edit38").show();
} }
@ -1868,7 +1868,7 @@ function changePluginSelect() {
jQuery.each (data['array'], function (i, macro) { jQuery.each (data['array'], function (i, macro) {
if (macro['desc'] != '') { 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 //Plugin text can be larger
@ -2096,7 +2096,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
} }
// Specific snmp reused fields // Specific snmp reused fields
if (get_parameter('tcp_send', '') == 3) { if (get_parameter('snmp_version', '') == 3) {
$plugin_user_snmp = get_parameter('plugin_user_snmp', ''); $plugin_user_snmp = get_parameter('plugin_user_snmp', '');
if ($plugin_user_snmp != '') { if ($plugin_user_snmp != '') {
$values['plugin_user'] = $plugin_user_snmp; $values['plugin_user'] = $plugin_user_snmp;
@ -2107,7 +2107,12 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
$values['plugin_pass'] = io_input_password($plugin_pass_snmp); $values['plugin_pass'] = io_input_password($plugin_pass_snmp);
} }
$snmp3_privacy_pass = get_parameter('custom_string_2', ''); $snmp3_privacy_method = get_parameter('snmp3_privacy_method', '');
if ($snmp3_privacy_method != '') {
$values['custom_string_1'] = io_input_password($snmp3_privacy_method);
}
$snmp3_privacy_pass = get_parameter('snmp3_privacy_pass', '');
if ($snmp3_privacy_pass != '') { if ($snmp3_privacy_pass != '') {
$values['custom_string_2'] = io_input_password($snmp3_privacy_pass); $values['custom_string_2'] = io_input_password($snmp3_privacy_pass);
} }
@ -2209,7 +2214,11 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
} }
// Set tcp_send value according to module type since the purpose of this field in database varies in case of SNMP modules. // Set tcp_send value according to module type since the purpose of this field in database varies in case of SNMP modules.
if ($module['id_tipo_modulo'] >= 15 && $module['id_tipo_modulo'] <= 18) { if ($module['id_tipo_modulo'] == MODULE_TYPE_REMOTE_SNMP
|| $module['id_tipo_modulo'] == MODULE_TYPE_REMOTE_SNMP_INC
|| $module['id_tipo_modulo'] == MODULE_TYPE_REMOTE_SNMP_STRING
|| $module['id_tipo_modulo'] <= MODULE_TYPE_REMOTE_SNMP_PROC
) {
if ($snmp_version != '') { if ($snmp_version != '') {
$values['tcp_send'] = $snmp_version; $values['tcp_send'] = $snmp_version;
} else { } else {

View File

@ -213,139 +213,154 @@ if ($option == '') {
$alertstab = [ $alertstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts">'.html_print_image( '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, true,
['title' => __('Alerts operations')] [
'title' => __('Alerts operations'),
'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_alerts', ).'</a>', 'active' => $tab == 'massive_alerts',
]; ];
$userstab = [ $userstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users">'.html_print_image( '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, true,
['title' => __('Users operations')] [
'title' => __('Users operations'),
'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_users', ).'</a>', 'active' => $tab == 'massive_users',
]; ];
$agentstab = [ $agentstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_agents">'.html_print_image( '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, true,
['title' => __('Agents operations')] [
'title' => __('Agents operations'),
'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_agents', ).'</a>', 'active' => $tab == 'massive_agents',
]; ];
$modulestab = [ $modulestab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'.html_print_image( 'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'.html_print_image(
'images/brick.png', 'images/module.png',
true, true,
['title' => __('Modules operations')] [
).'</a>', 'active' => $tab == 'massive_modules', 'title' => __('Modules operations'),
]; 'class' => 'invert_filter',
]
).'</a>', 'active' => $tab == 'massive_modules',
];
$pluginstab = [ $pluginstab = [
'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_plugins">'.html_print_image( 'text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_plugins">'.html_print_image(
'images/plugin.png', 'images/plugin.png',
true, true,
['title' => __('Plugins operations')] [
).'</a>', 'active' => $tab == 'massive_plugins', '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) { if ($policiestab == ENTERPRISE_NOT_HOOK) {
$policiestab = ''; $policiestab = '';
} }
$snmptab = enterprise_hook('massive_snmp_tab'); $snmptab = enterprise_hook('massive_snmp_tab');
if ($snmptab == ENTERPRISE_NOT_HOOK) { if ($snmptab == ENTERPRISE_NOT_HOOK) {
$snmptab = ''; $snmptab = '';
} }
$satellitetab = enterprise_hook('massive_satellite_tab'); $satellitetab = enterprise_hook('massive_satellite_tab');
if ($satellitetab == ENTERPRISE_NOT_HOOK) { if ($satellitetab == ENTERPRISE_NOT_HOOK) {
$satellitetab = ''; $satellitetab = '';
} }
$servicestab = enterprise_hook('massive_services_tab'); $servicestab = enterprise_hook('massive_services_tab');
if ($servicestab == ENTERPRISE_NOT_HOOK) { if ($servicestab == ENTERPRISE_NOT_HOOK) {
$servicestab = ''; $servicestab = '';
} }
$onheader = []; $onheader = [];
$onheader['massive_agents'] = $agentstab; $onheader['massive_agents'] = $agentstab;
$onheader['massive_modules'] = $modulestab; $onheader['massive_modules'] = $modulestab;
$onheader['massive_plugins'] = $pluginstab; $onheader['massive_plugins'] = $pluginstab;
if (check_acl($config['id_user'], 0, 'UM')) { if (check_acl($config['id_user'], 0, 'UM')) {
$onheader['user_agents'] = $userstab; $onheader['user_agents'] = $userstab;
} }
$onheader['massive_alerts'] = $alertstab; $onheader['massive_alerts'] = $alertstab;
$onheader['policies'] = $policiestab; $onheader['policies'] = $policiestab;
$onheader['snmp'] = $snmptab; $onheader['snmp'] = $snmptab;
$onheader['satellite'] = $satellitetab; $onheader['satellite'] = $satellitetab;
$onheader['services'] = $servicestab; $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( ui_print_page_header(
__('Bulk operations').' &raquo; '.$options[$option], __('Bulk operations').' &raquo; '.$options[$option],
'images/gm_massive_operations.png', 'images/gm_massive_operations.png',
false, false,
$help_header, $help_header,
true, true,
$onheader, $onheader,
false, false,
'massivemodal' 'massivemodal'
); );
// Checks if the PHP configuration is correctly. // Checks if the PHP configuration is correctly.
if ((get_cfg_var('max_execution_time') != 0) if ((get_cfg_var('max_execution_time') != 0)
|| (get_cfg_var('max_input_time') != -1) || (get_cfg_var('max_input_time') != -1)
) { ) {
echo '<div id="notify_conf" class="notify">'; 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 __('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>'; echo '</div>';
} }
if ($tab == 'massive_policies' && is_central_policies_on_node()) { 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.')); ui_print_warning_message(__('This node is configured with centralized mode. All policies information is read only. Go to metaconsole to manage it.'));
return; return;
} }
// Catch all submit operations in this view to display Wait banner. // Catch all submit operations in this view to display Wait banner.
$submit_action = get_parameter('go'); $submit_action = get_parameter('go');
$submit_update = get_parameter('updbutton'); $submit_update = get_parameter('updbutton');
$submit_del = get_parameter('del'); $submit_del = get_parameter('del');
$submit_template_disabled = get_parameter('id_alert_template_disabled'); $submit_template_disabled = get_parameter('id_alert_template_disabled');
$submit_template_enabled = get_parameter('id_alert_template_enabled'); $submit_template_enabled = get_parameter('id_alert_template_enabled');
$submit_template_not_standby = get_parameter('id_alert_template_not_standby'); $submit_template_not_standby = get_parameter('id_alert_template_not_standby');
$submit_template_standby = get_parameter('id_alert_template_standby'); $submit_template_standby = get_parameter('id_alert_template_standby');
$submit_add = get_parameter('crtbutton'); $submit_add = get_parameter('crtbutton');
// Waiting spinner. // Waiting spinner.
ui_print_spinner(__('Loading')); ui_print_spinner(__('Loading'));
// Modal for show messages. // Modal for show messages.
html_print_div( html_print_div(
[ [
'id' => 'massive_modal', 'id' => 'massive_modal',
'content' => '', 'content' => '',
] ]
); );
// Load common JS files. // Load common JS files.
ui_require_javascript_file('massive_operations'); ui_require_javascript_file('massive_operations');
?> ?>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */

View File

@ -351,6 +351,9 @@ if (check_acl($config['id_user'], 0, 'PM')) {
$sub2['godmode/setup/setup&amp;section=websocket_engine']['text'] = __('Websocket Engine'); $sub2['godmode/setup/setup&amp;section=websocket_engine']['text'] = __('Websocket Engine');
$sub2['godmode/setup/setup&amp;section=websocket_engine']['refr'] = 0; $sub2['godmode/setup/setup&amp;section=websocket_engine']['refr'] = 0;
$sub2['godmode/setup/setup&amp;section=external_tools']['text'] = __('External Tools');
$sub2['godmode/setup/setup&amp;section=external_tools']['refr'] = 0;
if ($config['activate_gis']) { if ($config['activate_gis']) {
$sub2['godmode/setup/setup&amp;section=gis']['text'] = __('Map conections GIS'); $sub2['godmode/setup/setup&amp;section=gis']['text'] = __('Map conections GIS');
} }

View File

@ -42,18 +42,18 @@ if (! check_acl($config['id_user'], 0, 'AR')) {
if (check_acl($config['id_user'], 0, 'PM') && enterprise_installed()) { if (check_acl($config['id_user'], 0, 'PM') && enterprise_installed()) {
$buttons['setup'] = [ $buttons['setup'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=general&sec2=godmode/setup/setup&amp;section=module_library">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup')]).'</a>', 'text' => '<a href="index.php?sec=general&sec2=godmode/setup/setup&amp;section=module_library">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup'), 'class' => 'invert_filter']).'</a>',
]; ];
} }
$buttons['categories'] = [ $buttons['categories'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view&tab=categories">'.html_print_image('images/list.png', true, ['title' => __('Categories')]).'</a>', 'text' => '<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view&tab=categories">'.html_print_image('images/list.png', true, ['title' => __('Categories'), 'class' => 'invert_filter']).'</a>',
]; ];
$buttons['view'] = [ $buttons['view'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view">'.html_print_image('images/operation.png', true, ['title' => __('View')]).'</a>', 'text' => '<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view">'.html_print_image('images/eye_show.png', true, ['title' => __('View'), 'class' => 'invert_filter']).'</a>',
]; ];
@ -126,7 +126,7 @@ switch ($tab) {
echo '</div>'; echo '</div>';
echo '<button name="view_all" class="sub next"> echo '<button name="view_all" class="sub next">
<a href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view&tab=categories">'.__('View all categories').'</a> <a class="category_link"href="index.php?sec=gmodule_library&sec2=godmode/module_library/module_library_view&tab=categories">'.__('View all categories').'</a>
</button>'; </button>';
echo '</div>'; echo '</div>';
echo $sidebar_library; echo $sidebar_library;

View File

@ -264,7 +264,7 @@ foreach ($groups as $group) {
$table->cellclass[][1] = 'action_buttons'; $table->cellclass[][1] = 'action_buttons';
if (is_management_allowed() === true) { if (is_management_allowed() === true) {
$data[1] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;' $data[1] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'
href='index.php?sec=".$sec.'&sec2=godmode/modules/manage_nc_groups&delete=1&id='.$group['id_sg']."&offset=0'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>'; href='index.php?sec=".$sec.'&sec2=godmode/modules/manage_nc_groups&delete=1&id='.$group['id_sg']."&offset=0'>".html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
} }
array_push($table->data, $data); array_push($table->data, $data);
@ -279,7 +279,7 @@ if (isset($data)) {
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
if (is_management_allowed() === true) { if (is_management_allowed() === true) {
echo "<div style='padding-left: 10px; float: right;'>"; echo "<div class='pdd_l_10px float-right mrgn_btn_15px'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>'; echo '</div>';
} }
@ -291,7 +291,7 @@ if (isset($data)) {
if (is_management_allowed() === true) { if (is_management_allowed() === true) {
echo '<form method="post" action='.$url.'>'; echo '<form method="post" action='.$url.'>';
echo '<div class="" style="float:right;">'; echo '<div class="float-right">';
html_print_input_hidden('new', 1); html_print_input_hidden('new', 1);
html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"'); html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"');
echo '</div>'; echo '</div>';

View File

@ -811,9 +811,12 @@ foreach ($components as $component) {
switch ($component['id_modulo']) { switch ($component['id_modulo']) {
case MODULE_NETWORK: case MODULE_NETWORK:
$data[1] .= html_print_image( $data[1] .= html_print_image(
'images/network.png', 'images/op_network.png',
true, true,
['title' => __('Network module')] [
'title' => __('Network module'),
'class' => 'invert_filter',
]
); );
break; break;
@ -821,7 +824,10 @@ foreach ($components as $component) {
$data[1] .= html_print_image( $data[1] .= html_print_image(
'images/wmi.png', 'images/wmi.png',
true, true,
['title' => __('WMI module')] [
'title' => __('WMI module'),
'class' => 'invert_filter',
]
); );
break; break;
@ -829,7 +835,10 @@ foreach ($components as $component) {
$data[1] .= html_print_image( $data[1] .= html_print_image(
'images/plugin.png', 'images/plugin.png',
true, true,
['title' => __('Plug-in module')] [
'title' => __('Plug-in module'),
'class' => 'invert_filter',
]
); );
break; break;
@ -837,7 +846,10 @@ foreach ($components as $component) {
$data[1] .= html_print_image( $data[1] .= html_print_image(
'images/wand.png', 'images/wand.png',
true, true,
['title' => __('Wizard module')] [
'title' => __('Wizard module'),
'class' => 'invert_filter',
]
); );
break; break;
@ -847,13 +859,29 @@ foreach ($components as $component) {
} }
$data[2] = ui_print_moduletype_icon($component['type'], true); $data[2] = ui_print_moduletype_icon($component['type'], true);
$data[3] = "<span style='font-size: 8px'>".mb_strimwidth(io_safe_output($component['description']), 0, 60, '...').'</span>'; $data[3] = "<span class='font_8px'>".mb_strimwidth(io_safe_output($component['description']), 0, 60, '...').'</span>';
$data[4] = network_components_get_group_name($component['id_group']); $data[4] = network_components_get_group_name($component['id_group']);
$data[5] = $component['max'].' / '.$component['min']; $data[5] = $component['max'].' / '.$component['min'];
$table->cellclass[][6] = 'action_buttons'; $table->cellclass[][6] = 'action_buttons';
$data[6] = '<a style="display: inline; float: left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'">'.html_print_image('images/copy.png', true, ['alt' => __('Duplicate'), 'title' => __('Duplicate')]).'</a>'; $data[6] = '<a class="inline_line float-left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'">'.html_print_image(
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete')]).'</a>'; 'images/copy.png',
true,
[
'alt' => __('Duplicate'),
'title' => __('Duplicate'),
'class' => 'invert_filter',
]
).'</a>';
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image(
'images/cross.png',
true,
[
'alt' => __('Delete'),
'title' => __('Delete'),
'class' => 'invert_filter',
]
).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }
@ -872,7 +900,7 @@ if (isset($data)) {
true, true,
'pagination-bottom' 'pagination-bottom'
); );
echo "<div style='float: right; margin-left: 5px;'>"; echo "<div id='btn_delete_5' class='float-right'>";
html_print_submit_button( html_print_submit_button(
__('Delete'), __('Delete'),
'delete_btn', 'delete_btn',
@ -891,7 +919,7 @@ if (isset($data)) {
} }
echo '<form method="post" action="'.$url.'">'; echo '<form method="post" action="'.$url.'">';
echo '<div class="" style="float:right;">'; echo '<div class="right_align mrgn_btn_15px">';
html_print_input_hidden('new_component', 1); html_print_input_hidden('new_component', 1);
html_print_select( html_print_select(
[ [
@ -911,7 +939,7 @@ html_print_submit_button(
__('Create'), __('Create'),
'crt', 'crt',
false, false,
'class="sub next" style="margin-left: 5px;"' 'class="sub next mrgn_lft_5px"'
); );
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';

View File

@ -141,7 +141,14 @@ $table->data[2][3] = html_print_extended_select_for_time('module_interval', $mod
$table->data[3][0] = __('Dynamic Interval'); $table->data[3][0] = __('Dynamic Interval');
$table->data[3][1] = html_print_extended_select_for_time('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px', false); $table->data[3][1] = html_print_extended_select_for_time('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px', false);
$table->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image('images/cog.png', true, ['title' => __('Advanced options Dynamic Threshold')]).'</a>'; $table->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->data[3][2] = '<span><em>'.__('Dynamic Min. ').'</em>'; $table->data[3][2] = '<span><em>'.__('Dynamic Min. ').'</em>';
$table->data[3][2] .= html_print_input_text('dynamic_min', $dynamic_min, '', 10, 255, true); $table->data[3][2] .= html_print_input_text('dynamic_min', $dynamic_min, '', 10, 255, true);
@ -353,10 +360,8 @@ $table->data[$next_row][1] .= html_print_select_from_sql(
'width: 200px', 'width: 200px',
'5' '5'
); );
$table->data[$next_row][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module')]); $table->data[$next_row][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module'), 'class' => 'invert_filter']);
// html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module'))); $table->data[$next_row][2] .= '<br><br><br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'left', 'title' => __('Delete tags to module'), 'class' => 'invert_filter']);
$table->data[$next_row][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->data[$next_row][3] = '<b>'.__('Tags selected').'</b><br>'; $table->data[$next_row][3] = '<b>'.__('Tags selected').'</b><br>';
$table->data[$next_row][3] .= html_print_select_from_sql( $table->data[$next_row][3] .= html_print_select_from_sql(
"SELECT name AS name1, name AS name2 "SELECT name AS name1, name AS name2

View File

@ -59,7 +59,7 @@ function generateExtraFields($extra_fields, $protocol)
} }
$data = []; $data = [];
$data[0] = '<div style="text-align: right;">'.$extraFieldText.'</div>'; $data[0] = '<div class="right">'.$extraFieldText.'</div>';
$data[1] = html_print_input_text_extended( $data[1] = html_print_input_text_extended(
'extra_field_'.$protocol.'_'.$idField, 'extra_field_'.$protocol.'_'.$idField,
$field, $field,
@ -88,6 +88,7 @@ function generateExtraFields($extra_fields, $protocol)
[ [
'title' => __('Add a macro oid'), 'title' => __('Add a macro oid'),
'onclick' => 'manageComponentFields(\'add\', \'oid-list-'.$rowId.'\');', 'onclick' => 'manageComponentFields(\'add\', \'oid-list-'.$rowId.'\');',
'class' => 'invert_filter',
] ]
), ),
], ],
@ -106,6 +107,7 @@ function generateExtraFields($extra_fields, $protocol)
'title' => __('Remove last macro oid'), 'title' => __('Remove last macro oid'),
'onclick' => 'manageComponentFields(\'del\', \'oid-list-'.$rowId.'\');', 'onclick' => 'manageComponentFields(\'del\', \'oid-list-'.$rowId.'\');',
'style' => 'margin-left: 1em;', 'style' => 'margin-left: 1em;',
'class' => 'invert_filter',
] ]
), ),
], ],
@ -615,7 +617,7 @@ $table->style[0] = 'font-weight: bold;';
push_table_row($data, 'title-query-filters-wmiRow'); push_table_row($data, 'title-query-filters-wmiRow');
$data = []; $data = [];
$data[0] = '<div style="text-align: right;">'.__('Scan').'</div>'; $data[0] = '<div class="right">'.__('Scan').'</div>';
$data[1] = html_print_input_text_extended( $data[1] = html_print_input_text_extended(
'query_filter_scan', 'query_filter_scan',
$query_filter['scan'], $query_filter['scan'],
@ -633,7 +635,7 @@ push_table_row($data, 'query-filter-scan-wmiRow');
if ($execution_type == EXECUTION_TYPE_NETWORK) { if ($execution_type == EXECUTION_TYPE_NETWORK) {
$data = []; $data = [];
$data[0] = '<div style="text-align: right;">'.__('Execution').'</div>'; $data[0] = '<div class="right">'.__('Execution').'</div>';
$data[1] = html_print_input_text_extended( $data[1] = html_print_input_text_extended(
'query_filter_execution', 'query_filter_execution',
$query_filter['execution'], $query_filter['execution'],

View File

@ -233,7 +233,7 @@ $table->head[0] = html_print_checkbox('all_delete', 0, false, true, false);
; ;
$table->head[1] = __('Name'); $table->head[1] = __('Name');
$table->head[2] = __('Description'); $table->head[2] = __('Description');
$table->head[3] = '<span style="margin-right:7%;">'.__('Action').'</span>'; $table->head[3] = '<span class="mrgn_right_7p">'.__('Action').'</span>';
$table->size = []; $table->size = [];
$table->size[0] = '20px'; $table->size[0] = '20px';
$table->size[2] = '65%'; $table->size[2] = '65%';
@ -256,7 +256,10 @@ foreach ($result as $row) {
$row['id_np'], $row['id_np'],
'', '',
true, true,
['onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;'] [
'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
'class' => 'invert_filter',
]
); );
$data[3] .= html_print_input_image( $data[3] .= html_print_input_image(
'export_profile', 'export_profile',
@ -264,10 +267,13 @@ foreach ($result as $row) {
$row['id_np'], $row['id_np'],
'', '',
true, true,
['title' => 'Export to CSV'] [
'title' => 'Export to CSV',
'class' => 'invert_filter',
]
); );
$data[3] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&delete_profile=1&delete_profile='.$row['id_np'].'" '.'onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>'; $data[3] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&delete_profile=1&delete_profile='.$row['id_np'].'" '.'onclick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
$data[3] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV')]).'</a>'; $data[3] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates'.'&export_profile='.$row['id_np'].'">'.html_print_image('images/csv.png', true, ['title' => __('Export to CSV'), 'class' => 'invert_filter']).'</a>';
array_push($table->data, $data); array_push($table->data, $data);
} }
@ -278,7 +284,7 @@ if (!empty($table->data)) {
ui_pagination($count_network_templates, false, $offset); ui_pagination($count_network_templates, false, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom'); ui_pagination($count_network_templates, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
echo "<div style='padding-left: 5px; float: right; '>"; echo "<div class='pdd_l_5px right'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';
@ -287,7 +293,7 @@ if (!empty($table->data)) {
} }
echo '<form method="post" action="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates_form">'; echo '<form method="post" action="index.php?sec=gmodules&amp;sec2=godmode/modules/manage_network_templates_form">';
echo '<div style="float:right;" class="">'; echo '<div class="right">';
html_print_submit_button(__('Create'), 'crt', '', 'class="sub next"'); html_print_submit_button(__('Create'), 'crt', '', 'class="sub next"');
echo '</div></form>'; echo '</div></form>';

View File

@ -161,7 +161,7 @@ echo '<tr><td class="datos2">'.'<b>'.__('Description').'</b>'.'</td>';
echo '<td class="datos2">'; echo '<td class="datos2">';
html_print_textarea('description', 2, 60, $description); html_print_textarea('description', 2, 60, $description);
echo '</td></tr>'; echo '</td></tr>';
echo '<tr><td></td><td style="text-align:right;">'; echo '<tr><td></td><td class="right">';
if ($id_np > 0) { if ($id_np > 0) {
html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"'); html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"');
} else { } else {
@ -245,7 +245,7 @@ if ($id_np > 0) {
unset($table); unset($table);
echo "<h4 style='margin-top:0px !important;'>".__('Add modules').'</h4>'; echo "<h4 class='mrgn_top_0'>".__('Add modules').'</h4>';
unset($table); unset($table);
@ -266,7 +266,7 @@ if ($id_np > 0) {
$filter .= '</form>'; $filter .= '</form>';
$group_filter = '<form name="filter_group" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'#filter">'; $group_filter = '<form name="filter_group" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'#filter">';
$group_filter .= '<div style="width:540px"><a name="filter"></a>'; $group_filter .= '<div class="width:540px"><a name="filter"></a>';
$result = db_get_all_rows_in_table('tnetwork_component_group', 'name'); $result = db_get_all_rows_in_table('tnetwork_component_group', 'name');
if ($result === false) { if ($result === false) {
$result = []; $result = [];
@ -288,7 +288,7 @@ if ($id_np > 0) {
$groups_compound[$row['id_sg']] .= $row['name']; $groups_compound[$row['id_sg']] .= $row['name'];
} }
$group_filter .= html_print_select($groups_compound, 'ncgroup', $ncgroup, 'javascript:this.form.submit();', __('Group').' - '.__('All'), -1, true, false, true, '" style="width:350px'); $group_filter .= html_print_select($groups_compound, 'ncgroup', $ncgroup, 'javascript:this.form.submit();', __('Group').' - '.__('All'), -1, true, false, true, '" class="w350px');
$group_filter .= '</div></form>'; $group_filter .= '</div></form>';
@ -320,7 +320,7 @@ if ($id_np > 0) {
} }
$components_select = '<form name="add_module" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'&add_module=1">'; $components_select = '<form name="add_module" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'&add_module=1">';
$components_select .= html_print_select($components, 'components[]', $id_nc, '', '', -1, true, true, false, '" style="width:350px'); $components_select .= html_print_select($components, 'components[]', $id_nc, '', '', -1, true, true, false, '" clas="w350px');
$table->data[0][0] = __('Filter'); $table->data[0][0] = __('Filter');
$table->data[0][1] = $filter; $table->data[0][1] = $filter;

View File

@ -77,7 +77,7 @@ foreach ($rows as $row) {
echo " echo "
<tr> <tr>
<td class='$tdcolor' align=''>".html_print_image('images/'.$row['icon'], true, ['border' => '0'])."</td> <td class='$tdcolor' align=''>".html_print_image('images/'.$row['icon'], true, ['border' => '0', 'class' => 'invert_filter'])."</td>
<td class='$tdcolor'> <td class='$tdcolor'>
<b>".$row['id_tipo']." <b>".$row['id_tipo']."
</b></td> </b></td>

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