Merge branch 'pandora_6.0' of https://brutus.artica.lan:8081/artica/pandorafms into pandora_6.0

This commit is contained in:
Arturo Gonzalez 2016-09-12 11:58:29 +02:00
commit 2de8122edc
88 changed files with 32324 additions and 26268 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 6.0SP3-160908 Version: 6.0SP3-160912
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="6.0SP3-160908" pandora_version="6.0SP3-160912"
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

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '6.0SP3'; use constant AGENT_VERSION => '6.0SP3';
use constant AGENT_BUILD => '160908'; use constant AGENT_BUILD => '160912';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 6.0SP3 %define version 6.0SP3
%define release 160908 %define release 160912
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 6.0SP3 %define version 6.0SP3
%define release 160908 %define release 160912
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="6.0SP3" PI_VERSION="6.0SP3"
PI_BUILD="160908" PI_BUILD="160912"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -53,6 +53,12 @@ my $Idx_size = 0;
# Regular expression to be matched # Regular expression to be matched
my $Reg_exp = ''; my $Reg_exp = '';
# Flag to show or not summary module
my $summary_flag = 0;
# Number of coincidences found
my $coincidences = 0;
############################################################################### ###############################################################################
# SUB error_msg # SUB error_msg
# Print an error message and exit. # Print an error message and exit.
@ -72,7 +78,7 @@ sub error_msg ($) {
# Print a help message. # Print a help message.
############################################################################### ###############################################################################
sub print_help () { sub print_help () {
print "Usage: $0 <log_file> <module_name> <pattern> <up_lines_extra> <bot_lines_extra>\n"; print "Usage: $0 <log_file> <module_name> <pattern> <up_lines_extra> <bot_lines_extra> [--summary]\n";
} }
############################################################################### ###############################################################################
@ -193,6 +199,7 @@ sub parse_log (;$$) {
push @lines, $line; push @lines, $line;
if ($line =~ m/$Reg_exp/i) { if ($line =~ m/$Reg_exp/i) {
push @nl_found, $nl; push @nl_found, $nl;
$coincidences++;
} }
$nl++; $nl++;
} }
@ -236,6 +243,21 @@ sub parse_log (;$$) {
return @data; return @data;
} }
###############################################################################
# SUB print_summary
# Print module summary to stdout.
###############################################################################
sub print_summary() {
my $output = "<module>\n";
$output .= "<name><![CDATA[" . $Module_name . " coincidences]]></name>\n";
$output .= "<type><![CDATA[async_data]]></type>\n";
$output .= "<datalist>\n";
$output .= "<data><value><![CDATA[$coincidences]]></value></data>\n";
$output .= "</datalist>\n";
$output .= "</module>\n";
print stdout $output;
}
############################################################################### ###############################################################################
# SUB parse_log # SUB parse_log
# Print log data to stdout. # Print log data to stdout.
@ -245,6 +267,7 @@ sub print_log (@) {
# No data # No data
if ($#data < 0) { if ($#data < 0) {
print_summary() if ($summary_flag == 1);
return; return;
} }
@ -263,7 +286,9 @@ sub print_log (@) {
} }
# Regular module # Regular module
else { else {
my $output = "<module>\n"; my $output;
print_summary() if ($summary_flag == 1);
$output = "<module>\n";
$output .= "<name><![CDATA[" . $Module_name . "]]></name>\n"; $output .= "<name><![CDATA[" . $Module_name . "]]></name>\n";
$output .= "<type><![CDATA[async_string]]></type>\n"; $output .= "<type><![CDATA[async_string]]></type>\n";
$output .= "<datalist>\n"; $output .= "<datalist>\n";
@ -292,8 +317,15 @@ if ($#ARGV < 2) {
$Log_file = $ARGV[0]; $Log_file = $ARGV[0];
$Module_name = $ARGV[1]; $Module_name = $ARGV[1];
$Reg_exp = $ARGV[2]; $Reg_exp = $ARGV[2];
my $up_lines = $ARGV[3]; my $up_lines = $ARGV[3];
my $bot_lines = $ARGV[4]; my $bot_lines = $ARGV[4];
my $sum_flag = $ARGV[5];
if ( ( defined($up_lines) && ($up_lines eq "--summary"))
|| ( defined($bot_lines) && ($bot_lines eq "--summary"))
|| ( defined($sum_flag) && ($sum_flag eq "--summary")) ) {
$summary_flag = 1;
}
# Create index file storage directory # Create index file storage directory
if ( ! -d $Idx_dir) { if ( ! -d $Idx_dir) {
mkdir($Idx_dir) || error_msg("Error creating directory $Idx_dir: " mkdir($Idx_dir) || error_msg("Error creating directory $Idx_dir: "

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{160908} {160912}
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 ("6.0SP3(Build 160908)") #define PANDORA_VERSION ("6.0SP3(Build 160912)")
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", "(6.0SP3(Build 160908))" VALUE "ProductVersion", "(6.0SP3(Build 160912))"
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: 6.0SP3-160908 Version: 6.0SP3-160912
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="6.0SP3-160908" pandora_version="6.0SP3-160912"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -17,8 +17,10 @@ global $config;
check_login(); check_login();
$agent_d = check_acl ($config['id_user'], 0, "AD");
if (! check_acl ($config['id_user'], 0, "AD")) { $agent_w = check_acl ($config['id_user'], 0, "AW");
$access = ($agent_d == true) ? 'AD' : (($agent_w == true) ? 'AW' : 'AD');
if (!$agent_d && !$agent_w) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access downtime scheduler"); "Trying to access downtime scheduler");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -82,8 +84,8 @@ $id_agent = (int) get_parameter ('id_agent');
$insert_downtime_agent = (int) get_parameter ('insert_downtime_agent'); $insert_downtime_agent = (int) get_parameter ('insert_downtime_agent');
$delete_downtime_agent = (int) get_parameter ('delete_downtime_agent'); $delete_downtime_agent = (int) get_parameter ('delete_downtime_agent');
// User groups with AD permission for ACL checks // User groups with AD or AW permission for ACL checks
$user_groups_ad = array_keys(users_get_groups($config['id_user'], 'AD')); $user_groups_ad = array_keys(users_get_groups($config['id_user'], $access));
// INSERT A NEW DOWNTIME_AGENT ASSOCIATION // INSERT A NEW DOWNTIME_AGENT ASSOCIATION
if ($insert_downtime_agent === 1) { if ($insert_downtime_agent === 1) {
@ -472,7 +474,7 @@ $table->data = array ();
$table->data[0][0] = __('Name'); $table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text ('name', $name, '', 25, 40, true, $disabled_in_execution); $table->data[0][1] = html_print_input_text ('name', $name, '', 25, 40, true, $disabled_in_execution);
$table->data[1][0] = __('Group'); $table->data[1][0] = __('Group');
$table->data[1][1] = html_print_select_groups(false, "AD", true, 'id_group', $id_group, '', '', 0, true, false, true, '', $disabled_in_execution); $table->data[1][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', 0, true, false, true, '', $disabled_in_execution);
$table->data[2][0] = __('Description'); $table->data[2][0] = __('Description');
$table->data[2][1] = html_print_textarea ('description', 3, 35, $description, '', true); $table->data[2][1] = html_print_textarea ('description', 3, 35, $description, '', true);
@ -671,7 +673,7 @@ if ($id_downtime > 0) {
echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>"; echo "<form method=post action='index.php?sec=estado&sec2=godmode/agentes/planned_downtime.editor&id_downtime=$id_downtime'>";
html_print_select_groups(false, "AD", true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'width:180px'); html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', false, false, true, '', false, 'width:180px');
echo "<br /><br />"; echo "<br /><br />";
html_print_submit_button (__('Filter by group'), '', false, 'class="sub next"',false); html_print_submit_button (__('Filter by group'), '', false, 'class="sub next"',false);

View File

@ -20,8 +20,10 @@ check_login();
$read_permisson = check_acl ($config['id_user'], 0, "AR"); $read_permisson = check_acl ($config['id_user'], 0, "AR");
$write_permisson = check_acl ($config['id_user'], 0, "AD"); $write_permisson = check_acl ($config['id_user'], 0, "AD");
$manage_permisson = check_acl ($config['id_user'], 0, "AW");
$access = ($read_permisson == true) ? 'AR' : (($write_permisson == true) ? 'AD' : (($manage_permisson == true) ? 'AW' : 'AR'));
if (! $read_permisson) { if (! $read_permisson && !$manage_permisson) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access downtime scheduler"); "Trying to access downtime scheduler");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -64,7 +66,7 @@ if ($stop_downtime) {
$downtime = db_get_row('tplanned_downtime', 'id', $id_downtime); $downtime = db_get_row('tplanned_downtime', 'id', $id_downtime);
// Check AD permission on the downtime // Check AD permission on the downtime
if (empty($downtime) || ! check_acl ($config['id_user'], $downtime['id_group'], "AD")) { if (empty($downtime) || (! check_acl ($config['id_user'], $downtime['id_group'], "AD") && ! check_acl ($config['id_user'], $downtime['id_group'], "AW"))) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access downtime scheduler"); "Trying to access downtime scheduler");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -87,7 +89,7 @@ if ($delete_downtime) {
$downtime = db_get_row('tplanned_downtime', 'id', $id_downtime); $downtime = db_get_row('tplanned_downtime', 'id', $id_downtime);
// Check AD permission on the downtime // Check AD permission on the downtime
if (empty($downtime) || ! check_acl ($config['id_user'], $downtime['id_group'], "AD")) { if (empty($downtime) || (! check_acl ($config['id_user'], $downtime['id_group'], "AD") && ! check_acl ($config['id_user'], $downtime['id_group'], "AW"))) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access downtime scheduler"); "Trying to access downtime scheduler");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -172,7 +174,7 @@ $row[] = $agent_input;
// Module // Module
$row[] = __('Module') . '&nbsp;' . html_print_autocomplete_modules('module_name', $module_name, false, true, '', array(), true); $row[] = __('Module') . '&nbsp;' . html_print_autocomplete_modules('module_name', $module_name, false, true, '', array(), true);
$row[] = html_print_submit_button('Search', 'search', false, 'class="sub search"', true); $row[] = html_print_submit_button(__('Search'), 'search', false, 'class="sub search"', true);
$table_form->data[] = $row; $table_form->data[] = $row;
// End of table filter // End of table filter
@ -180,7 +182,7 @@ $table_form->data[] = $row;
// Useful to know if the user has done a form filtering // Useful to know if the user has done a form filtering
$filter_performed = false; $filter_performed = false;
$groups = users_get_groups (); $groups = users_get_groups (false, $access);
if (!empty($groups)) { if (!empty($groups)) {
$where_values = "1=1"; $where_values = "1=1";
@ -375,8 +377,8 @@ else {
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset); ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
// User groups with AD permission // User groups with AR, AD or AW permission
$groupsAD = users_get_groups($config['id_user'], 'AD'); $groupsAD = users_get_groups($config['id_user'], $access);
$groupsAD = array_keys($groupsAD); $groupsAD = array_keys($groupsAD);
// View available downtimes present in database (if any of them) // View available downtimes present in database (if any of them)
@ -394,7 +396,7 @@ else {
$table->head['configuration'] = __('Configuration'); $table->head['configuration'] = __('Configuration');
$table->head['running'] = __('Running'); $table->head['running'] = __('Running');
if ($write_permisson) { if ($write_permisson || $manage_permisson) {
$table->head['stop'] = __('Stop downtime'); $table->head['stop'] = __('Stop downtime');
$table->head['edit'] = __('Edit'); $table->head['edit'] = __('Edit');
$table->head['delete'] = __('Delete'); $table->head['delete'] = __('Delete');
@ -404,7 +406,7 @@ else {
$table->align['group'] = "center"; $table->align['group'] = "center";
$table->align['running'] = "center"; $table->align['running'] = "center";
if ($write_permisson) { if ($write_permisson || $manage_permisson) {
$table->align['stop'] = "center"; $table->align['stop'] = "center";
$table->align['edit'] = "center"; $table->align['edit'] = "center";
$table->align['delete'] = "center"; $table->align['delete'] = "center";
@ -542,4 +544,4 @@ $(document).ready (function () {
} }
}); });
</script> </script>

View File

@ -20,7 +20,9 @@ check_login ();
/* Check if this page is included from a agent edition */ /* Check if this page is included from a agent edition */
if (! check_acl ($config['id_user'], 0, "LW") && ! check_acl ($config['id_user'], 0, "AD")) { if (! check_acl ($config['id_user'], 0, "LW") &&
! check_acl ($config['id_user'], 0, "AD") &&
! check_acl ($config['id_user'], 0, "LM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Alert Management"); "Trying to access Alert Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -88,7 +90,12 @@ $form_filter .= "</tr>";
$all_groups = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); $all_groups = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
$groups_user = users_get_groups($config['id_user'], 'AR', $all_groups); if (check_acl ($config['id_user'], 0, "AD"))
$groups_user = users_get_groups($config['id_user'], 'AD', $all_groups);
elseif (check_acl ($config['id_user'], 0, "LW"))
$groups_user = users_get_groups($config['id_user'], 'LW', $all_groups);
elseif (check_acl ($config['id_user'], 0, "LM"))
$groups_user = users_get_groups($config['id_user'], 'LM', $all_groups);
if ($groups_user === false) { if ($groups_user === false) {
$groups_user = array(); $groups_user = array();
} }
@ -478,7 +485,7 @@ foreach ($simple_alerts as $alert) {
$data[1] .= html_print_image("images/zoom.png", true, array("id" => 'template-details-'.$alert['id_alert_template'], "class" => "img_help")); $data[1] .= html_print_image("images/zoom.png", true, array("id" => 'template-details-'.$alert['id_alert_template'], "class" => "img_help"));
$data[1] .= '</a> '; $data[1] .= '</a> ';
if(check_acl ($config['id_user'], $template_group, "LW")) { if(check_acl ($config['id_user'], $template_group, "LW") || check_acl ($config['id_user'], $template_group, "LM")) {
$data[1] .= "</a>"; $data[1] .= "</a>";
} }
@ -533,7 +540,7 @@ foreach ($simple_alerts as $alert) {
$data[2] .= '</ul>'; $data[2] .= '</ul>';
// 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 ($config['id_user'], $agent_group, "LW")) { if (check_acl ($config['id_user'], $agent_group, "LW") || check_acl ($config['id_user'], $template_group, "LM")) {
$data[2] .= '<form method="post" action="' . $url . '" class="delete_link" style="display: inline; vertical-align: -50%;">'; $data[2] .= '<form method="post" action="' . $url . '" class="delete_link" style="display: inline; vertical-align: -50%;">';
$data[2] .= html_print_input_image ('delete', $data[2] .= html_print_input_image ('delete',
'images/cross.png', 1, 'padding:0px;', true, 'images/cross.png', 1, 'padding:0px;', true,
@ -549,9 +556,12 @@ foreach ($simple_alerts as $alert) {
} }
$data[2] .= '</table>'; $data[2] .= '</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
if (check_acl ($config['id_user'], $agent_group, "LW")) { if (check_acl ($config['id_user'], $agent_group, "LW") || check_acl ($config['id_user'], $template_group, "LM")) {
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
$own_groups = users_get_groups($config['id_user'], 'LW', true); if (check_acl ($config['id_user'], $template_group, "LW"))
$own_groups = users_get_groups($config['id_user'], 'LW', true);
elseif (check_acl ($config['id_user'], $template_group, "LM"))
$own_groups = users_get_groups($config['id_user'], 'LM', true);
$filter_groups = ''; $filter_groups = '';
$filter_groups = implode(',', array_keys($own_groups)); $filter_groups = implode(',', array_keys($own_groups));
$actions = alerts_get_alert_actions_filter(true, 'id_group IN (' . $filter_groups . ')'); $actions = alerts_get_alert_actions_filter(true, 'id_group IN (' . $filter_groups . ')');
@ -643,7 +653,7 @@ foreach ($simple_alerts as $alert) {
$data[4] .= '</form>'; $data[4] .= '</form>';
// 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 ($config['id_user'], $agent_group, "LW")) { if(check_acl ($config['id_user'], $agent_group, "LW") || check_acl ($config['id_user'], $template_group, "LM")) {
$data[4] .= '&nbsp;&nbsp;<form class="standby_alert_form" action="' . $url . '" method="post" style="display: inline;">'; $data[4] .= '&nbsp;&nbsp;<form class="standby_alert_form" action="' . $url . '" method="post" style="display: inline;">';
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);
@ -674,7 +684,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 ($config['id_user'], $agent_group, "LW")) { if(check_acl ($config['id_user'], $agent_group, "LW") || check_acl ($config['id_user'], $template_group, "LM")) {
$data[4] .= '&nbsp;&nbsp;<form class="delete_alert_form" action="' . $url . '" method="post" style="display: inline;">'; $data[4] .= '&nbsp;&nbsp;<form class="delete_alert_form" action="' . $url . '" method="post" style="display: inline;">';
if ($alert['disabled']) { if ($alert['disabled']) {
$data[4] .= html_print_image('images/add.disabled.png', $data[4] .= html_print_image('images/add.disabled.png',
@ -714,7 +724,7 @@ if (isset($dont_display_alert_create_bttn))
if ($dont_display_alert_create_bttn) if ($dont_display_alert_create_bttn)
$display_create = false; $display_create = false;
if ($display_create && check_acl ($config['id_user'], 0, "LW")) { if ($display_create && (check_acl ($config['id_user'], 0, "LW") || check_acl ($config['id_user'], $template_group, "LM"))) {
echo '<div class="action-buttons" style="width: ' . $table->width . '">'; echo '<div class="action-buttons" style="width: ' . $table->width . '">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'; echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">';
html_print_submit_button (__('Create'), 'crtbtn', false, 'class="sub next"'); html_print_submit_button (__('Create'), 'crtbtn', false, 'class="sub next"');

View File

@ -18,7 +18,9 @@ global $config;
// Login check // Login check
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "LW") && ! check_acl ($config['id_user'], 0, "AD")) { if (! check_acl ($config['id_user'], 0, "LW") &&
! check_acl ($config['id_user'], 0, "AD") &&
! check_acl ($config['id_user'], 0, "LM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Alert Management"); "Trying to access Alert Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -266,7 +268,7 @@ if ($id_agente) {
require_once('godmode/alerts/alert_list.list.php'); require_once('godmode/alerts/alert_list.list.php');
if(check_acl ($config['id_user'], $agent['id_grupo'], "LW")) { if(check_acl ($config['id_user'], $agent['id_grupo'], "LW") || check_acl ($config['id_user'], $agent['id_grupo'], "LM")) {
require_once('godmode/alerts/alert_list.builder.php'); require_once('godmode/alerts/alert_list.builder.php');
} }
@ -274,9 +276,9 @@ if ($id_agente) {
} }
else { else {
$searchFlag = true; $searchFlag = true;
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
// The tabs will be shown only with manage alerts permissions // The tabs will be shown only with manage alerts permissions
if(check_acl ($config['id_user'], 0, "LW")) { if(check_acl ($config['id_user'], 0, "LW") || check_acl ($config['id_user'], 0, "LM")) {
$buttons = array( $buttons = array(
'list' => array( 'list' => array(
'active' => false, 'active' => false,
@ -315,7 +317,7 @@ else {
else { else {
$groups = array(0 => __('All')); $groups = array(0 => __('All'));
} }
$agents = agents_get_group_agents (array_keys ($groups), false, "none"); $agents = agents_get_group_agents (array_keys ($groups), false, "none",true);
require_once($config['homedir'] . '/godmode/alerts/alert_list.list.php'); require_once($config['homedir'] . '/godmode/alerts/alert_list.list.php');

View File

@ -18,7 +18,7 @@ global $config;
check_login (); check_login ();
if (! check_acl($config['id_user'], 0, "EW")) { if (! check_acl($config['id_user'], 0, "PM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Custom events Management"); "Trying to access Custom events Management");
require ("general/noaccess.php"); require ("general/noaccess.php");

View File

@ -18,7 +18,11 @@ global $config;
check_login (); check_login ();
if (! check_acl ($config["id_user"], 0, "EW")) { $event_w = check_acl ($config['id_user'], 0, "EW");
$event_m = check_acl ($config['id_user'], 0, "EM");
$access = ($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'EW');
if (!$event_w && !$event_m) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access events filter editor"); "Trying to access events filter editor");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -183,9 +187,7 @@ $table->style[0] = 'vertical-align: top;';
$table->valign[1] = 'top'; $table->valign[1] = 'top';
if (defined('METACONSOLE')) { if (is_metaconsole()) {
$table->width = '100%';
$table->border = 0;
if ($id) { if ($id) {
$table->head[0] = __('Update Filter'); $table->head[0] = __('Update Filter');
} }
@ -206,12 +208,12 @@ $table->data[0][1] =
$table->data[1][0] = '<b>' . __('Save in group') . '</b>' . $table->data[1][0] = '<b>' . __('Save in group') . '</b>' .
ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true); ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true);
$table->data[1][1] = html_print_select_groups( $table->data[1][1] = html_print_select_groups(
$config['id_user'], "ER", users_can_manage_group_all(), $config['id_user'], $access, users_can_manage_group_all(),
"id_group_filter", $id_group_filter, '', '', -1, true, false, false, "id_group_filter", $id_group_filter, '', '', -1, true, false, false,
'', false, '', false, false, 'id_grupo', $strict_user); '', false, '', false, false, 'id_grupo', $strict_user);
$table->data[2][0] = '<b>' . __('Group').'</b>'; $table->data[2][0] = '<b>' . __('Group').'</b>';
$table->data[2][1] = html_print_select_groups($config["id_user"], "ER", $table->data[2][1] = html_print_select_groups($config["id_user"], $access,
true, 'id_group', $id_group, '', '', -1, true, false, false, '', true, 'id_group', $id_group, '', '', -1, true, false, false, '',
false, false, false, false, 'id_grupo', $strict_user); false, false, false, false, 'id_grupo', $strict_user);
@ -244,7 +246,7 @@ $params['input_name'] = 'text_agent';
$params['value'] = $text_agent; $params['value'] = $text_agent;
$params['return'] = true; $params['return'] = true;
if (defined('METACONSOLE')) { if (is_metaconsole()) {
$params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax'; $params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax';
} }
else { else {
@ -276,7 +278,7 @@ if ($strict_user) {
$users = array($config['id_user'] => $config['id_user']); $users = array($config['id_user'] => $config['id_user']);
} }
else { else {
$users = users_get_user_users($config['id_user'], "ER", $users = users_get_user_users($config['id_user'], $access,
users_can_manage_group_all()); users_can_manage_group_all());
} }
@ -300,7 +302,7 @@ if (empty($tag_without)) {
} }
# Fix : only admin users can see all tags # Fix : only admin users can see all tags
$tags = tags_get_user_tags($config['id_user'], 'ER'); $tags = tags_get_user_tags($config['id_user'], $access);
$tags_select_with = array(); $tags_select_with = array();
$tags_select_without = array(); $tags_select_without = array();

View File

@ -18,7 +18,11 @@ global $config;
check_login (); check_login ();
if (! check_acl ($config["id_user"], 0, "EW")) { $event_w = check_acl ($config['id_user'], 0, "EW");
$event_m = check_acl ($config['id_user'], 0, "EM");
$access = ($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'EW');
if (!$event_w && !$event_m) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access events filter editor"); "Trying to access events filter editor");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -83,7 +87,7 @@ if ($strict_acl) {
users_can_manage_group_all()); users_can_manage_group_all());
} }
else { else {
$groups_user = users_get_groups ($config['id_user'], "EW", $groups_user = users_get_groups ($config['id_user'], $access,
users_can_manage_group_all(), true); users_can_manage_group_all(), true);
} }
@ -157,7 +161,7 @@ else {
if (isset($data)) { if (isset($data)) {
echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/events&amp;pure=".$config['pure']."'>"; echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/events&amp;pure=".$config['pure']."'>";
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
if(!defined("METACONSOLE")) if(!is_metaconsole())
echo "<div style='padding-bottom: 20px; text-align: right;'>"; echo "<div style='padding-bottom: 20px; text-align: right;'>";
else else
echo "<div style='float:right; '>"; echo "<div style='float:right; '>";

View File

@ -59,7 +59,7 @@ $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
if(defined('METACONSOLE')) { if(is_metaconsole()) {
$table->head[0] = __('Edit event responses'); $table->head[0] = __('Edit event responses');
$table->head_colspan[0] = 5; $table->head_colspan[0] = 5;
$table->headstyle[0] = 'text-align: center'; $table->headstyle[0] = 'text-align: center';
@ -79,7 +79,7 @@ $data[1] = html_print_input_text('name', $event_response['name'], '',
$data[1] .= html_print_input_hidden('id_response',$event_response['id'],true); $data[1] .= html_print_input_hidden('id_response',$event_response['id'],true);
$data[2] = __('Group'); $data[2] = __('Group');
$data[3] = html_print_select_groups(false, 'AR', true, 'id_group',$event_response['id_group'],'','','',true); $data[3] = html_print_select_groups(false, 'PM', true, 'id_group',$event_response['id_group'],'','','',true);
$table->data[0] = $data; $table->data[0] = $data;
$data = array(); $data = array();

View File

@ -20,7 +20,7 @@ check_login ();
enterprise_hook('open_meta_frame'); enterprise_hook('open_meta_frame');
if (! check_acl ($config["id_user"], 0, "EW")) { if (!check_acl ($config["id_user"], 0, "EW") && !check_acl ($config["id_user"], 0, "EM") && ! check_acl ($config["id_user"], 0, "PM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access event manage"); "Trying to access event manage");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -31,29 +31,31 @@ if (! check_acl ($config["id_user"], 0, "EW")) {
$section = (string) get_parameter ("section", "filter"); $section = (string) get_parameter ("section", "filter");
// Draws header // Draws header
$buttons['view'] = array('active' => false, if (check_acl ($config["id_user"], 0, "EW") || check_acl ($config["id_user"], 0, "EM")) {
'text' => '<a href="index.php?sec=eventos&sec2=operation/events/events&amp;pure='.$config['pure'].'">' . $buttons['view'] = array('active' => false,
html_print_image("images/events_list.png", true, array("title" => __('Event list'))) . '</a>', 'text' => '<a href="index.php?sec=eventos&sec2=operation/events/events&amp;pure='.$config['pure'].'">' .
'operation' => true); html_print_image("images/events_list.png", true, array("title" => __('Event list'))) . '</a>',
'operation' => true);
$buttons['filter'] = array('active' => false, $buttons['filter'] = array('active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=filter&amp;pure='.$config['pure'].'">' . '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, array ("title" => __('Filter list'))) . '</a>'); html_print_image("images/filter_mc.png", true, array ("title" => __('Filter list'))) . '</a>');
}
if (check_acl ($config["id_user"], 0, "PM")) { if (check_acl ($config["id_user"], 0, "PM")) {
$buttons['responses'] = array('active' => false, $buttons['responses'] = array('active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=responses&amp;pure='.$config['pure'].'">' . '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, array ("title" => __('Event responses'))) . '</a>'); html_print_image("images/event_responses.png", true, array ("title" => __('Event responses'))) . '</a>');
if (! defined ('METACONSOLE')) { if (!is_metaconsole()) {
$buttons['fields'] = array('active' => false, $buttons['fields'] = array('active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=fields&amp;pure='.$config['pure'].'">' . '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, array ("title" => __('Custom fields'))) . '</a>'); html_print_image("images/custom_columns.png", true, array ("title" => __('Custom fields'))) . '</a>');
} }
else { else {
$buttons['fields'] = array('active' => false, $buttons['fields'] = array('active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=event/custom_events&amp;section=fields&amp;pure='.$config['pure'].'">' . 'text' => '<a href="index.php?sec=eventos&sec2=event/custom_events&amp;section=fields&amp;pure='.$config['pure'].'">' .
html_print_image("images/custom_columns.png", true, array ("title" => __('Custom fields'))) . '</a>'); html_print_image("images/custom_columns.png", true, array ("title" => __('Custom fields'))) . '</a>');
} }
} }

View File

@ -17,8 +17,11 @@ global $config;
check_login (); check_login ();
$gis_w = check_acl ($config['id_user'], 0, 'MW');
$gis_m = check_acl ($config['id_user'], 0, 'MM')
$access = ($gis_w == true) ? 'MW' : (($gis_m == true) ? 'MM' : 'MW');
if (! check_acl ($config['id_user'], 0, "IW")) { if (!$gis_w && !$gis_m ) {
db_pandora_audit("ACL Violation", "Trying to access map builder"); db_pandora_audit("ACL Violation", "Trying to access map builder");
require ("general/noaccess.php"); require ("general/noaccess.php");
return; return;
@ -337,7 +340,7 @@ if (isset($invalidFields['map_connection_list'])) {
$listConnectionTemp = db_get_all_rows_sql("SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection"); $listConnectionTemp = db_get_all_rows_sql("SELECT id_tmap_connection, conection_name, group_id FROM tgis_map_connection");
$listConnection = array(); $listConnection = array();
foreach ($listConnectionTemp as $connectionTemp) { foreach ($listConnectionTemp as $connectionTemp) {
if (check_acl ($config["id_user"], $connectionTemp['group_id'], "IW")) { if (check_acl ($config["id_user"], $connectionTemp['group_id'], "MW") || check_acl ($config["id_user"], $connectionTemp['group_id'], "MM")) {
$listConnection[$connectionTemp['id_tmap_connection']] = $connectionTemp['conection_name']; $listConnection[$connectionTemp['id_tmap_connection']] = $connectionTemp['conection_name'];
} }
} }
@ -356,7 +359,7 @@ $table->data[1][1] = "<table style='padding:0px;' class='no-class' border='0' id
</tr> " . gis_add_conection_maps_in_form($map_connection_list) . " </tr> " . gis_add_conection_maps_in_form($map_connection_list) . "
</table>"; </table>";
$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, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "MM"))
$display_all_group = true; $display_all_group = true;
else else
$display_all_group = false; $display_all_group = false;
@ -408,7 +411,7 @@ $table->data[1][1] = '<div id="form_layer">
</tr> </tr>
<tr> <tr>
<td>' . __('Show agents from group') . ':</td> <td>' . __('Show agents from group') . ':</td>
<td colspan="3">' . html_print_select_groups(false, 'IW', $display_all_group, 'layer_group_form', '-1', '', __('None'), '-1', true) . '</td> <td colspan="3">' . html_print_select_groups(false, $access, $display_all_group, 'layer_group_form', '-1', '', __('None'), '-1', true) . '</td>
</tr> </tr>
<tr> <tr>
<td colspan="4"><hr /></td> <td colspan="4"><hr /></td>

View File

@ -24,68 +24,73 @@ require_once ('include/functions_menu.php');
$menu_godmode = array (); $menu_godmode = array ();
$menu_godmode['class'] = 'godmode'; $menu_godmode['class'] = 'godmode';
$sub = array ();
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")) {
$menu_godmode["gagente"]["text"] = __('Resources');
$menu_godmode["gagente"]["sec2"] = "godmode/agentes/modificar_agente";
$menu_godmode["gagente"]["id"] = "god-resources";
$sub = array ();
$sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents'); $sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents');
$sub['godmode/agentes/modificar_agente']['id'] = 'Manage agents'; $sub['godmode/agentes/modificar_agente']['id'] = 'Manage agents';
$sub["godmode/agentes/modificar_agente"]["subsecs"] = array( $sub["godmode/agentes/modificar_agente"]["subsecs"] = array(
"godmode/agentes/configurar_agente"); "godmode/agentes/configurar_agente");
}
if (check_acl ($config["id_user"], 0, "PM")) {
$sub["godmode/agentes/fields_manager"]["text"] = __('Custom fields');
$sub["godmode/agentes/fields_manager"]["id"] = 'Custom fields';
if (check_acl ($config['id_user'], 0, "AW")) { $sub["godmode/modules/manage_nc_groups"]["text"] = __('Component groups');
if (check_acl ($config["id_user"], 0, "PM")) { $sub["godmode/modules/manage_nc_groups"]["id"] = 'Component groups';
$sub["godmode/agentes/fields_manager"]["text"] = __('Custom fields'); // Category
$sub["godmode/agentes/fields_manager"]["id"] = 'Custom fields'; $sub["godmode/category/category"]["text"] = __('Module categories');
$sub["godmode/category/category"]["id"] = 'Module categories';
$sub["godmode/modules/manage_nc_groups"]["text"] = __('Component groups'); $sub["godmode/category/category"]["subsecs"] = "godmode/category/edit_category";
$sub["godmode/modules/manage_nc_groups"]["id"] = 'Component groups';
// Category $sub["godmode/modules/module_list"]["text"] = __('Module types');
$sub["godmode/category/category"]["text"] = __('Module categories'); $sub["godmode/modules/module_list"]["id"] = 'Module types';
$sub["godmode/category/category"]["id"] = 'Module categories';
$sub["godmode/category/category"]["subsecs"] = "godmode/category/edit_category"; $sub["godmode/groups/modu_group_list"]["text"] = __('Module groups');
$sub["godmode/groups/modu_group_list"]["id"] = 'Module groups';
$sub["godmode/modules/module_list"]["text"] = __('Module types'); }
$sub["godmode/modules/module_list"]["id"] = 'Module types';
if (check_acl ($config['id_user'], 0, "AW")) {
$sub["godmode/groups/modu_group_list"]["text"] = __('Module groups'); //Netflow
$sub["godmode/groups/modu_group_list"]["id"] = 'Module groups'; if ($config['activate_netflow']) {
} $sub["godmode/netflow/nf_edit"]["text"] = __('Netflow filters');
$sub["godmode/netflow/nf_edit"]["id"] = 'Netflow filters';
if ($config['activate_netflow']) {
//Netflow
$sub["godmode/netflow/nf_edit"]["text"] = __('Netflow filters');
$sub["godmode/netflow/nf_edit"]["id"] = 'Netflow filters';
}
} }
}
if (!empty($sub)) {
$menu_godmode["gagente"]["text"] = __('Resources');
$menu_godmode["gagente"]["sec2"] = "godmode/agentes/modificar_agente";
$menu_godmode["gagente"]["id"] = "god-resources";
$menu_godmode["gagente"]["sub"] = $sub; $menu_godmode["gagente"]["sub"] = $sub;
} }
$sub = array ();
if (check_acl ($config['id_user'], 0, "AW")) {
$sub["godmode/groups/group_list"]["text"] = __('Manage agents groups');
$sub["godmode/groups/group_list"]["id"] = 'Manage agents groups';
}
if (check_acl ($config['id_user'], 0, "PM")) {
// Tag
$sub["godmode/tag/tag"]["text"] = __('Module tags');
$sub["godmode/tag/tag"]["id"] = 'Module tags';
$sub["godmode/tag/tag"]["subsecs"] = "godmode/tag/edit_tag";
enterprise_hook ('enterprise_acl_submenu');
}
if (check_acl ($config['id_user'], 0, "UM")) { if (check_acl ($config['id_user'], 0, "UM")) {
$menu_godmode["gusuarios"]["text"] = __('Profiles');
$menu_godmode["gusuarios"]["sec2"] = "godmode/users/user_list";
$menu_godmode["gusuarios"]["id"] = "god-users";
$sub = array ();
$sub['godmode/users/user_list']['text'] = __('Users management'); $sub['godmode/users/user_list']['text'] = __('Users management');
$sub['godmode/users/user_list']['id'] = 'Users management'; $sub['godmode/users/user_list']['id'] = 'Users management';
$sub['godmode/users/profile_list']['text'] = __('Profile management'); $sub['godmode/users/profile_list']['text'] = __('Profile management');
$sub['godmode/users/profile_list']['id'] = 'Profile management'; $sub['godmode/users/profile_list']['id'] = 'Profile management';
$sub["godmode/groups/group_list"]["text"] = __('Manage agents groups'); }
$sub["godmode/groups/group_list"]["id"] = 'Manage agents groups';
if (!empty($sub)) {
if (check_acl ($config['id_user'], 0, "PM")) {
// Tag
$sub["godmode/tag/tag"]["text"] = __('Module tags');
$sub["godmode/tag/tag"]["id"] = 'Module tags';
$sub["godmode/tag/tag"]["subsecs"] = "godmode/tag/edit_tag";
enterprise_hook ('enterprise_acl_submenu');
}
$menu_godmode["gusuarios"]["sub"] = $sub; $menu_godmode["gusuarios"]["sub"] = $sub;
$menu_godmode["gusuarios"]["text"] = __('Profiles');
$menu_godmode["gusuarios"]["sec2"] = "godmode/users/user_list";
$menu_godmode["gusuarios"]["id"] = "god-users";
} }
$sub = array (); $sub = array ();
@ -117,11 +122,12 @@ if (check_acl ($config['id_user'], 0, "AW")) {
$sub2["godmode/massive/massive_operations&amp;tab=massive_alerts"]["text"] = __('Alerts operations'); $sub2["godmode/massive/massive_operations&amp;tab=massive_alerts"]["text"] = __('Alerts operations');
enterprise_hook('massivepolicies_submenu'); enterprise_hook('massivepolicies_submenu');
enterprise_hook('massivesnmp_submenu'); enterprise_hook('massivesnmp_submenu');
enterprise_hook('massivesatellite_submenu');
$sub["gmassive"]["sub2"] = $sub2; $sub["gmassive"]["sub2"] = $sub2;
} }
enterprise_hook('massivesatellite_submenu');
if (!empty($sub)) { if (!empty($sub)) {
$menu_godmode["gmodules"]["text"] = __('Configuration'); $menu_godmode["gmodules"]["text"] = __('Configuration');
$menu_godmode["gmodules"]["sec2"] = "godmode/modules/manage_network_templates"; $menu_godmode["gmodules"]["sec2"] = "godmode/modules/manage_network_templates";
@ -129,24 +135,23 @@ if (!empty($sub)) {
$menu_godmode["gmodules"]["sub"] = $sub; $menu_godmode["gmodules"]["sub"] = $sub;
} }
if (check_acl ($config['id_user'], 0, "LM") || check_acl ($config['id_user'], 0, "AD")) { if (check_acl ($config['id_user'], 0, "LW") ||
check_acl ($config['id_user'], 0, "LM") ||
check_acl ($config['id_user'], 0, "AD")) {
$menu_godmode["galertas"]["text"] = __('Alerts'); $menu_godmode["galertas"]["text"] = __('Alerts');
$menu_godmode["galertas"]["sec2"] = "godmode/alerts/alert_list"; $menu_godmode["galertas"]["sec2"] = "godmode/alerts/alert_list";
$menu_godmode["galertas"]["id"] = "god-alerts"; $menu_godmode["galertas"]["id"] = "god-alerts";
$sub = array (); $sub = array ();
$sub["godmode/alerts/alert_list"]["text"] = __('List of Alerts'); $sub["godmode/alerts/alert_list"]["text"] = __('List of Alerts');
$sub["godmode/alerts/alert_list"]["id"] = 'List of Alerts'; $sub["godmode/alerts/alert_list"]["id"] = 'List of Alerts';
if (check_acl ($config['id_user'], 0, "LM")) { if (check_acl ($config['id_user'], 0, "LM")) {
$sub["godmode/alerts/alert_templates"]["text"] = __('Templates'); $sub["godmode/alerts/alert_templates"]["text"] = __('Templates');
$sub["godmode/alerts/alert_templates"]["id"] = 'Templates'; $sub["godmode/alerts/alert_templates"]["id"] = 'Templates';
$sub["godmode/alerts/alert_actions"]["text"] = __('Actions'); $sub["godmode/alerts/alert_actions"]["text"] = __('Actions');
$sub["godmode/alerts/alert_actions"]["id"] = 'Actions'; $sub["godmode/alerts/alert_actions"]["id"] = 'Actions';
$sub["godmode/alerts/alert_commands"]["text"] = __('Commands');
if (check_acl ($config['id_user'], 0, "PM")) { $sub["godmode/alerts/alert_commands"]["id"] = 'Commands';
$sub["godmode/alerts/alert_commands"]["text"] = __('Commands');
$sub["godmode/alerts/alert_commands"]["id"] = 'Commands';
}
$sub["godmode/alerts/alert_special_days"]["text"] = __('Special days list'); $sub["godmode/alerts/alert_special_days"]["text"] = __('Special days list');
$sub["godmode/alerts/alert_special_days"]["id"] = __('Special days list'); $sub["godmode/alerts/alert_special_days"]["id"] = __('Special days list');
enterprise_hook('eventalerts_submenu'); enterprise_hook('eventalerts_submenu');
@ -156,41 +161,45 @@ if (check_acl ($config['id_user'], 0, "LM") || check_acl ($config['id_user'], 0,
$menu_godmode["galertas"]["sub"] = $sub; $menu_godmode["galertas"]["sub"] = $sub;
} }
if (check_acl ($config['id_user'], 0, "EW")) { // Manage events
// Manage events $sub = array ();
if (check_acl ($config['id_user'], 0, "EW") || check_acl ($config['id_user'], 0, "EM")) {
// Custom event fields
$sub["godmode/events/events&amp;section=filter"]["text"] = __('Event filters');
$sub["godmode/events/events&amp;section=filter"]["id"] = 'Event filters';
}
if (check_acl ($config['id_user'], 0, "PM")) {
$sub["godmode/events/events&amp;section=fields"]["text"] = __('Custom events');
$sub["godmode/events/events&amp;section=fields"]["id"] = 'Custom events';
$sub["godmode/events/events&amp;section=responses"]["text"] = __('Event responses');
$sub["godmode/events/events&amp;section=responses"]["id"] = 'Event responses';
}
if (!empty($sub)) {
$menu_godmode["geventos"]["text"] = __('Events'); $menu_godmode["geventos"]["text"] = __('Events');
$menu_godmode["geventos"]["sec2"] = "godmode/events/events&amp;section=filter"; $menu_godmode["geventos"]["sec2"] = "godmode/events/events&amp;section=filter";
$menu_godmode["geventos"]["id"] = "god-events"; $menu_godmode["geventos"]["id"] = "god-events";
// Custom event fields
$sub = array ();
$sub["godmode/events/events&amp;section=filter"]["text"] = __('Event filters');
$sub["godmode/events/events&amp;section=filter"]["id"] = 'Event filters';
if (check_acl ($config['id_user'], 0, "PM")) {
$sub["godmode/events/events&amp;section=fields"]["text"] = __('Custom events');
$sub["godmode/events/events&amp;section=fields"]["id"] = 'Custom events';
$sub["godmode/events/events&amp;section=responses"]["text"] = __('Event responses');
$sub["godmode/events/events&amp;section=responses"]["id"] = 'Event responses';
}
$menu_godmode["geventos"]["sub"] = $sub; $menu_godmode["geventos"]["sub"] = $sub;
} }
if (check_acl ($config['id_user'], 0, "AW")) {
if (check_acl ($config['id_user'], 0, "AW") || check_acl ($config['id_user'], 0, "PM")) {
// Servers // Servers
$menu_godmode["gservers"]["text"] = __('Servers'); $menu_godmode["gservers"]["text"] = __('Servers');
$menu_godmode["gservers"]["sec2"] = "godmode/servers/modificar_server"; $menu_godmode["gservers"]["sec2"] = "godmode/servers/modificar_server";
$menu_godmode["gservers"]["id"] = "god-servers"; $menu_godmode["gservers"]["id"] = "god-servers";
$sub = array (); $sub = array ();
$sub["godmode/servers/modificar_server"]["text"] = __('Manage servers'); if (check_acl ($config['id_user'], 0, "AW")) {
$sub["godmode/servers/modificar_server"]["id"] = 'Manage servers'; $sub["godmode/servers/modificar_server"]["text"] = __('Manage servers');
$sub["godmode/servers/manage_recontask"]["text"] = __('Recon task'); $sub["godmode/servers/modificar_server"]["id"] = 'Manage servers';
$sub["godmode/servers/manage_recontask"]["id"] = 'Recon task'; }
//This subtabs are only for Pandora Admin //This subtabs are only for Pandora Admin
if (check_acl ($config['id_user'], 0, "PM")) { if (check_acl ($config['id_user'], 0, "PM")) {
$sub["godmode/servers/manage_recontask"]["text"] = __('Recon task');
$sub["godmode/servers/manage_recontask"]["id"] = 'Recon task';
$sub["godmode/servers/plugin"]["text"] = __('Plugins'); $sub["godmode/servers/plugin"]["text"] = __('Plugins');
$sub["godmode/servers/plugin"]["id"] = 'Plugins'; $sub["godmode/servers/plugin"]["id"] = 'Plugins';
@ -282,7 +291,7 @@ if (check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0,
$sub["godmode/setup/file_manager"]["id"] = 'File manager'; $sub["godmode/setup/file_manager"]["id"] = 'File manager';
} }
if (check_acl ($config['id_user'], 0, "DM")) { if (check_acl ($config['id_user'], 0, "DM") || check_acl ($config['id_user'], 0, "PM")) {
$sub["gdbman"]["text"] = __('DB maintenance'); $sub["gdbman"]["text"] = __('DB maintenance');
$sub["gdbman"]["id"] = 'DB maintenance'; $sub["gdbman"]["id"] = 'DB maintenance';
$sub["gdbman"]["type"] = "direct"; $sub["gdbman"]["type"] = "direct";
@ -373,10 +382,8 @@ if (is_array ($config['extensions'])) {
} }
if (!empty($sub2)) if (!empty($sub2)) {
$sub["godmode/extensions"]["sub2"] = $sub2; $sub["godmode/extensions"]["sub2"] = $sub2;
if (!empty($sub)) {
$sub["godmode/extensions"]["text"] = __('Extension manager'); $sub["godmode/extensions"]["text"] = __('Extension manager');
$sub["godmode/extensions"]["id"] = 'Extension manager'; $sub["godmode/extensions"]["id"] = 'Extension manager';
$submenu = array_merge($menu_godmode["gextensions"]["sub"],$sub); $submenu = array_merge($menu_godmode["gextensions"]["sub"],$sub);

View File

@ -17,7 +17,10 @@ global $config;
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "RW")) { $report_w = check_acl ($config['id_user'], 0, "RW");
$report_m = check_acl ($config['id_user'], 0, "RM");
if (!$report_w && !$report_m ) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access graph builder"); "Trying to access graph builder");
include ("general/noaccess.php"); include ("general/noaccess.php");
@ -129,7 +132,6 @@ if (count($module_array) > 0) {
} }
//Configuration form //Configuration form
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>'; echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&add_module=1&edit_graph=1&id=" . $id_graph . "'>"; echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&add_module=1&edit_graph=1&id=" . $id_graph . "'>";
@ -137,7 +139,9 @@ echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters
echo "<tr>"; echo "<tr>";
echo "<td colspan='3'>".__('Filter group')."</td>"; echo "<td colspan='3'>".__('Filter group')."</td>";
echo "</tr><tr>"; echo "</tr><tr>";
echo "<td colspan='3'>".html_print_select(groups_get_all(), 'group', '', "filterByGroup($('#group').val());", __('All'), '0', true)."</td>"; echo "<td colspan='3'>".html_print_select_groups($config['id_user'], ($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RW'),
true, 'group', '', 'filterByGroup($(\'#group\').val());',
'', 0, true)."</td>";
echo "</tr><tr>"; echo "</tr><tr>";
echo "<td style='vertical-align: top;'>".__('Agents')."</td>"; echo "<td style='vertical-align: top;'>".__('Agents')."</td>";
echo "<td></td>"; echo "<td></td>";

View File

@ -48,7 +48,7 @@ if (is_ajax ()) {
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "RW")) { if (! check_acl ($config['id_user'], 0, "RW") && ! check_acl ($config['id_user'], 0, "RM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access graph builder"); "Trying to access graph builder");
include ("general/noaccess.php"); include ("general/noaccess.php");
@ -111,9 +111,12 @@ if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
else else
$return_all_groups = false; $return_all_groups = false;
echo "<td><b>".__('Group')."</b></td><td>" . echo "<td><b>".__('Group')."</b></td><td>";
html_print_select_groups($config['id_user'], "AR", $return_all_groups, 'graph_id_group', $id_group, '', '', '', true) . if (check_acl ($config['id_user'], 0, "RW"))
"</td></tr>"; echo html_print_select_groups($config['id_user'], 'RW', $return_all_groups, 'graph_id_group', $id_group, '', '', '', true);
elseif (check_acl ($config['id_user'], 0, "RM"))
echo html_print_select_groups($config['id_user'], 'RM', $return_all_groups, 'graph_id_group', $id_group, '', '', '', true);
echo "</td></tr>";
echo "<tr>"; echo "<tr>";
echo "<td class='datos2'><b>".__('Description')."</b></td>"; echo "<td class='datos2'><b>".__('Description')."</b></td>";
echo "<td class='datos2' colspan=3><textarea name='description' style='height:45px;' cols=55 rows=2>"; echo "<td class='datos2' colspan=3><textarea name='description' style='height:45px;' cols=55 rows=2>";

View File

@ -46,7 +46,7 @@ if (is_ajax ()) {
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "RW")) { if (! check_acl ($config['id_user'], 0, "RW") && ! check_acl ($config['id_user'], 0, "RM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access graph builder"); "Trying to access graph builder");
include ("general/noaccess.php"); include ("general/noaccess.php");

View File

@ -20,7 +20,11 @@ require_once ('include/functions_custom_graphs.php');
// Check user credentials // Check user credentials
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "RR")) { $report_r = check_acl ($config['id_user'], 0, "RR");
$report_w = check_acl ($config['id_user'], 0, "RW");
$report_m = check_acl ($config['id_user'], 0, "RM");
$access = ($report_r == true) ? 'RR' : (($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RR'));
if (!$report_r && !$report_w && !$report_m) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Inventory Module Management"); "Trying to access Inventory Module Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -72,7 +76,7 @@ ui_print_page_header (__('Reporting')." &raquo; ".__('Custom graphs'), "images/c
// Delete module SQL code // Delete module SQL code
if ($delete_graph) { if ($delete_graph) {
if (check_acl ($config['id_user'], 0, "RW")) { if ( $report_w || $report_m ) {
$exist = db_get_value("id_graph", "tgraph_source", "id_graph", $id); $exist = db_get_value("id_graph", "tgraph_source", "id_graph", $id);
if ($exist) { if ($exist) {
@ -134,7 +138,7 @@ if ($multiple_delete) {
} }
$graphs = custom_graphs_get_user ($config['id_user'], false, true, "RR"); $graphs = custom_graphs_get_user ($config['id_user'], false, true, $access);
$offset = (int) get_parameter ("offset"); $offset = (int) get_parameter ("offset");
ui_pagination (count($graphs)); ui_pagination (count($graphs));
@ -154,7 +158,7 @@ if (!empty ($graphs)) {
$table->size[3] = '200px'; $table->size[3] = '200px';
$table->align[2] = 'left'; $table->align[2] = 'left';
$table->align[3] = 'left'; $table->align[3] = 'left';
if (check_acl ($config['id_user'], 0, "RW")) { if ($report_w || $report_m) {
$table->align[4] = 'left'; $table->align[4] = 'left';
$table->head[4] = __('Op.') . $table->head[4] = __('Op.') .
html_print_checkbox('all_delete', 0, false, true, false, html_print_checkbox('all_delete', 0, false, true, false,
@ -176,7 +180,7 @@ if (!empty ($graphs)) {
$data[2] = $graph["graphs_count"]; $data[2] = $graph["graphs_count"];
$data[3] = ui_print_group_icon($graph['id_group'],true); $data[3] = ui_print_group_icon($graph['id_group'],true);
if (check_acl ($config['id_user'], 0, "RW") && users_can_manage_group_all($graph['id_group'])) { if (($report_w || $report_m) && users_can_manage_group_all($access)) {
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='. $data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.
$graph['id_graph'].'">'.html_print_image("images/config.png", true).'</a>'; $graph['id_graph'].'">'.html_print_image("images/config.png", true).'</a>';
@ -204,7 +208,7 @@ if (!empty ($graphs)) {
echo "<div style='float: right;'>"; echo "<div style='float: right;'>";
if (check_acl ($config['id_user'], 0, "RW")) { if ($report_w || $report_m) {
echo '<form method="post" style="float:right;" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">'; echo '<form method="post" style="float:right;" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
html_print_submit_button (__('Create graph'), 'create', false, 'class="sub next" style="margin-right:5px;"'); html_print_submit_button (__('Create graph'), 'create', false, 'class="sub next" style="margin-right:5px;"');
echo "</form>"; echo "</form>";

View File

@ -245,10 +245,10 @@ else {
$total_maps = count(visual_map_get_user_layouts ($config['id_user'], false, $total_maps = count(visual_map_get_user_layouts ($config['id_user'], false,
false, false)); false, false));
} }
if (!$maps && !defined("METACONSOLE")) { if (!$maps && !is_metaconsole()) {
require_once ($config['homedir'] . "/general/firts_task/map_builder.php"); require_once ($config['homedir'] . "/general/firts_task/map_builder.php");
} }
elseif (!$maps && defined("METACONSOLE")) { elseif (!$maps && is_metaconsole()) {
ui_print_info_message( ui_print_info_message(
array( array(
'no_close'=>true, 'no_close'=>true,
@ -266,7 +266,7 @@ else {
$data = array (); $data = array ();
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$data[0] = '<a href="index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;id='. $data[0] = '<a href="index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;id='.
$map['id'].'&amp;refr=' . $refr . '">'.$map['name'].'</a>'; $map['id'].'&amp;refr=' . $refr . '">'.$map['name'].'</a>';
} }
@ -281,7 +281,7 @@ else {
// Fix: IW was the old ACL for report editing, now is RW // Fix: IW was the old ACL for report editing, now is RW
if ($vconsole_write || $vconsole_manage) { if ($vconsole_write || $vconsole_manage) {
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$data[3] = '<a class="copy_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image ("images/copy.png", true).'</a>'; $data[3] = '<a class="copy_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;copy_layout=1">'.html_print_image ("images/copy.png", true).'</a>';
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1">'.html_print_image ("images/cross.png", true).'</a>'; $data[4] = '<a class="delete_visualmap" href="index.php?sec=network&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;delete_layout=1">'.html_print_image ("images/cross.png", true).'</a>';
} }
@ -295,7 +295,7 @@ else {
html_print_table ($table); html_print_table ($table);
} }
if ($maps) { if ($maps) {
if (!defined('METACONSOLE')) if (!is_metaconsole())
echo '<div class="action-buttons" style="width: 0px;">'; echo '<div class="action-buttons" style="width: 0px;">';
else else
echo '<div class="" style="width: 100%; text-align: right;">'; echo '<div class="" style="width: 100%; text-align: right;">';

View File

@ -19,7 +19,7 @@ require_once ($config['homedir'] . '/include/db/oracle.php');
// Login check // Login check
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "RW")) { if (! check_acl ($config['id_user'], 0, "RW") && ! check_acl ($config['id_user'], 0, "RM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access report builder"); "Trying to access report builder");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -31,12 +31,6 @@ if (($config['metaconsole'] == 1) && (defined('METACONSOLE'))) {
$meta = true; $meta = true;
} }
$show_graph_options = Array(); $show_graph_options = Array();
$show_graph_options[0] = __('Only table'); $show_graph_options[0] = __('Only table');
$show_graph_options[1] = __('Table & Graph'); $show_graph_options[1] = __('Table & Graph');
@ -632,7 +626,10 @@ $class = 'databox filters';
$own_info = get_user_info ($config['id_user']); $own_info = get_user_info ($config['id_user']);
// Get group list that user has access // Get group list that user has access
$groups_user = users_get_groups ($config['id_user'], "RW", $own_info['is_admin'], true); if (check_acl ($config['id_user'], 0, "RW"))
$groups_user = users_get_groups ($config['id_user'], "RW", $own_info['is_admin'], true);
elseif (check_acl ($config['id_user'], 0, "RM"))
$groups_user = users_get_groups ($config['id_user'], "RM", $own_info['is_admin'], true);
$groups_id = array(); $groups_id = array();
foreach ($groups_user as $key => $groups) { foreach ($groups_user as $key => $groups) {
$groups_id[] = $groups['id_grupo']; $groups_id[] = $groups['id_grupo'];
@ -821,8 +818,12 @@ $class = 'databox filters';
<td style="font-weight:bold;"><?php echo __('Group');?></td> <td style="font-weight:bold;"><?php echo __('Group');?></td>
<td style=""> <td style="">
<?php <?php
html_print_select_groups($config['id_user'], if(check_acl ($config['id_user'], 0, "RW"))
"AR", true, 'combo_group', $group, ''); html_print_select_groups($config['id_user'],
"RW", true, 'combo_group', $group, '');
elseif(check_acl ($config['id_user'], 0, "RM"))
html_print_select_groups($config['id_user'],
"RM", true, 'combo_group', $group, '');
?> ?>
</td> </td>
</tr> </tr>

View File

@ -21,8 +21,11 @@ global $config;
check_login (); check_login ();
enterprise_hook('open_meta_frame'); enterprise_hook('open_meta_frame');
$report_r = check_acl ($config['id_user'], 0, "RR");
if (! check_acl ($config['id_user'], 0, "RR")) { $report_w = check_acl ($config['id_user'], 0, "RW");
$report_m = check_acl ($config['id_user'], 0, "RM");
$access = ($report_r == true) ? 'RR' : (($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RR'));
if (!$report_r && !$report_w && !$report_m) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access report builder"); "Trying to access report builder");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -427,15 +430,15 @@ switch ($action) {
$table_aux->colspan[0][0] = 4; $table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = "<b>". __("Group") . "</b>"; $table_aux->data[0][0] = "<b>". __("Group") . "</b>";
$table_aux->data[0][1] = html_print_select_groups(false, "AR", true, 'id_group', $id_group, '', '', '', true, false, true, '', false, 'width:150px', false, false, 'id_grupo', $strict_user). '<br>'; $table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, 'width:150px', false, false, 'id_grupo', $strict_user). '<br>';
$table_aux->data[0][2] = "<b>". __("Free text for search: ") . ui_print_help_tip( $table_aux->data[0][2] = "<b>". __("Free text for search: ") . ui_print_help_tip(
__('Search by report name or description, list matches.'),true) . "</b>"; __('Search by report name or description, list matches.'),true) . "</b>";
$table_aux->data[0][3] = html_print_input_text ("search", $search, '', 30, '', true); $table_aux->data[0][3] = html_print_input_text ("search", $search, '', 30, '', true);
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true); $table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
if (defined('METACONSOLE')) { if (is_metaconsole()) {
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&id_group=$id_group&pure=$pure' $filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&id_group=$id_group&pure=$pure'
method='post'>"; method='post'>";
$filter .= html_print_table($table_aux,true); $filter .= html_print_table($table_aux,true);
@ -449,13 +452,11 @@ switch ($action) {
echo "</form>"; echo "</form>";
} }
ui_require_jquery_file ('pandora.controls'); ui_require_jquery_file ('pandora.controls');
ui_require_jquery_file ('ajaxqueue'); ui_require_jquery_file ('ajaxqueue');
ui_require_jquery_file ('bgiframe'); ui_require_jquery_file ('bgiframe');
ui_require_jquery_file ('autocomplete'); ui_require_jquery_file ('autocomplete');
// Show only selected groups // Show only selected groups
if ($id_group > 0) { if ($id_group > 0) {
$group = array("$id_group" => $id_group); $group = array("$id_group" => $id_group);
@ -465,7 +466,7 @@ switch ($action) {
} }
$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, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "RM"))
$return_all_group = true; $return_all_group = true;
else else
$return_all_group = false; $return_all_group = false;
@ -505,10 +506,10 @@ switch ($action) {
'private', 'private',
'id_user', 'id_user',
'id_group', 'id_group',
'non_interactive'), $return_all_group, 'RR', $group, $strict_user); 'non_interactive'), $return_all_group, $access, $group, $strict_user);
$total_reports = (int) count(reports_get_reports ($filter, $total_reports = (int) count(reports_get_reports ($filter,
array ('name'), $return_all_group, 'RR', $group, $strict_user)); array ('name'), $return_all_group, $access, $group, $strict_user));
if (sizeof ($reports)) { if (sizeof ($reports)) {
@ -579,15 +580,19 @@ switch ($action) {
if (!is_user_admin ($config["id_user"])) { if (!is_user_admin ($config["id_user"])) {
if ($report["private"] && $report["id_user"] != $config['id_user']) if ($report["private"] && $report["id_user"] != $config['id_user'])
if (!check_acl ($config["id_user"], $report["id_group"], "RR")) if (!check_acl ($config["id_user"], $report["id_group"], "RR") &&
!check_acl ($config["id_user"], $report["id_group"], "RW")
&& !check_acl ($config["id_user"], $report["id_group"], "RM"))
continue; continue;
if (!check_acl ($config["id_user"], $report["id_group"], "RR")) if (!check_acl ($config["id_user"], $report["id_group"], "RR") &&
!check_acl ($config["id_user"], $report["id_group"], "RW")
&& !check_acl ($config["id_user"], $report["id_group"], "RM"))
continue; continue;
} }
$data = array (); $data = array ();
if (check_acl ($config["id_user"], $report["id_group"], "RW")) { if (check_acl ($config["id_user"], $report["id_group"], "RW") || check_acl ($config["id_user"], $report["id_group"], "RM")) {
$data[0] = '<a href="' . $config['homeurl'] . 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&id_report='. $data[0] = '<a href="' . $config['homeurl'] . 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&id_report='.
$report['id_report'].'&pure='.$pure.'">'.$report['name'].'</a>'; $report['id_report'].'&pure='.$pure.'">'.$report['name'].'</a>';
} }
@ -721,7 +726,7 @@ switch ($action) {
else { else {
ui_print_info_message ( array ( 'no_close' => true, 'message' => __('No data found.') ) ); ui_print_info_message ( array ( 'no_close' => true, 'message' => __('No data found.') ) );
} }
if (check_acl ($config['id_user'], 0, "RW")) { if (check_acl ($config['id_user'], 0, "RW") || check_acl ($config['id_user'], 0, "RM")) {
echo '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=new&pure='.$pure.'">'; echo '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=new&pure='.$pure.'">';
if (defined("METACONSOLE")) if (defined("METACONSOLE"))
echo '<div class="action-buttons" style="width: 100%; ">'; echo '<div class="action-buttons" style="width: 100%; ">';

View File

@ -19,7 +19,7 @@ global $config;
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "AW")) { if (! check_acl ($config['id_user'], 0, "PM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Recon Task Management"); "Trying to access Recon Task Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -32,10 +32,10 @@ if (check_acl ($config['id_user'], 0, "AW")) {
$options[]['text'] = "<a href='index.php?sec=estado&sec2=operation/servers/recon_view'>" . html_print_image ("images/operation.png", true, array ("title" =>__('View'))) . "</a>"; $options[]['text'] = "<a href='index.php?sec=estado&sec2=operation/servers/recon_view'>" . html_print_image ("images/operation.png", true, array ("title" =>__('View'))) . "</a>";
} }
$user_groups_w = users_get_groups(false, 'AW', true, false, null, 'id_grupo'); $user_groups_w = users_get_groups(false, 'PM', true, false, null, 'id_grupo');
$user_groups_w = array_keys($user_groups_w); $user_groups_w = array_keys($user_groups_w);
$user_groups_r = users_get_groups(false, 'AR', true, false, null, 'id_grupo'); $user_groups_r = users_get_groups(false, 'AW', true, false, null, 'id_grupo');
$user_groups_r = array_keys($user_groups_r); $user_groups_r = array_keys($user_groups_r);
// Headers // Headers

View File

@ -18,7 +18,7 @@ global $config;
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "AW")) { if (! check_acl ($config['id_user'], 0, "PM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Agent Management"); "Trying to access Agent Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -298,8 +298,8 @@ $table->data[8][1] .= ui_print_help_tip(
// Group // Group
$table->data[9][0] = "<b>".__('Group'); $table->data[9][0] = "<b>".__('Group');
$groups = users_get_groups (false, "AR", false); $groups = users_get_groups (false, "PM", false);
$table->data[9][1] = html_print_select_groups(false, "AR", false, 'id_group', $id_group, '', '', 0, true); $table->data[9][1] = html_print_select_groups(false, "PM", true, 'id_group', $id_group, '', '', 0, true);
// Incident // Incident
$values = array (0 => __('No'), 1 => __('Yes')); $values = array (0 => __('No'), 1 => __('Yes'));

View File

@ -407,7 +407,9 @@ if ($list_modules) {
include_once($config['homedir'] . "/include/functions_tags.php"); include_once($config['homedir'] . "/include/functions_tags.php");
include_once($config['homedir'] . "/include/functions_clippy.php"); include_once($config['homedir'] . "/include/functions_clippy.php");
$agent_a = check_acl ($config['id_user'], 0, "AR");
$agent_w = check_acl ($config['id_user'], 0, "AW");
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
$id_agente = $id_agent = (int)get_parameter('id_agente', 0); $id_agente = $id_agent = (int)get_parameter('id_agente', 0);
$url = 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $id_agent; $url = 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $id_agent;
@ -499,10 +501,10 @@ if ($list_modules) {
} }
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!) // Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
$groups = users_get_groups($config["id_user"]); $groups = users_get_groups($config["id_user"], $access);
$tags_sql = tags_get_acl_tags($config['id_user'], $tags_sql = tags_get_acl_tags($config['id_user'],
array_keys($groups), 'AR', 'module_condition', 'AND', array_keys($groups), $access, 'module_condition', 'AND',
'tagente_modulo', false, array(), true); 'tagente_modulo', false, array(), true);
$status_filter_monitor = (int)get_parameter('status_filter_monitor', -1); $status_filter_monitor = (int)get_parameter('status_filter_monitor', -1);

View File

@ -47,11 +47,14 @@ if (is_ajax ()) {
); );
$filter = get_parameter('filter', $default_filters); $filter = get_parameter('filter', $default_filters);
$agent_a = check_acl ($config['id_user'], 0, "AR");
$agent_w = check_acl ($config['id_user'], 0, "AW");
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
if (class_exists('TreeEnterprise')) { if (class_exists('TreeEnterprise')) {
$tree = new TreeEnterprise($type, $rootType, $id, $rootID, $serverID, $childrenMethod); $tree = new TreeEnterprise($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access);
} }
else { else {
$tree = new Tree($type, $rootType, $id, $rootID, $serverID, $childrenMethod); $tree = new Tree($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access);
} }
$tree->setFilter($filter); $tree->setFilter($filter);

View File

@ -27,17 +27,19 @@ class Tree {
protected $strictACL = false; protected $strictACL = false;
protected $acltags = false; protected $acltags = false;
protected $access = false;
public function __construct($type, $rootType = '', $id = -1, $rootID = -1, $serverID = false, $childrenMethod = "on_demand") { public function __construct($type, $rootType = '', $id = -1, $rootID = -1, $serverID = false, $childrenMethod = "on_demand", $access = 'AR') {
$this->type = $type; $this->type = $type;
$this->rootType = !empty($rootType) ? $rootType : $type; $this->rootType = !empty($rootType) ? $rootType : $type;
$this->id = $id; $this->id = $id;
$this->rootID = !empty($rootID) ? $rootID : $id; $this->rootID = !empty($rootID) ? $rootID : $id;
$this->serverID = $serverID; $this->serverID = $serverID;
$this->childrenMethod = $childrenMethod; $this->childrenMethod = $childrenMethod;
$this->access = $access;
$userGroups = users_get_groups();
$userGroups = users_get_groups(false, $this->access);
if (empty($userGroups)) if (empty($userGroups))
$this->userGroups = false; $this->userGroups = false;
@ -53,8 +55,8 @@ class Tree {
enterprise_include_once("meta/include/functions_ui_meta.php"); enterprise_include_once("meta/include/functions_ui_meta.php");
$this->strictACL = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']); $this->strictACL = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']);
$this->acltags = tags_get_user_module_and_tags($config['id_user'], 'AR'); $this->acltags = tags_get_user_module_and_tags($config['id_user'], $this->access);
} }
public function setType($type) { public function setType($type) {

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC160908'; $build_version = 'PC160912';
$pandora_version = 'v6.0SP3'; $pandora_version = 'v6.0SP3';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -17,7 +17,7 @@
include_once ($config['homedir'] . "/include/functions_groups.php"); include_once ($config['homedir'] . "/include/functions_groups.php");
include_once ($config['homedir'] . "/include/functions_tags.php"); include_once ($config['homedir'] . "/include/functions_tags.php");
function groupview_get_all_data ($id_user = false, $user_strict = false, $acltags, $returnAllGroup = false, $agent_filter = array(), $module_filter = array()) { function groupview_get_all_data ($id_user = false, $user_strict = false, $acltags, $returnAllGroup = false, $agent_filter = array(), $module_filter = array(), $access = 'AR') {
global $config; global $config;
if ($id_user == false) { if ($id_user == false) {
$id_user = $config['id_user']; $id_user = $config['id_user'];
@ -198,7 +198,7 @@ function groupview_get_all_data ($id_user = false, $user_strict = false, $acltag
$list['_monitors_critical_'] = $group_stat[0]["critical"]; $list['_monitors_critical_'] = $group_stat[0]["critical"];
$list['_monitors_unknown_'] = $group_stat[0]["unknown"]; $list['_monitors_unknown_'] = $group_stat[0]["unknown"];
$list['_monitors_not_init_'] = $group_stat[0]["not_init"]; $list['_monitors_not_init_'] = $group_stat[0]["not_init"];
$total_agentes = agents_get_agents (false, array('count(*) as total_agents'), 'AR',false, false); $total_agentes = agents_get_agents (false, array('count(*) as total_agents'), $access,false, false);
$list['_total_agents_'] = $total_agentes[0]['total_agents']; $list['_total_agents_'] = $total_agentes[0]['total_agents'];
$list["_monitor_alerts_fire_count_"] = $group_stat[0]["alerts_fired"]; $list["_monitor_alerts_fire_count_"] = $group_stat[0]["alerts_fired"];
@ -253,18 +253,18 @@ function groupview_get_all_data ($id_user = false, $user_strict = false, $acltag
'disabled' => 0, 'disabled' => 0,
'id_grupo' => $group['id_grupo'], 'id_grupo' => $group['id_grupo'],
'status' => AGENT_STATUS_NOT_INIT), 'status' => AGENT_STATUS_NOT_INIT),
array ('COUNT(*) as total'), 'AR', false); array ('COUNT(*) as total'), $access, false);
$list[$group['id_grupo']]['_agents_not_init_'] = isset ($agent_not_init[0]['total']) ? $agent_not_init[0]['total'] : 0; $list[$group['id_grupo']]['_agents_not_init_'] = isset ($agent_not_init[0]['total']) ? $agent_not_init[0]['total'] : 0;
$agent_unknown = agents_get_agents(array ( $agent_unknown = agents_get_agents(array (
'disabled' => 0, 'disabled' => 0,
'id_grupo' => $group['id_grupo'], 'id_grupo' => $group['id_grupo'],
'status' => AGENT_STATUS_UNKNOWN), 'status' => AGENT_STATUS_UNKNOWN),
array ('COUNT(*) as total'), 'AR', false); array ('COUNT(*) as total'), $access, false);
$list[$group['id_grupo']]['_agents_unknown_'] = isset ($agent_unknown[0]['total']) ? $agent_unknown[0]['total'] : 0; $list[$group['id_grupo']]['_agents_unknown_'] = isset ($agent_unknown[0]['total']) ? $agent_unknown[0]['total'] : 0;
$agent_total = agents_get_agents(array ( $agent_total = agents_get_agents(array (
'disabled' => 0, 'disabled' => 0,
'id_grupo' => $group['id_grupo']), 'id_grupo' => $group['id_grupo']),
array ('COUNT(*) as total'), 'AR', false); array ('COUNT(*) as total'), $access, false);
$list[$group['id_grupo']]['_total_agents_'] = isset ($agent_total[0]['total']) ? $agent_total[0]['total'] : 0; $list[$group['id_grupo']]['_total_agents_'] = isset ($agent_total[0]['total']) ? $agent_total[0]['total'] : 0;
$list[$group['id_grupo']]["_monitor_not_normal_"] = $list[$group['id_grupo']]["_monitor_checks_"] - $list[$group['id_grupo']]["_monitors_ok_"]; $list[$group['id_grupo']]["_monitor_not_normal_"] = $list[$group['id_grupo']]["_monitor_checks_"] - $list[$group['id_grupo']]["_monitors_ok_"];
$list[$group['id_grupo']]['_monitors_alerts_fired_'] = groupview_monitor_fired_alerts ($group['id_grupo'], $user_strict,array($group['id_grupo'])); $list[$group['id_grupo']]['_monitors_alerts_fired_'] = groupview_monitor_fired_alerts ($group['id_grupo'], $user_strict,array($group['id_grupo']));
@ -421,9 +421,9 @@ function groupview_status_modules_agents($id_user = false, $user_strict = false,
return $result_list; return $result_list;
} }
else { else {
$result_list = groupview_get_all_data ($id_user, $user_strict, $result_list = groupview_get_all_data ($id_user, $user_strict,
$acltags); $acltags, false, array(), array(), $access);
return $result_list; return $result_list;
} }
} }
@ -551,20 +551,20 @@ function groupview_get_groups_list($id_user = false, $user_strict = false, $acce
// If using metaconsole, the not strict users will use the metaconsole's agent cache table // If using metaconsole, the not strict users will use the metaconsole's agent cache table
else { else {
$result_list = groupview_get_data ($id_user, $user_strict, $acltags, $result_list = groupview_get_data ($id_user, $user_strict, $acltags,
$returnAllGroup); $returnAllGroup, array(), array(), $access);
return $result_list; return $result_list;
} }
} }
function groupview_get_data ($id_user = false, $user_strict = false, $acltags, $returnAllGroup = false, $agent_filter = array(), $module_filter = array()) { function groupview_get_data ($id_user = false, $user_strict = false, $acltags, $returnAllGroup = false, $agent_filter = array(), $module_filter = array(), $access = 'AR') {
global $config; global $config;
if ($id_user == false) { if ($id_user == false) {
$id_user = $config['id_user']; $id_user = $config['id_user'];
} }
$groups_with_privileges = users_get_groups($id_user); $groups_with_privileges = users_get_groups($id_user, $access);
$groups_with_privileges = implode('","', $groups_with_privileges); $groups_with_privileges = implode('","', $groups_with_privileges);
$user_groups = array(); $user_groups = array();
$user_tags = array(); $user_tags = array();
$groups_without_tags = array(); $groups_without_tags = array();
@ -591,7 +591,7 @@ function groupview_get_data ($id_user = false, $user_strict = false, $acltags, $
else { else {
$user_groups_ids = implode(',', array_keys($acltags)); $user_groups_ids = implode(',', array_keys($acltags));
} }
if (!empty($user_groups_ids)) { if (!empty($user_groups_ids)) {
if (is_metaconsole() && (!$user_strict)) { if (is_metaconsole() && (!$user_strict)) {
switch ($config["dbtype"]) { switch ($config["dbtype"]) {
@ -811,7 +811,7 @@ function groupview_get_data ($id_user = false, $user_strict = false, $acltags, $
$list['_monitors_critical_'] = $group_stat[0]["critical"]; $list['_monitors_critical_'] = $group_stat[0]["critical"];
$list['_monitors_unknown_'] = $group_stat[0]["unknown"]; $list['_monitors_unknown_'] = $group_stat[0]["unknown"];
$list['_monitors_not_init_'] = $group_stat[0]["not_init"]; $list['_monitors_not_init_'] = $group_stat[0]["not_init"];
$total_agentes = agents_get_agents (false, array('count(*) as total_agents'), 'AR',false, false); $total_agentes = agents_get_agents (false, array('count(*) as total_agents'), $access,false, false);
$list['_total_agents_'] = $total_agentes[0]['total_agents']; $list['_total_agents_'] = $total_agentes[0]['total_agents'];
$list["_monitor_alerts_fire_count_"] = $group_stat[0]["alerts_fired"]; $list["_monitor_alerts_fire_count_"] = $group_stat[0]["alerts_fired"];
@ -866,18 +866,18 @@ function groupview_get_data ($id_user = false, $user_strict = false, $acltags, $
'disabled' => 0, 'disabled' => 0,
'id_grupo' => $group['id_grupo'], 'id_grupo' => $group['id_grupo'],
'status' => AGENT_STATUS_NOT_INIT), 'status' => AGENT_STATUS_NOT_INIT),
array ('COUNT(*) as total'), 'AR', false); array ('COUNT(*) as total'), $access, false);
$list[$group['id_grupo']]['_agents_not_init_'] = isset ($agent_not_init[0]['total']) ? $agent_not_init[0]['total'] : 0; $list[$group['id_grupo']]['_agents_not_init_'] = isset ($agent_not_init[0]['total']) ? $agent_not_init[0]['total'] : 0;
$agent_unknown = agents_get_agents(array ( $agent_unknown = agents_get_agents(array (
'disabled' => 0, 'disabled' => 0,
'id_grupo' => $group['id_grupo'], 'id_grupo' => $group['id_grupo'],
'status' => AGENT_STATUS_UNKNOWN), 'status' => AGENT_STATUS_UNKNOWN),
array ('COUNT(*) as total'), 'AR', false); array ('COUNT(*) as total'), $access, false);
$list[$group['id_grupo']]['_agents_unknown_'] = isset ($agent_unknown[0]['total']) ? $agent_unknown[0]['total'] : 0; $list[$group['id_grupo']]['_agents_unknown_'] = isset ($agent_unknown[0]['total']) ? $agent_unknown[0]['total'] : 0;
$agent_total = agents_get_agents(array ( $agent_total = agents_get_agents(array (
'disabled' => 0, 'disabled' => 0,
'id_grupo' => $group['id_grupo']), 'id_grupo' => $group['id_grupo']),
array ('COUNT(*) as total'), 'AR', false); array ('COUNT(*) as total'), $access, false);
$list[$group['id_grupo']]['_total_agents_'] = isset ($agent_total[0]['total']) ? $agent_total[0]['total'] : 0; $list[$group['id_grupo']]['_total_agents_'] = isset ($agent_total[0]['total']) ? $agent_total[0]['total'] : 0;
$list[$group['id_grupo']]["_monitor_not_normal_"] = $list[$group['id_grupo']]["_monitor_checks_"] - $list[$group['id_grupo']]["_monitors_ok_"]; $list[$group['id_grupo']]["_monitor_not_normal_"] = $list[$group['id_grupo']]["_monitor_checks_"] - $list[$group['id_grupo']]["_monitors_ok_"];
$list[$group['id_grupo']]["_monitor_not_normal_"] = $list[$group['id_grupo']]["_monitor_checks_"] - $list[$group['id_grupo']]["_monitors_ok_"]; $list[$group['id_grupo']]["_monitor_not_normal_"] = $list[$group['id_grupo']]["_monitor_checks_"] - $list[$group['id_grupo']]["_monitors_ok_"];

View File

@ -5462,7 +5462,7 @@ function reporting_get_stats_alerts($data, $links = false) {
$table_al->rowclass[] = ''; $table_al->rowclass[] = '';
$table_al->data[] = $tdata; $table_al->data[] = $tdata;
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$output = '<fieldset class="databox tactical_set"> $output = '<fieldset class="databox tactical_set">
<legend>' . <legend>' .
__('Defined and fired alerts') . __('Defined and fired alerts') .

View File

@ -356,7 +356,7 @@ function treeview_printTable($id_agente, $server_data = array(), $no_head = fals
$is_extra = false; $is_extra = false;
} }
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && !$is_extra) { if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config["id_user"], $agent["id_grupo"], "AW") && !$is_extra) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Agent General Information"); "Trying to access Agent General Information");
require_once ("general/noaccess.php"); require_once ("general/noaccess.php");

View File

@ -2116,9 +2116,9 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
$filter = array (); $filter = array ();
if ($returnAllGroup) if ($returnAllGroup)
$groups = users_get_groups ($id_user, 'RR'); $groups = users_get_groups ($id_user, 'VR');
else else
$groups = users_get_groups ($id_user, 'RR', false); $groups = users_get_groups ($id_user, 'VR', false);
if (!empty($groups)) { if (!empty($groups)) {
if (empty($where)) if (empty($where))

View File

@ -179,7 +179,7 @@ function vbar_graph($flash_chart, $chart_data, $width, $height,
if ($flash_chart) { if ($flash_chart) {
return flot_vcolumn_chart ($chart_data, $width, $height, $color, return flot_vcolumn_chart ($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl, $unit, $water_mark_url, $legend, $long_index, $homeurl, $unit, $water_mark_url,
$homedir); $homedir,$font,$font_size);
} }
else { else {
$graph = array(); $graph = array();
@ -263,7 +263,9 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
$backgroundColor, $backgroundColor,
$dashboard, $dashboard,
$vconsole, $vconsole,
$agent_module_id); $agent_module_id,
$font,
$font_size);
} }
else { else {
$graph = array(); $graph = array();
@ -316,6 +318,8 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height,
$legend, $legend,
$long_index, $long_index,
$homeurl, $homeurl,
$font,
$font_size,
$unit, $unit,
$water_mark_url, $water_mark_url,
array(), array(),
@ -378,6 +382,8 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height,
$legend, $legend,
$long_index, $long_index,
$homeurl, $homeurl,
$font,
$font_size,
$unit, $unit,
$water_mark_url, $water_mark_url,
array(), array(),
@ -524,6 +530,8 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
$legend, $legend,
$long_index, $long_index,
$homeurl, $homeurl,
$font,
$font_size,
$unit, $unit,
$water_mark_url, $water_mark_url,
array(), array(),
@ -603,7 +611,7 @@ function hbar_graph($flash_chart, $chart_data, $width, $height,
if ($flash_chart) { if ($flash_chart) {
return flot_hcolumn_chart( return flot_hcolumn_chart(
$chart_data, $width, $height, $water_mark_url); $chart_data, $width, $height, $water_mark_url, $font, $font_size);
} }
else { else {
$graph = array(); $graph = array();

View File

@ -117,9 +117,10 @@ function pandoraFlotPie(graph_id, values, labels, nseries, width, font_size, wat
} }
} }
function pandoraFlotPieCustom(graph_id, values, labels, width, function pandoraFlotPieCustom(graph_id, values, labels, width,
font_size, water_mark, separator, legend_position, height, font_size, font, water_mark, separator, legend_position, height,
colors,legend) { colors,legend) {
font = font.split("/").pop().split(".").shift();
var labels = labels.split(separator); var labels = labels.split(separator);
var legend = legend.split(separator); var legend = legend.split(separator);
var data = values.split(separator); var data = values.split(separator);
@ -189,6 +190,8 @@ function pandoraFlotPieCustom(graph_id, values, labels, width,
legends.each(function () { legends.each(function () {
//$(this).css('width', $(this).width()); //$(this).css('width', $(this).width());
$(this).css('font-size', font_size+'pt'); $(this).css('font-size', font_size+'pt');
$(this).removeClass("legendLabel");
$(this).addClass(font);
$(this).text(legend[j]); $(this).text(legend[j]);
j++; j++;
}); });
@ -259,10 +262,11 @@ function pandoraFlotPieCustom(graph_id, values, labels, width,
} }
function pandoraFlotHBars(graph_id, values, labels, water_mark, function pandoraFlotHBars(graph_id, values, labels, water_mark,
maxvalue, water_mark, separator, separator2) { maxvalue, water_mark, separator, separator2, font, font_size) {
var colors_data = ['#FC4444','#FFA631','#FAD403','#5BB6E5','#F2919D','#80BA27']; var colors_data = ['#FC4444','#FFA631','#FAD403','#5BB6E5','#F2919D','#80BA27'];
values = values.split(separator2); values = values.split(separator2);
font = font.split("/").pop().split(".").shift();
var datas = new Array(); var datas = new Array();
for (i = 0; i < values.length; i++) { for (i = 0; i < values.length; i++) {
var serie = values[i].split(separator); var serie = values[i].split(separator);
@ -309,7 +313,7 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark,
yaxis: { yaxis: {
axisLabelUseCanvas: true, axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12, axisLabelFontSizePixels: 12,
axisLabelFontFamily: 'Verdana, Arial', axisLabelFontFamily: font+'Font',
axisLabelPadding: 3, axisLabelPadding: 3,
ticks: yFormatter, ticks: yFormatter,
tickSize: 1, tickSize: 1,
@ -465,7 +469,7 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark,
title = label; title = label;
label = shortLabel; label = shortLabel;
} }
format.push([i,'<div title="'+title+'" class="legend_'+i+' legend-tooltip">' format.push([i,'<div style=font-size:'+font_size+'pt title="'+title+'" class="'+font+'">'
+ label + label
+ '</div>']); + '</div>']);
} }
@ -543,10 +547,11 @@ function showTooltip(x, y, color, contents) {
}).appendTo("body").fadeIn(200); }).appendTo("body").fadeIn(200);
} }
function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors, water_mark, maxvalue, water_mark, separator, separator2) { function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors, water_mark, maxvalue, water_mark, separator, separator2, font, font_size ) {
values = values.split(separator2); values = values.split(separator2);
legend = legend.split(separator); legend = legend.split(separator);
font = font.split("/").pop().split(".").shift();
labels_long = labels_long.length > 0 ? labels_long.split(separator) : 0; labels_long = labels_long.length > 0 ? labels_long.split(separator) : 0;
colors = colors.length > 0 ? colors.split(separator) : []; colors = colors.length > 0 ? colors.split(separator) : [];
var colors_data = colors.length > 0 var colors_data = colors.length > 0
@ -591,7 +596,7 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
xaxis: { xaxis: {
axisLabelUseCanvas: true, axisLabelUseCanvas: true,
axisLabelFontSizePixels: 7, axisLabelFontSizePixels: 7,
axisLabelFontFamily: 'Verdana, Arial', axisLabelFontFamily: font+'Font',
axisLabelPadding: 0, axisLabelPadding: 0,
ticks: xFormatter, ticks: xFormatter,
labelWidth: 130, labelWidth: 130,
@ -599,7 +604,7 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
yaxis: { yaxis: {
axisLabelUseCanvas: true, axisLabelUseCanvas: true,
axisLabelFontSizePixels: 7, axisLabelFontSizePixels: 7,
axisLabelFontFamily: 'Verdana, Arial', axisLabelFontFamily: font+'Font',
axisLabelPadding: 100, axisLabelPadding: 100,
autoscaleMargin: 0.02, autoscaleMargin: 0.02,
tickFormatter: function (v, axis) { tickFormatter: function (v, axis) {
@ -695,7 +700,7 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
label = shortLabel; label = shortLabel;
} }
format.push([i, format.push([i,
'<div class="legend_'+i+' legend-tooltip" title="'+title+'" style="word-break: break-word; max-width: 110px;">' '<div class="'+font+'" title="'+title+'" style="word-break: break-word; max-width: 110px;font-size:'+font_size+'pt">'
+ label + label
+ '</div>']); + '</div>']);
} }
@ -820,7 +825,7 @@ function pandoraFlotSlicebar(graph_id, values, datacolor, labels, legend, acumul
function pandoraFlotArea(graph_id, values, labels, labels_long, legend, function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
colors, type, serie_types, water_mark, width, max_x, homeurl, unit, colors, type, serie_types, water_mark, width, max_x, homeurl, unit,
font_size, menu, events, event_ids, legend_events, alerts, font_size, font, menu, events, event_ids, legend_events, alerts,
alert_ids, legend_alerts, yellow_threshold, red_threshold, alert_ids, legend_alerts, yellow_threshold, red_threshold,
force_integer, separator, separator2, force_integer, separator, separator2,
yellow_up, red_up, yellow_inverse, red_inverse, yellow_up, red_up, yellow_inverse, red_inverse,
@ -828,6 +833,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
var threshold = true; var threshold = true;
var thresholded = false; var thresholded = false;
font = font.split("/").pop().split(".").shift();
values = values.split(separator2); values = values.split(separator2);
serie_types = serie_types.split(separator); serie_types = serie_types.split(separator);
@ -1713,6 +1719,9 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
$('#legend_' + graph_id + ' .legendLabel') $('#legend_' + graph_id + ' .legendLabel')
.eq(i).css('color','#000'); .eq(i).css('color','#000');
$('#legend_' + graph_id + ' .legendLabel')
.eq(i).css('font-family',font+'Font');
i++; i++;
} }
} }
@ -1816,17 +1825,17 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
if (labels[v] == undefined) { if (labels[v] == undefined) {
return ''; return '';
} }
return '<div style=font-size:'+font_size+'pt>'+labels[v]+'</div>'; return '<div class='+font+' style=font-size:'+font_size+'pt>'+labels[v]+'</div>';
} }
function yFormatter(v, axis) { function yFormatter(v, axis) {
var formatted = number_format(v,force_integer,unit); var formatted = number_format(v,force_integer,unit);
return '<div style=font-size:'+font_size+'pt>'+formatted+'</div>'; return '<div class='+font+' style=font-size:'+font_size+'pt>'+formatted+'</div>';
} }
function lFormatter(v, item) { function lFormatter(v, item) {
return '<div style=color:#000;font-size:'+font_size+'pt>'+v+'</div>'; return '<div class='+font+' style=color:#000;font-size:'+font_size+'pt>'+v+'</div>';
// Prepared to turn series with a checkbox // Prepared to turn series with a checkbox
//return '<div style=color:#000;font-size:'+font_size+'pt><input type="checkbox" id="' + graph_id + '_' + item.id +'" checked="checked" class="check_serie_'+graph_id+'">'+v+'</div>'; //return '<div style=color:#000;font-size:'+font_size+'pt><input type="checkbox" id="' + graph_id + '_' + item.id +'" checked="checked" class="check_serie_'+graph_id+'">'+v+'</div>';
} }
@ -2317,4 +2326,4 @@ function reduceText (text, maxLength) {
if (text.length <= maxLength) return text if (text.length <= maxLength) return text
var firstSlideEnd = parseInt((maxLength - 3) / 2); var firstSlideEnd = parseInt((maxLength - 3) / 2);
return text.substr(0, firstSlideEnd) + '...' + text.substr(-firstSlideEnd - 3); return text.substr(0, firstSlideEnd) + '...' + text.substr(-firstSlideEnd - 3);
} }

View File

@ -150,8 +150,9 @@ function d3_bullet_chart($chart_data, $width, $height, $color, $legend,
$output .= include_javascript_d3(true); $output .= include_javascript_d3(true);
$id_bullet = uniqid(); $id_bullet = uniqid();
$font = array_shift(explode(".",array_pop(explode("/",$font))));
$output .=
$output .=
'<div id="bullet_graph_' . $id_bullet . '" class="bullet" style="overflow: hidden; width: '.$width.'px; margin-left: auto; margin-right: auto;"></div> '<div id="bullet_graph_' . $id_bullet . '" class="bullet" style="overflow: hidden; width: '.$width.'px; margin-left: auto; margin-right: auto;"></div>
<style> <style>
@ -175,8 +176,8 @@ function d3_bullet_chart($chart_data, $width, $height, $color, $legend,
.bullet .measure.s1 { fill: steelblue; } .bullet .measure.s1 { fill: steelblue; }
.bullet .title { font-size: 7pt; font-weight: bold; text-align:left; } .bullet .title { font-size: 7pt; font-weight: bold; text-align:left; }
.bullet .subtitle { fill: #999; font-size: 7pt;} .bullet .subtitle { fill: #999; font-size: 7pt;}
.bullet g text { font-size: 7pt;} .bullet g text { font-size:'.$font_size.'pt;}
</style> </style>
<script src="'. $config['homeurl'] . 'include/graphs/bullet.js"></script> <script src="'. $config['homeurl'] . 'include/graphs/bullet.js"></script>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
@ -229,7 +230,7 @@ function d3_bullet_chart($chart_data, $width, $height, $color, $legend,
.attr("transform", "translate(-10, 15)"); .attr("transform", "translate(-10, 15)");
title.append("text") title.append("text")
.attr("class", "title") .attr("class", "'.$font.'")
.text(function(d) { return d.title; }); .text(function(d) { return d.title; });
title.append("text") title.append("text")
@ -272,7 +273,7 @@ function d3_gauges($chart_data, $width, $height, $color, $legend,
$output .= "<script language=\"javascript\" type=\"text/javascript\"> $output .= "<script language=\"javascript\" type=\"text/javascript\">
var data = $data; var data = $data;
createGauges(data, '$width', '$height','$font_size','$no_data_image'); createGauges(data, '$width', '$height','$font_size','$no_data_image','$font');
</script>"; </script>";
return $output; return $output;

View File

@ -90,7 +90,7 @@ function include_javascript_dependencies_flot_graph($return = false) {
////////// AREA GRAPHS //////// ////////// AREA GRAPHS ////////
/////////////////////////////// ///////////////////////////////
function flot_area_stacked_graph($chart_data, $width, $height, $color, function flot_area_stacked_graph($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $legend, $long_index, $homeurl = '', $font = '', $font_size = 7,$unit = '', $water_mark = '',
$serie_types = array(), $chart_extra_data = array(), $serie_types = array(), $chart_extra_data = array(),
$yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '',
$force_integer = false, $series_suffix_str = '', $menu = true, $force_integer = false, $series_suffix_str = '', $menu = true,
@ -102,7 +102,7 @@ function flot_area_stacked_graph($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl, $unit, 'area_stacked', $legend, $long_index, $homeurl, $unit, 'area_stacked',
$water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold,
$red_threshold, $adapt_key, $force_integer, $series_suffix_str, $red_threshold, $adapt_key, $force_integer, $series_suffix_str,
$menu, $background_color, $dashboard, $vconsole, $agent_module_id); $menu, $background_color, $dashboard, $vconsole, $agent_module_id, $font,$font_size);
} }
function flot_area_simple_graph($chart_data, $width, $height, $color, function flot_area_simple_graph($chart_data, $width, $height, $color,
@ -110,19 +110,19 @@ function flot_area_simple_graph($chart_data, $width, $height, $color,
$serie_types = array(), $chart_extra_data = array(), $serie_types = array(), $chart_extra_data = array(),
$yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '',
$force_integer = false, $series_suffix_str = '', $menu = true, $force_integer = false, $series_suffix_str = '', $menu = true,
$background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0, $font = '',$font_size = 7) {
global $config; global $config;
return flot_area_graph($chart_data, $width, $height, $color, return flot_area_graph($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl, $unit, 'area_simple', $legend, $long_index, $homeurl, $unit, 'area_simple',
$water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold,
$red_threshold, $adapt_key, $force_integer, $series_suffix_str, $red_threshold, $adapt_key, $force_integer, $series_suffix_str,
$menu, $background_color, $dashboard, $vconsole, $agent_module_id); $menu, $background_color, $dashboard, $vconsole, $agent_module_id,$font,$font_size);
} }
function flot_line_stacked_graph($chart_data, $width, $height, $color, function flot_line_stacked_graph($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $legend, $long_index, $homeurl = '',$font = '', $font_size = 7, $unit = '', $water_mark = '',
$serie_types = array(), $chart_extra_data = array(), $serie_types = array(), $chart_extra_data = array(),
$yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '',
$force_integer = false, $series_suffix_str = '', $menu = true, $force_integer = false, $series_suffix_str = '', $menu = true,
@ -134,11 +134,11 @@ function flot_line_stacked_graph($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl, $unit, 'line_stacked', $legend, $long_index, $homeurl, $unit, 'line_stacked',
$water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold,
$red_threshold, $adapt_key, $force_integer, $series_suffix_str, $red_threshold, $adapt_key, $force_integer, $series_suffix_str,
$menu, $background_color, $dashboard, $vconsole, $agent_module_id); $menu, $background_color, $dashboard, $vconsole, $agent_module_id, $font, $font_size);
} }
function flot_line_simple_graph($chart_data, $width, $height, $color, function flot_line_simple_graph($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl = '', $unit = '', $water_mark = '', $legend, $long_index, $homeurl = '', $font = '', $font_size = 7,$unit = '', $water_mark = '',
$serie_types = array(), $chart_extra_data = array(), $serie_types = array(), $chart_extra_data = array(),
$yellow_threshold = 0, $red_threshold = 0, $adapt_key= '', $yellow_threshold = 0, $red_threshold = 0, $adapt_key= '',
$force_integer = false, $series_suffix_str = '', $menu = true, $force_integer = false, $series_suffix_str = '', $menu = true,
@ -150,22 +150,20 @@ function flot_line_simple_graph($chart_data, $width, $height, $color,
$legend, $long_index, $homeurl, $unit, 'line_simple', $legend, $long_index, $homeurl, $unit, 'line_simple',
$water_mark, $serie_types, $chart_extra_data, $yellow_threshold, $water_mark, $serie_types, $chart_extra_data, $yellow_threshold,
$red_threshold, $adapt_key, $force_integer, $series_suffix_str, $red_threshold, $adapt_key, $force_integer, $series_suffix_str,
$menu, $background_color, $dashboard, $vconsole); $menu, $background_color, $dashboard, $vconsole, $agent_module_id, $font, $font_size);
} }
function flot_area_graph($chart_data, $width, $height, $color, $legend, function flot_area_graph($chart_data, $width, $height, $color, $legend,
$long_index, $homeurl, $unit, $type, $water_mark, $serie_types, $long_index, $homeurl, $unit, $type, $water_mark, $serie_types,
$chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key, $chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key,
$force_integer, $series_suffix_str = '', $menu = true, $force_integer, $series_suffix_str = '', $menu = true,
$background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0) { $background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0,$font = '',$font_size = 7) {
global $config; global $config;
include_javascript_dependencies_flot_graph(); include_javascript_dependencies_flot_graph();
$font_size = '7';
$menu = (int)$menu; $menu = (int)$menu;
// Get a unique identifier to graph // Get a unique identifier to graph
@ -430,6 +428,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
"'" . $homeurl . "', \n" . "'" . $homeurl . "', \n" .
"'$unit', \n" . "'$unit', \n" .
"$font_size, \n" . "$font_size, \n" .
"'$font', \n" .
"$menu, \n" . "$menu, \n" .
"'$events', \n" . "'$events', \n" .
"'$event_ids', \n" . "'$event_ids', \n" .
@ -571,7 +570,7 @@ function flot_custom_pie_chart ($flash_charts, $graph_values,
$return .= "<script type='text/javascript'>"; $return .= "<script type='text/javascript'>";
$return .= "pandoraFlotPieCustom('$graph_id', '$values', '$labels', $return .= "pandoraFlotPieCustom('$graph_id', '$values', '$labels',
'$width', $font_size, $water_mark, '$width', $font_size, '$fontpath', $water_mark,
'$separator', '$legend_position', '$height', '$colors','$legend')"; '$separator', '$legend_position', '$height', '$colors','$legend')";
$return .= "</script>"; $return .= "</script>";
@ -580,7 +579,7 @@ function flot_custom_pie_chart ($flash_charts, $graph_values,
} }
// Returns a 3D column chart // Returns a 3D column chart
function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark) { function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark, $font = '', $font_size = 7) {
global $config; global $config;
include_javascript_dependencies_flot_graph(); include_javascript_dependencies_flot_graph();
@ -661,15 +660,15 @@ function flot_hcolumn_chart ($graph_data, $width, $height, $water_mark) {
$return .= "<script type='text/javascript'>"; $return .= "<script type='text/javascript'>";
$return .= "pandoraFlotHBars('$graph_id', '$values', '$labels', $return .= "pandoraFlotHBars('$graph_id', '$values', '$labels',
false, $max, '$water_mark', '$separator', '$separator2')"; false, $max, '$water_mark', '$separator', '$separator2', '$font', $font_size)";
$return .= "</script>"; $return .= "</script>";
return $return; return $return;
} }
// Returns a 3D column chart // Returns a 3D column chart
function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark, $homedir) { function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark, $homedir, $font, $font_size) {
global $config; global $config;
include_javascript_dependencies_flot_graph(); include_javascript_dependencies_flot_graph();
@ -750,9 +749,9 @@ function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $lon
// Javascript code // Javascript code
$return .= "<script type='text/javascript'>"; $return .= "<script type='text/javascript'>";
$return .= "pandoraFlotVBars('$graph_id', '$values', '$labels', '$labels', '$legend', '$colors', false, $max, '$water_mark', '$separator', '$separator2')"; $return .= "pandoraFlotVBars('$graph_id', '$values', '$labels', '$labels', '$legend', '$colors', false, $max, '$water_mark', '$separator', '$separator2','$font',$font_size)";
$return .= "</script>"; $return .= "</script>";
return $return; return $return;

View File

@ -856,7 +856,7 @@ function sunburst (recipient, data, width, height) {
} }
} }
function createGauge(name, etiqueta, value, min, max, min_warning,max_warning,min_critical,max_critical,font_size, height) function createGauge(name, etiqueta, value, min, max, min_warning,max_warning,min_critical,max_critical,font_size, height, font)
{ {
var gauges; var gauges;
@ -888,7 +888,7 @@ function createGauge(name, etiqueta, value, min, max, min_warning,max_warning,mi
config.redZones = [{ from: min_critical, to: max_critical }]; config.redZones = [{ from: min_critical, to: max_critical }];
} }
} }
gauges = new Gauge(name, config); gauges = new Gauge(name, config, font);
gauges.render(); gauges.render();
gauges.redraw(value); gauges.redraw(value);
$(".gauge>text").each(function() { $(".gauge>text").each(function() {
@ -927,7 +927,7 @@ function createGauge(name, etiqueta, value, min, max, min_warning,max_warning,mi
config = false; config = false;
} }
function createGauges(data, width, height, font_size, no_data_image) function createGauges(data, width, height, font_size, no_data_image, font)
{ {
var nombre,label,minimun_warning,maximun_warning,minimun_critical,maximun_critical, var nombre,label,minimun_warning,maximun_warning,minimun_critical,maximun_critical,
mininum,maxinum,valor; mininum,maxinum,valor;
@ -981,16 +981,18 @@ function createGauges(data, width, height, font_size, no_data_image)
valor = (-1200); valor = (-1200);
createGauge(nombre, label, valor, mininum, maxinum, createGauge(nombre, label, valor, mininum, maxinum,
minimun_warning, maximun_warning, minimun_critical, minimun_warning, maximun_warning, minimun_critical,
maximun_critical, font_size, height); maximun_critical, font_size, height, font);
} }
} }
function Gauge(placeholderName, configuration) function Gauge(placeholderName, configuration, font)
{ {
var font = font.split("/").pop().split(".").shift();
this.placeholderName = placeholderName; this.placeholderName = placeholderName;
var self = this; // for internal d3 functions var self = this; // for internal d3 functions
@ -1067,6 +1069,7 @@ function Gauge(placeholderName, configuration)
.attr("y", this.config.cy / 2 + fontSize / 2) .attr("y", this.config.cy / 2 + fontSize / 2)
.attr("dy", fontSize / 2) .attr("dy", fontSize / 2)
.attr("text-anchor", "middle") .attr("text-anchor", "middle")
.attr("class", font)
.text(this.config.label) .text(this.config.label)
.style("font-size", this.config.font_size+"pt") .style("font-size", this.config.font_size+"pt")
.style("fill", "#333") .style("fill", "#333")

File diff suppressed because it is too large Load Diff

View File

@ -3174,6 +3174,13 @@ div#vc-controls img.vc-qr {
margin-left: 8px; margin-left: 8px;
margin-right: 8px; margin-right: 8px;
} }
div.simple_value > span.text > p {
white-space: pre;
}
div.simple_value > a > span.text > p {
white-space: pre;
}
/* Visual map */ /* Visual map */
/* jQuery dialog */ /* jQuery dialog */
@ -3185,4 +3192,125 @@ div#vc-controls img.vc-qr {
/* Image open dialog in group events by agents*/ /* Image open dialog in group events by agents*/
#open_agent_groups { #open_agent_groups {
cursor: pointer; cursor: pointer;
}
/*Font ttf */
@font-face
{
font-family: 'DejaVuSerif-BoldFont';
src: url('../fonts/DejaVuSerif-Bold.ttf') format('truetype');
}
.DejaVuSerif-Bold{
font-family: DejaVuSerif-BoldFont;
}
@font-face
{
font-family: 'DejaVuSerif-BoldItalicFont';
src: url('../fonts/DejaVuSerif-BoldItalic.ttf') format('truetype');
}
.DejaVuSerif-BoldItalic{
font-family: DejaVuSerif-BoldItalicFont;
}
@font-face
{
font-family: 'DejaVuSerif-ItalicFont';
src: url('../fonts/DejaVuSerif-Italic.ttf') format('truetype');
}
.DejaVuSerif-Italic{
font-family: DejaVuSerif-ItalicFont;
}
@font-face
{
font-family: 'DejaVuSerifFont';
src: url('../fonts/DejaVuSerif.ttf') format('truetype');
}
.DejaVuSerif{
font-family: DejaVuSerifFont;
}
@font-face
{
font-family: 'DejaVuSerifCondensed-BoldFont';
src: url('../fonts/DejaVuSerifCondensed-Bold.ttf') format('truetype');
}
.DejaVuSerifCondensed-Bold{
font-family: DejaVuSerifCondensed-BoldFont;
}
@font-face
{
font-family: 'DejaVuSerifCondensed-BoldItalicFont';
src: url('../fonts/DejaVuSerifCondensed-BoldItalic.ttf') format('truetype');
}
.DejaVuSerifCondensed-BoldItalic{
font-family: DejaVuSerifCondensed-BoldItalicFont;
}
@font-face
{
font-family: 'DejaVuSerifCondensed-ItalicFont';
src: url('../fonts/DejaVuSerifCondensed-Italic.ttf') format('truetype');
}
.DejaVuSerifCondensed-Italic{
font-family: DejaVuSerifCondensed-ItalicFont;
}
@font-face
{
font-family: 'DejaVuSerifCondensedFont';
src: url('../fonts/DejaVuSerifCondensed.ttf') format('truetype');
}
.DejaVuSerifCondensed{
font-family: DejaVuSerifCondensedFont;
}
@font-face
{
font-family: 'FreeSansFont';
src: url('../fonts/FreeSans.ttf') format('truetype');
}
.FreeSans{
font-family: FreeSansFont;
}
@font-face
{
font-family: 'FreeSansBoldFont';
src: url('../fonts/FreeSansBold.ttf') format('truetype');
}
.FreeSansBold{
font-family: FreeSansBoldFont;
}
@font-face
{
font-family: 'smallfontFont';
src: url('../fonts/smallfont.ttf') format('truetype');
}
.smallfont{
font-family: smallfontFont;
}
@font-face
{
font-family: 'unicodeFont';
src: url('../fonts/unicode.ttf') format('truetype');
}
.unicode{
font-family: unicodeFont;
} }

View File

@ -71,7 +71,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '6.0SP3'; $version = '6.0SP3';
$build = '160908'; $build = '160912';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -34,7 +34,7 @@ function validateAlert() {
} }
} }
function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby = false, $tag_filter = false,$action_filter = false, $return = false, $strict_user = false) { function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby = false, $tag_filter = false,$action_filter = false, $return = false, $strict_user = false, $access = 'AR') {
global $config; global $config;
require_once ($config['homedir'] . "/include/functions_tags.php"); require_once ($config['homedir'] . "/include/functions_tags.php");
@ -66,7 +66,7 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_st
} }
$table->data[0][0] = __('Group'); $table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups($config['id_user'], "AR", true, "ag_group", $id_group, '', '', '', true, false, false, '', false, '', false, false, 'id_grupo', $strict_user); $table->data[0][1] = html_print_select_groups($config['id_user'], $access, true, "ag_group", $id_group, '', '', '', true, false, false, '', false, '', false, false, 'id_grupo', $strict_user);
$alert_status_filter = array(); $alert_status_filter = array();
$alert_status_filter['all_enabled'] = __('All (Enabled)'); $alert_status_filter['all_enabled'] = __('All (Enabled)');

View File

@ -91,7 +91,7 @@ if ($idAgent != 0) {
$is_extra = false; $is_extra = false;
} }
if (!check_acl ($config["id_user"], $id_group, "AR") && !$is_extra) { if (!check_acl ($config["id_user"], $id_group, "AR") && !check_acl ($config["id_user"], $id_group, "AW") && !$is_extra) {
db_pandora_audit("ACL Violation","Trying to access alert view"); db_pandora_audit("ACL Violation","Trying to access alert view");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
@ -109,7 +109,11 @@ if ($idAgent != 0) {
} }
} }
else { else {
if (!check_acl ($config["id_user"], 0, "AR")) { $agent_a = check_acl ($config['id_user'], 0, "AR");
$agent_w = check_acl ($config['id_user'], 0, "AW");
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
if (!$agent_a && !$agent_w) {
db_pandora_audit("ACL Violation","Trying to access alert view"); db_pandora_audit("ACL Violation","Trying to access alert view");
require ("general/noaccess.php"); require ("general/noaccess.php");
return; return;
@ -118,13 +122,13 @@ else {
$agents = array_keys( $agents = array_keys(
agents_get_group_agents( agents_get_group_agents(
array_keys( array_keys(
users_get_groups($config["id_user"], 'AR', false)))); users_get_groups($config["id_user"], $access, false)), false, 'lower', true));
$idGroup = $id_group; $idGroup = $id_group;
$print_agent = true; $print_agent = true;
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
ui_print_page_header (__('Alert detail'), "images/op_alerts.png", false, "alert_validation"); ui_print_page_header (__('Alert detail'), "images/op_alerts.png", false, "alert_validation");
} }
else { else {
@ -300,7 +304,7 @@ switch ($sortField) {
//Add checks for user ACL //Add checks for user ACL
$groups = users_get_groups($config["id_user"]); $groups = users_get_groups($config["id_user"], $access);
$id_groups = array_keys($groups); $id_groups = array_keys($groups);
if (empty($id_groups)) { if (empty($id_groups)) {
@ -333,7 +337,7 @@ else {
$filter_alert['disabled'] = $filter; $filter_alert['disabled'] = $filter;
} }
if (defined('METACONSOLE')) { if (is_metaconsole()) {
require_once ($config['homedir'] . '/enterprise/meta/include/functions_alerts_meta.php'); require_once ($config['homedir'] . '/enterprise/meta/include/functions_alerts_meta.php');
if ($idAgent != 0) { if ($idAgent != 0) {
$alerts['alerts_simple'] = alerts_meta_get_alerts ($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user); $alerts['alerts_simple'] = alerts_meta_get_alerts ($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user);
@ -357,7 +361,7 @@ else {
} }
else { else {
$id_groups = array_keys( $id_groups = array_keys(
users_get_groups($config["id_user"], 'AR', false)); users_get_groups($config["id_user"], $access, false));
$alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter,$action_filter); $alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter,$action_filter);
@ -379,7 +383,7 @@ if ($free_search != ''){
// Filter form // Filter form
if ($print_agent) { if ($print_agent) {
if(defined('METACONSOLE')) { if(is_metaconsole()) {
ui_toggle( ui_toggle(
printFormFilterAlert($id_group, $filter, $free_search, printFormFilterAlert($id_group, $filter, $free_search,
$url, $filter_standby, $tag_filter, true, $strict_user), $url, $filter_standby, $tag_filter, true, $strict_user),
@ -389,7 +393,7 @@ if ($print_agent) {
ui_toggle( ui_toggle(
printFormFilterAlert($id_group, $filter, $free_search, printFormFilterAlert($id_group, $filter, $free_search,
$url, $filter_standby, $tag_filter, $action_filter, true, $strict_user), $url, $filter_standby, $tag_filter, $action_filter, true, $strict_user),
__('Alert control filter'), __('Toggle filter(s)')); __('Alert control filter'), __('Toggle filter(s)'), $access);
} }
} }
@ -404,7 +408,7 @@ $table->align = array ();
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
if ($print_agent) { if ($print_agent) {
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[0] = "<span title='" . __('Policy') . "'>" . $table->head[0] = "<span title='" . __('Policy') . "'>" .
__('P.') . "</span>"; __('P.') . "</span>";
} }
@ -412,7 +416,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->head[1] = "<span title='" . __('Standby') . "'>" . $table->head[1] = "<span title='" . __('Standby') . "'>" .
__('S.') . "</span>"; __('S.') . "</span>";
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[2] = $table->head[2] =
"<span title='" . __('Force execution') . "'>" . "<span title='" . __('Force execution') . "'>" .
__('F.') . "</span>"; __('F.') . "</span>";
@ -424,7 +428,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->head[6] = __('Action'); $table->head[6] = __('Action');
$table->head[7] = __('Last fired'); $table->head[7] = __('Last fired');
$table->head[8] = __('Status'); $table->head[8] = __('Status');
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->size[8] = '4%'; $table->size[8] = '4%';
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$table->head[9] = __('Validate'); $table->head[9] = __('Validate');
@ -436,7 +440,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->align[8] = 'center'; $table->align[8] = 'center';
// Sort buttons are only for normal console // Sort buttons are only for normal console
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[3] .= ' ' . $table->head[3] .= ' ' .
'<a href="' . $url . '&sort_field=agent&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' . '<a href="' . $url . '&sort_field=agent&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' .
'<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>'; '<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>';
@ -449,13 +453,13 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
} }
} }
else { else {
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[0] = "<span title='" . __('Policy') . "'>" . __('P.') . "</span>"; $table->head[0] = "<span title='" . __('Policy') . "'>" . __('P.') . "</span>";
} }
$table->head[1] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>"; $table->head[1] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[2] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>"; $table->head[2] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
} }
@ -464,7 +468,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->head[5] = __('Action'); $table->head[5] = __('Action');
$table->head[6] = __('Last fired'); $table->head[6] = __('Last fired');
$table->head[7] = __('Status'); $table->head[7] = __('Status');
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->size[7] = '5%'; $table->size[7] = '5%';
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$table->head[8] = __('Validate'); $table->head[8] = __('Validate');
@ -475,7 +479,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->align[7] = 'center'; $table->align[7] = 'center';
// Sort buttons are only for normal console // Sort buttons are only for normal console
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[3] .= ' ' . $table->head[3] .= ' ' .
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' . '<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' .
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>'; '<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
@ -488,7 +492,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
else { else {
if ($print_agent) { if ($print_agent) {
$table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>"; $table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>"; $table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
} }
$table->head[2] = __('Agent'); $table->head[2] = __('Agent');
@ -497,7 +501,7 @@ else {
$table->head[5] = __('Action'); $table->head[5] = __('Action');
$table->head[6] = __('Last fired'); $table->head[6] = __('Last fired');
$table->head[7] = __('Status'); $table->head[7] = __('Status');
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->size[7] = '5%'; $table->size[7] = '5%';
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$table->head[8] = __('Validate'); $table->head[8] = __('Validate');
@ -508,7 +512,7 @@ else {
$table->align[7] = 'center'; $table->align[7] = 'center';
// Sort buttons are only for normal console // Sort buttons are only for normal console
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[2] .= ' ' . $table->head[2] .= ' ' .
'<a href="' . $url . '&sort_field=agent&sort=up">'. html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' . '<a href="' . $url . '&sort_field=agent&sort=up">'. html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' .
'<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>'; '<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>';
@ -522,7 +526,7 @@ else {
} }
else { else {
$table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>"; $table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>"; $table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
} }
$table->head[2] = __('Module'); $table->head[2] = __('Module');
@ -530,7 +534,7 @@ else {
$table->head[4] = __('Action'); $table->head[4] = __('Action');
$table->head[5] = __('Last fired'); $table->head[5] = __('Last fired');
$table->head[6] = __('Status'); $table->head[6] = __('Status');
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->size[6] = '5%'; $table->size[6] = '5%';
if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) {
$table->head[7] = __('Validate'); $table->head[7] = __('Validate');
@ -541,7 +545,7 @@ else {
$table->align[6] = 'center'; $table->align[6] = 'center';
// Sort buttons are only for normal console // Sort buttons are only for normal console
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
$table->head[2] .= ' ' . $table->head[2] .= ' ' .
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' . '<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' .
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>'; '<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
@ -574,7 +578,7 @@ if (!empty ($table->data)) {
'offset_simple'); 'offset_simple');
html_print_table ($table); html_print_table ($table);
if (!defined('METACONSOLE')) { if (!is_metaconsole()) {
if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "LM") ) { if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "LM") ) {
if (count($alerts['alerts_simple']) > 0) { if (count($alerts['alerts_simple']) > 0) {
echo '<div class="action-buttons" style="width: '.$table->width.';">'; echo '<div class="action-buttons" style="width: '.$table->width.';">';
@ -593,12 +597,8 @@ else {
//strict user hidden //strict user hidden
echo '<div id="strict_hidden" style="display:none;">'; echo '<div id="strict_hidden" style="display:none;">';
html_print_input_text('strict_user_hidden', $strict_user); html_print_input_text('strict_user_hidden', $strict_user);
if (defined('METACONSOLE')) {
$is_meta = true; html_print_input_text('is_meta_hidden', (int) is_metaconsole());
} else {
$is_meta = false;
}
html_print_input_text('is_meta_hidden', $is_meta);
echo '</div>'; echo '</div>';
enterprise_hook('close_meta_frame'); enterprise_hook('close_meta_frame');

View File

@ -29,7 +29,7 @@ if ($id_agente === -1) {
return; return;
} }
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR")) { if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Agent General Information"); "Trying to access Agent General Information");
require_once ("general/noaccess.php"); require_once ("general/noaccess.php");

View File

@ -26,7 +26,7 @@ enterprise_include_once('include/functions_config_agents.php');
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "AR")) { if (! check_acl ($config['id_user'], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation", "Trying to access agent main list view"); db_pandora_audit("ACL Violation", "Trying to access agent main list view");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -120,6 +120,9 @@ $recursion = get_parameter('recursion', 0);
$status = (int) get_parameter ('status', -1); $status = (int) get_parameter ('status', -1);
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
$agent_a = (bool) check_acl ($config['id_user'], 0, "AR");
$agent_w = (bool) check_acl ($config['id_user'], 0, "AW");
$access = ($agent_a === true) ? 'AR' : (($agent_w === true) ? 'AW' : 'AR');
$onheader = array(); $onheader = array();
@ -163,8 +166,9 @@ echo '<tr><td style="white-space:nowrap;">';
echo __('Group') . '&nbsp;'; echo __('Group') . '&nbsp;';
$groups = users_get_groups (); $groups = users_get_groups (false, $access);
html_print_select_groups(false, "AR", true, 'group_id', $group_id, 'this.form.submit()', '', '', false, false, true, '', false, 'width:150px');
html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', false, false, true, '', false, 'width:150px');
echo '</td><td style="white-space:nowrap;">'; echo '</td><td style="white-space:nowrap;">';
@ -371,7 +375,7 @@ if ($group_id > 0) {
} }
else { else {
$groups = array(); $groups = array();
$user_groups = users_get_groups($config["id_user"], "AR"); $user_groups = users_get_groups($config["id_user"], $access);
$groups = array_keys($user_groups); $groups = array_keys($user_groups);
} }
@ -403,7 +407,7 @@ if ($strict_user) {
$fields = array ('tagente.id_agente','tagente.id_grupo','tagente.id_os','tagente.ultimo_contacto','tagente.intervalo','tagente.comentarios description','tagente.quiet', $fields = array ('tagente.id_agente','tagente.id_grupo','tagente.id_os','tagente.ultimo_contacto','tagente.intervalo','tagente.comentarios description','tagente.quiet',
'tagente.normal_count','tagente.warning_count','tagente.critical_count','tagente.unknown_count','tagente.notinit_count','tagente.total_count','tagente.fired_count'); 'tagente.normal_count','tagente.warning_count','tagente.critical_count','tagente.unknown_count','tagente.notinit_count','tagente.total_count','tagente.fired_count');
$acltags = tags_get_user_module_and_tags ($config['id_user'], 'AR', $strict_user); $acltags = tags_get_user_module_and_tags ($config['id_user'], $access, $strict_user);
$total_agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $count_filter, $fields, false, $strict_user, true); $total_agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $count_filter, $fields, false, $strict_user, true);
$total_agents = count($total_agents); $total_agents = count($total_agents);
@ -417,7 +421,7 @@ else {
'id_grupo' => $groups, 'id_grupo' => $groups,
'search' => $search_sql, 'search' => $search_sql,
'status' => $status), 'status' => $status),
array ('COUNT(*) as total'), 'AR', false); array ('COUNT(*) as total'), $access, false);
$total_agents = isset ($total_agents[0]['total']) ? $total_agents = isset ($total_agents[0]['total']) ?
$total_agents[0]['total'] : 0; $total_agents[0]['total'] : 0;
@ -444,7 +448,7 @@ else {
'notinit_count', 'notinit_count',
'total_count', 'total_count',
'fired_count'), 'fired_count'),
'AR', $access,
$order); $order);
} }

View File

@ -53,7 +53,7 @@ if ($is_extra === ENTERPRISE_NOT_HOOK) {
$is_extra = false; $is_extra = false;
} }
if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && !$is_extra) { if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && ! check_acl ($config["id_user"], $agent["id_grupo"], "AW") && !$is_extra) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Agent General Information"); "Trying to access Agent General Information");
require_once ("general/noaccess.php"); require_once ("general/noaccess.php");

View File

@ -442,11 +442,10 @@ function print_form_filter_monitors($id_agent, $status_filter_monitor = -1,
$table->data[0][3] = html_print_input_text('status_text_monitor', $status_text_monitor, '', 30, 100, true); $table->data[0][3] = html_print_input_text('status_text_monitor', $status_text_monitor, '', 30, 100, true);
$table->data[0][4] = __('Module group'); $table->data[0][4] = __('Module group');
$rows = db_get_all_rows_sql("SELECT * $rows = db_get_all_rows_sql("SELECT * FROM tmodule_group where id_mg in (SELECT id_module_group from tagente_modulo where id_agente = $id_agent ) ORDER BY name");
FROM tmodule_group where id_mg in (SELECT id_module_group from tagente_modulo where id_agente = $id_agent ) ORDER BY name");
$rows_select[-1] = __('All');
if (!empty($rows)) { if (!empty($rows)) {
$rows_select[-1] = __('All');
foreach ($rows as $module_group) foreach ($rows as $module_group)
$rows_select[$module_group['id_mg']] = __($module_group['name']); $rows_select[$module_group['id_mg']] = __($module_group['name']);
} }

View File

@ -18,7 +18,7 @@ global $config;
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "AR") && ! is_user_admin ($config['id_user'])) { if (! check_acl ($config['id_user'], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW") && ! is_user_admin ($config['id_user'])) {
db_pandora_audit("ACL Violation", "Trying to access GIS Agent view"); db_pandora_audit("ACL Violation", "Trying to access GIS Agent view");
require ("general/noaccess.php"); require ("general/noaccess.php");
return; return;

View File

@ -19,7 +19,7 @@ global $config;
require_once ("include/functions_agents.php"); require_once ("include/functions_agents.php");
require_once ("include/functions_custom_graphs.php"); require_once ("include/functions_custom_graphs.php");
if (! check_acl ($config['id_user'], $id_grupo, "AR")) { if (! check_acl ($config['id_user'], $id_grupo, "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access (read) to agent ".agents_get_name($id_agente)); "Trying to access (read) to agent ".agents_get_name($id_agente));
include ("general/noaccess.php"); include ("general/noaccess.php");

View File

@ -21,7 +21,10 @@ require_once ("include/functions_groupview.php");
check_login (); check_login ();
// ACL Check // ACL Check
if (! check_acl ($config['id_user'], 0, "AR")) { $agent_a = check_acl ($config['id_user'], 0, "AR");
$agent_w = check_acl ($config['id_user'], 0, "AW");
if (!$agent_a && !$agent_w) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Agent view (Grouped)"); "Trying to access Agent view (Grouped)");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -67,7 +70,7 @@ ui_print_page_header (__("Group view"), "images/group.png", false, "", false, $u
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
$all_data = groupview_status_modules_agents ($config['id_user'], $strict_user, 'AR', $strict_user); $all_data = groupview_status_modules_agents ($config['id_user'], $strict_user, ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR'), $strict_user);
$total_agentes = 0; $total_agentes = 0;
$monitor_ok = 0; $monitor_ok = 0;
@ -130,7 +133,7 @@ echo "</table>";
//Groups and tags //Groups and tags
$result_groups = groupview_get_groups_list($config['id_user'], $strict_user, $result_groups = groupview_get_groups_list($config['id_user'], $strict_user,
'AR', true, true); ($agent_a == true) ? 'AR' : ($agent_w == true) ? 'AW' : 'AR', true, true);
$count = count($result_groups); $count = count($result_groups);

View File

@ -25,7 +25,7 @@ require_once ($config["homedir"] . '/include/functions_graph.php');
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "AR")) { if (! check_acl ($config['id_user'], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Agent view (Grouped)"); "Trying to access Agent view (Grouped)");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -182,7 +182,7 @@ echo '<td style="vertical-align: top; width: 75%; padding-top: 0px;" id="rightco
// Last events information // Last events information
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
$acltags = tags_get_user_module_and_tags ($config['id_user'], $access = 'ER', $user_strict); $acltags = tags_get_user_module_and_tags ($config['id_user'], 'ER', $user_strict);
if (!empty($acltags)) { if (!empty($acltags)) {
$tags_condition = tags_get_acl_tags_event_condition($acltags, false, $user_strict); $tags_condition = tags_get_acl_tags_event_condition($acltags, false, $user_strict);

View File

@ -744,7 +744,9 @@ $id_agente = (int) get_parameter ("id_agente", 0);
if (empty ($id_agente)) { if (empty ($id_agente)) {
return; return;
} }
$agent_a = check_acl ($config['id_user'], 0, "AR");
$agent_w = check_acl ($config['id_user'], 0, "AW");
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
$agent = db_get_row ('tagente', 'id_agente', $id_agente); $agent = db_get_row ('tagente', 'id_agente', $id_agente);
// get group for this id_agente // get group for this id_agente
$id_grupo = $agent['id_grupo']; $id_grupo = $agent['id_grupo'];
@ -755,7 +757,7 @@ if ($is_extra === ENTERPRISE_NOT_HOOK) {
$is_extra = false; $is_extra = false;
} }
if (! check_acl ($config['id_user'], $id_grupo, "AR", $id_agente) && !$is_extra) { if (! check_acl ($config['id_user'], $id_grupo, "AR", $id_agente) && ! check_acl ($config['id_user'], $id_grupo, "AW", $id_agente) && !$is_extra) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access (read) to agent ".agents_get_name($id_agente)); "Trying to access (read) to agent ".agents_get_name($id_agente));
include ("general/noaccess.php"); include ("general/noaccess.php");

View File

@ -23,7 +23,7 @@ require_once ($config["homedir"] . '/include/functions_graph.php');
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "ER")) { if (! check_acl ($config['id_user'], 0, "ER") && ! check_acl ($config['id_user'], 0, "EW") && ! check_acl ($config['id_user'], 0, "EM")) {
db_pandora_audit("ACL Violation","Trying to access event viewer"); db_pandora_audit("ACL Violation","Trying to access event viewer");
require ("general/noaccess.php"); require ("general/noaccess.php");
return; return;

View File

@ -13,7 +13,13 @@
// 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.
$groups = users_get_groups($id_user, 'ER'); if (check_acl ($id_user, 0, "ER"))
$groups = users_get_groups($id_user, 'ER');
elseif (check_acl ($id_user, 0, "EW"))
$groups = users_get_groups($id_user, 'EW');
elseif (check_acl ($id_user, 0, "EM"))
$groups = users_get_groups($id_user, 'EM');
$propagate = db_get_value('propagate','tgrupo','id_grupo',$id_group); $propagate = db_get_value('propagate','tgrupo','id_grupo',$id_group);
@ -208,9 +214,15 @@ if ($id_group > 0 && in_array ($id_group, array_keys ($groups))) {
else { else {
$group_array = array_keys($groups); $group_array = array_keys($groups);
} }
if (check_acl ($id_user, 0, "ER"))
$tags_acls_condition = tags_get_acl_tags($id_user, $group_array, 'ER', $tags_acls_condition = tags_get_acl_tags($id_user, $group_array, 'ER',
'event_condition', 'AND', '', $meta, array(), true); //FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)" 'event_condition', 'AND', '', $meta, array(), true); //FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)"
elseif (check_acl ($id_user, 0, "EW"))
$tags_acls_condition = tags_get_acl_tags($id_user, $group_array, 'EW',
'event_condition', 'AND', '', $meta, array(), true); //FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)"
elseif (check_acl ($id_user, 0, "EM"))
$tags_acls_condition = tags_get_acl_tags($id_user, $group_array, 'EM',
'event_condition', 'AND', '', $meta, array(), true); //FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)"
if (($tags_acls_condition != ERR_WRONG_PARAMETERS) && ($tags_acls_condition != ERR_ACL)&& ($tags_acls_condition != -110000)) { if (($tags_acls_condition != ERR_WRONG_PARAMETERS) && ($tags_acls_condition != ERR_ACL)&& ($tags_acls_condition != -110000)) {
$sql_post .= $tags_acls_condition; $sql_post .= $tags_acls_condition;

View File

@ -27,7 +27,7 @@ check_login ();
if (! check_acl ($config["id_user"], 0, "ER")) { if (! check_acl ($config["id_user"], 0, "ER") && ! check_acl ($config["id_user"], 0, "EW") && ! check_acl ($config["id_user"], 0, "EM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access event viewer"); "Trying to access event viewer");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -345,7 +345,7 @@ if ($config["pure"] == 0 || $meta) {
$sound_event['text'] = '<a href="javascript: openSoundEventWindow();">' . html_print_image('images/sound.png', true, array('title' => __('Sound events'))) . '</a>'; $sound_event['text'] = '<a href="javascript: openSoundEventWindow();">' . html_print_image('images/sound.png', true, array('title' => __('Sound events'))) . '</a>';
// If the user has administrator permission display manage tab // If the user has administrator permission display manage tab
if (check_acl ($config["id_user"], 0, "EW")) { if (check_acl ($config["id_user"], 0, "EW") || check_acl ($config["id_user"], 0, "EM")) {
// Manage events // Manage events
$manage_events['active'] = false; $manage_events['active'] = false;
$manage_events['text'] = '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=filter&amp;pure='.$config['pure'].'">' . $manage_events['text'] = '<a href="index.php?sec=eventos&sec2=godmode/events/events&amp;section=filter&amp;pure='.$config['pure'].'">' .

View File

@ -28,7 +28,12 @@ require_once ($config["homedir"] . "/include/functions_tags.php");
check_login (); check_login ();
if (! check_acl ($config["id_user"], 0, "ER")) { $event_a = check_acl ($config['id_user'], 0, "ER");
$event_w = check_acl ($config['id_user'], 0, "EW");
$event_m = check_acl ($config['id_user'], 0, "EM");
$access = ($event_a == true) ? 'ER' : (($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'ER'));
if (!$event_a && !$event_w && !$event_m) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access event viewer"); "Trying to access event viewer");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -139,7 +144,7 @@ if (is_ajax()) {
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
// Get the tags where the user have permissions in Events reading tasks // Get the tags where the user have permissions in Events reading tasks
$tags = tags_get_user_tags($config['id_user'], 'ER'); $tags = tags_get_user_tags($config['id_user'], $access);
if ($id_agent == 0 && !empty($text_agent)) { if ($id_agent == 0 && !empty($text_agent)) {
@ -191,14 +196,13 @@ if (check_acl ($config["id_user"], 0, "EW") || check_acl ($config["id_user"], 0,
$table->cellspacing = 4; $table->cellspacing = 4;
$table->cellpadding = 4; $table->cellpadding = 4;
$table->class = 'databox'; $table->class = 'databox';
if (defined('METACONSOLE')) { if (is_metaconsole()) {
$table->width = '100%';
$table->class = 'databox filters'; $table->class = 'databox filters';
$table->cellspacing = 0; $table->cellspacing = 0;
$table->cellpadding = 0; $table->cellpadding = 0;
} }
$table->styleTable = 'font-weight: bold; text-align:left;'; $table->styleTable = 'font-weight: bold; text-align:left;';
if (!defined("METACONSOLE")) if (!is_metaconsole())
$table->style[0] = 'width: 50%; width:50%;'; $table->style[0] = 'width: 50%; width:50%;';
$data = array(); $data = array();
@ -212,12 +216,12 @@ if (check_acl ($config["id_user"], 0, "EW") || check_acl ($config["id_user"], 0,
$table->rowid[1] = 'save_filter_row1'; $table->rowid[1] = 'save_filter_row1';
$data[0] = __('Filter name') . $jump; $data[0] = __('Filter name') . $jump;
$data[0] .= html_print_input_text ('id_name', '', '', 15, 255, true); $data[0] .= html_print_input_text ('id_name', '', '', 15, 255, true);
if(defined('METACONSOLE')) if(is_metaconsole())
$data[1] = __('Save in Group') . $jump; $data[1] = __('Save in Group') . $jump;
else else
$data[1] = __('Filter group') . $jump; $data[1] = __('Filter group') . $jump;
# Fix : Only admin users can see group ALL # Fix : Only admin users can see group ALL
$data[1] .= html_print_select_groups($config['id_user'], "ER", users_can_manage_group_all(), "id_group_filter", $data[1] .= html_print_select_groups($config['id_user'], $access, users_can_manage_group_all(), "id_group_filter",
$id_group_filter, '', '', 0, true, false, false, 'w130', false, '', false, false, 'id_grupo', $strict_user); $id_group_filter, '', '', 0, true, false, false, 'w130', false, '', false, false, 'id_grupo', $strict_user);
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
@ -255,15 +259,14 @@ $table->width = '100%';
$table->cellspacing = 4; $table->cellspacing = 4;
$table->cellpadding = 4; $table->cellpadding = 4;
$table->class = 'databox'; $table->class = 'databox';
if (defined('METACONSOLE')) { if (is_metaconsole()) {
$table->width = '100%';
$table->cellspacing = 0; $table->cellspacing = 0;
$table->cellpadding = 0; $table->cellpadding = 0;
$table->class = 'databox filters'; $table->class = 'databox filters';
} }
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;'; $table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
if (!defined("METACONSOLE")) if (!is_metaconsole())
$table->style[0] = 'width: 50%; width:50%;'; $table->style[0] = 'width: 50%; width:50%;';
$data = array(); $data = array();
$table->rowid[3] = 'update_filter_row1'; $table->rowid[3] = 'update_filter_row1';
@ -311,11 +314,9 @@ $tabletags_with->cellpadding = 4;
$tabletags_with->class = 'noshadow'; $tabletags_with->class = 'noshadow';
$tabletags_with->styleTable = 'border: 0px;'; $tabletags_with->styleTable = 'border: 0px;';
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$tabletags_with->width = '100%';
$tabletags_with->class = 'nobady'; $tabletags_with->class = 'nobady';
$tabletags_with->cellspacing = 0; $tabletags_with->cellspacing = 0;
$tabletags_with->cellpadding = 0; $tabletags_with->cellpadding = 0;
$tabletags_with->styleTable = 'border: 0px;';
} }
@ -342,7 +343,6 @@ $tabletags_without->cellspacing = 4;
$tabletags_without->cellpadding = 4; $tabletags_without->cellpadding = 4;
$tabletags_without->class = 'noshadow'; $tabletags_without->class = 'noshadow';
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
$tabletags_without->width = '100%';
$tabletags_without->class = 'nobady'; $tabletags_without->class = 'nobady';
$tabletags_without->cellspacing = 0; $tabletags_without->cellspacing = 0;
$tabletags_without->cellpadding = 0; $tabletags_without->cellpadding = 0;
@ -365,7 +365,7 @@ $tabletags_without->rowclass[] = '';
// EVENTS FILTER // EVENTS FILTER
// Table for filter controls // Table for filter controls
if (defined('METACONSOLE')) { if (is_metaconsole()) {
$events_filter = '<form id="form_filter" class="filters_form" method="post" action="index.php?sec=eventos&amp;sec2=operation/events/events&amp;refr='. $events_filter = '<form id="form_filter" class="filters_form" method="post" action="index.php?sec=eventos&amp;sec2=operation/events/events&amp;refr='.
(int)get_parameter("refr", 0) .'&amp;pure='.$config["pure"].'&amp;section=' . $section . '&amp;history='.(int)$history.'">'; (int)get_parameter("refr", 0) .'&amp;pure='.$config["pure"].'&amp;section=' . $section . '&amp;history='.(int)$history.'">';
} }
@ -426,8 +426,9 @@ $data[0] = __('User ack.') . $jump;
if ($strict_user) { if ($strict_user) {
$user_users = array($config['id_user']=>$config['id_user']); $user_users = array($config['id_user']=>$config['id_user']);
} else { }
$user_users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all()); else {
$user_users = users_get_user_users($config['id_user'], $access, users_can_manage_group_all());
} }
$data[0] .= html_print_select($user_users, "id_user_ack", $id_user_ack, '', $data[0] .= html_print_select($user_users, "id_user_ack", $id_user_ack, '',
@ -467,7 +468,7 @@ $table_advanced->rowclass[] = '';
$data = array(); $data = array();
$data[0] = __('Date from') . $jump; $data[0] = __('Date from') . $jump;
$user_users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all()); //~ $user_users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all());
$data[0] .= html_print_input_text ('date_from', $date_from, '', 15, 10, true); $data[0] .= html_print_input_text ('date_from', $date_from, '', 15, 10, true);
@ -528,9 +529,8 @@ $table->data = array();
$data = array(); $data = array();
$data[0] = __('Group') . $jump; $data[0] = __('Group') . $jump;
$data[0] .= html_print_select_groups($config["id_user"], "ER", true, $data[0] .= html_print_select_groups($config["id_user"], $access, true,
'id_group', $id_group, '', '', 0, true, false, false, 'w130', false, false, false, false, 'id_grupo', $strict_user). $jump; 'id_group', $id_group, '', '', 0, true, false, false, 'w130', false, false, false, false, 'id_grupo', $strict_user). $jump;
//********************************************************************** //**********************************************************************
// TODO // TODO
// This code is disabled for to enabled in Pandora 5.1 // This code is disabled for to enabled in Pandora 5.1
@ -582,7 +582,7 @@ $table->rowclass[] = '';
$data = array(); $data = array();
$data[0] = '<div style="width:100%; text-align:left">'; $data[0] = '<div style="width:100%; text-align:left">';
if (check_acl ($config["id_user"], 0, "EW")) { if ($event_w || $event_m) {
$data[0] .= '<a href="javascript:" onclick="show_save_filter_dialog();">' . $data[0] .= '<a href="javascript:" onclick="show_save_filter_dialog();">' .
html_print_image("images/disk.png", true, array("border" => '0', "title" => __('Save filter'), "alt" => __('Save filter'))) . '</a> &nbsp;'; html_print_image("images/disk.png", true, array("border" => '0', "title" => __('Save filter'), "alt" => __('Save filter'))) . '</a> &nbsp;';
} }
@ -624,7 +624,7 @@ $events_filter .= $botom_update;
$events_filter .= "</form>"; //This is the filter div $events_filter .= "</form>"; //This is the filter div
if (defined('METACONSOLE')) if (is_metaconsole())
ui_toggle($events_filter, __("Show Options")); ui_toggle($events_filter, __("Show Options"));
else else
ui_toggle($events_filter, __('Event control filter'), '', !$open_filter); ui_toggle($events_filter, __('Event control filter'), '', !$open_filter);
@ -782,7 +782,7 @@ if (!empty($result)) {
if (!empty($result)) { if (!empty($result)) {
//~ Checking the event tags exactly. The event query filters approximated tags to keep events //~ Checking the event tags exactly. The event query filters approximated tags to keep events
//~ with several tags //~ with several tags
$acltags = tags_get_user_module_and_tags ($config['id_user'],'ER', true); $acltags = tags_get_user_module_and_tags ($config['id_user'], $access, true);
foreach ($result as $key=>$event_data) { foreach ($result as $key=>$event_data) {
$has_tags = events_checks_event_tags($event_data, $acltags); $has_tags = events_checks_event_tags($event_data, $acltags);

View File

@ -40,6 +40,11 @@ $config["id_user"] = $_SESSION["id_usuario"];
// Session locking concurrency speedup! // Session locking concurrency speedup!
check_login (); check_login ();
$event_a = check_acl ($config['id_user'], 0, "ER");
$event_w = check_acl ($config['id_user'], 0, "EW");
$event_m = check_acl ($config['id_user'], 0, "EM");
$access = ($event_a == true) ? 'ER' : (($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'ER'));
if (!isInACL($_SERVER['REMOTE_ADDR'])) { if (!isInACL($_SERVER['REMOTE_ADDR'])) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access marquee without ACL Access"); "Trying to access marquee without ACL Access");
@ -47,7 +52,8 @@ if (!isInACL($_SERVER['REMOTE_ADDR'])) {
exit; exit;
} }
$groups = users_get_groups ($config["id_user"], "ER"); $groups = users_get_groups ($config["id_user"], $access);
//Otherwise select all groups the user has rights to. //Otherwise select all groups the user has rights to.
if (!empty($groups)) { if (!empty($groups)) {
$sql_group_filter = " AND id_grupo IN (".implode (",", array_keys ($groups)).")"; $sql_group_filter = " AND id_grupo IN (".implode (",", array_keys ($groups)).")";

View File

@ -137,10 +137,10 @@ require('events.build_query.php');
// Now $sql_post have all the where condition // Now $sql_post have all the where condition
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
$sql = "SELECT * $sql = 'SELECT *
FROM tevento FROM tevento
WHERE 1=1 " . $sql_post . " WHERE 1=1 ' . $sql_post . '
ORDER BY utimestamp DESC"; ORDER BY utimestamp DESC';
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql);

View File

@ -27,7 +27,7 @@ session_write_close ();
$config["id_user"] = $_SESSION["id_usuario"]; $config["id_user"] = $_SESSION["id_usuario"];
if (! check_acl ($config["id_user"], 0, "ER") && ! check_acl ($config["id_user"], 0, "EW")) { if (! check_acl ($config["id_user"], 0, "ER") && ! check_acl ($config["id_user"], 0, "EW") && ! check_acl ($config["id_user"], 0, "EM")) {
exit; exit;
} }
@ -105,7 +105,8 @@ echo chr (13);
$new = true; $new = true;
while ($event = db_get_all_row_by_steps_sql($new, $result, $sql)) { while ($event = db_get_all_row_by_steps_sql($new, $result, $sql)) {
$new = false; $new = false;
if (!check_acl($config["id_user"], $event["id_grupo"], "ER") || if ((!check_acl($config["id_user"], $event["id_grupo"], "ER") &&
!check_acl($config["id_user"], $event["id_grupo"], "EW") && !check_acl($config["id_user"], $event["id_grupo"], "EM") ) ||
(!check_acl($config["id_user"], 0, "PM") && $event["event_type"] == 'system')) (!check_acl($config["id_user"], 0, "PM") && $event["event_type"] == 'system'))
continue; continue;

View File

@ -32,7 +32,12 @@ global $config;
check_login (); check_login ();
$config["id_user"] = $_SESSION["id_usuario"]; $config["id_user"] = $_SESSION["id_usuario"];
if (! check_acl ($config['id_user'], 0, "ER")) { $event_a = check_acl ($config['id_user'], 0, "ER");
$event_w = check_acl ($config['id_user'], 0, "EW");
$event_m = check_acl ($config['id_user'], 0, "EM");
$access = ($event_a == true) ? 'ER' : (($event_w == true) ? 'EW' : (($event_m == true) ? 'EM' : 'ER'));
if (! check_acl ($config['id_user'], 0, "ER") && ! check_acl ($config['id_user'], 0, "EW") && ! check_acl ($config['id_user'], 0, "EM")) {
db_pandora_audit("ACL Violation","Trying to access event viewer"); db_pandora_audit("ACL Violation","Trying to access event viewer");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -69,7 +74,7 @@ $table->size[1] = '90%';
$table->style[0] = 'font-weight: bold; vertical-align: top;'; $table->style[0] = 'font-weight: bold; vertical-align: top;';
$table->data[0][0] = __('Group'); $table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(false, "ER", true, 'group', '', 'changeGroup();', '', 0, true); $table->data[0][1] = html_print_select_groups(false, $access, true, 'group', '', 'changeGroup();', '', 0, true);
$table->data[1][0] = __('Type'); $table->data[1][0] = __('Type');
$table->data[1][1] = html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();') . __('Alert fired') . '<br />' . $table->data[1][1] = html_print_checkbox('alert_fired', 'alert_fired', true, true, false, 'changeType();') . __('Alert fired') . '<br />' .
html_print_checkbox('critical', 'critical', true, true, false, 'changeType();') . __('Monitor critical') . '<br />' . html_print_checkbox('critical', 'critical', true, true, false, 'changeType();') . __('Monitor critical') . '<br />' .

View File

@ -32,13 +32,13 @@ ui_print_page_header(__('GIS Maps'), "images/op_gis.png", false,
"configure_gis_map", false, $buttons); "configure_gis_map", false, $buttons);
$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, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "MM"))
$display_default_column = true; $display_default_column = true;
else else
$display_default_column = false; $display_default_column = false;
$edit_gis_maps = false; $edit_gis_maps = false;
if (check_acl ($config['id_user'], 0, "IW")) { if (check_acl ($config['id_user'], 0, "MW") || check_acl ($config['id_user'], 0, "MM")) {
$edit_gis_maps = true; $edit_gis_maps = true;
} }
@ -128,7 +128,9 @@ $iterator = 0;
if ($maps !== false) { if ($maps !== false) {
foreach ($maps as $map) { foreach ($maps as $map) {
if (!check_acl ($config["id_user"], $map["group_id"], "IR", 0, true)) { if (!check_acl ($config["id_user"], $map["group_id"], "MR") &&
!check_acl ($config["id_user"], $map["group_id"], "MW") &&
!check_acl ($config["id_user"], $map["group_id"], "MM")) {
continue; continue;
} }

View File

@ -29,7 +29,7 @@ $show_history = get_parameter ('show_history', 'n');
$map = db_get_row ('tgis_map', 'id_tgis_map', $idMap); $map = db_get_row ('tgis_map', 'id_tgis_map', $idMap);
$confMap = gis_get_map_conf($idMap); $confMap = gis_get_map_conf($idMap);
if (! check_acl ($config['id_user'], $map['group_id'], "IR")) { if (! check_acl ($config['id_user'], $map['group_id'], "MR") && ! check_acl ($config['id_user'], $map['group_id'], "MW") && ! check_acl ($config['id_user'], $map['group_id'], "MM")) {
db_pandora_audit("ACL Violation", "Trying to access map builder"); db_pandora_audit("ACL Violation", "Trying to access map builder");
require ("general/noaccess.php"); require ("general/noaccess.php");
return; return;
@ -103,7 +103,7 @@ else {
html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode'))) . "</a>"; html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode'))) . "</a>";
} }
if (check_acl ($config["id_user"], $map['group_id'], "IW")) { if (check_acl ($config["id_user"], $map['group_id'], "MW") || check_acl ($config["id_user"], $map['group_id'], "MM")) {
$buttons['setup']['text'] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='. $idMap.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>'; $buttons['setup']['text'] = '<a href="index.php?sec=godgismaps&sec2=godmode/gis_maps/configure_gis_map&action=edit_map&map_id='. $idMap.'">'.html_print_image ("images/setup.png", true, array ("title" => __('Setup'))).'</a>';
$buttons['setup']['godmode'] = 1; $buttons['setup']['godmode'] = 1;
@ -146,7 +146,7 @@ ui_print_page_header(__('Map') . " &raquo; " . __('Map') . "&nbsp;" . $map['map_
"images/op_gis.png", false, "", false, $buttons); "images/op_gis.png", false, "", false, $buttons);
if ($config["pure"] == 0) { if ($config["pure"] == 0) {
echo "<div id='map' style='width: 99%; height: 500px; border: 1px solid black;' ></div>"; echo "<div id='map' style='width: 100%; height: 500px; border: 1px solid black;' ></div>";
} }
else { else {
echo "<div id='map' style='position:absolute; top:40px; z-index:100; width: 100%; height: 500px; min-height:500px; border: 1px solid black;' ></div>"; echo "<div id='map' style='position:absolute; top:40px; z-index:100; width: 100%; height: 500px; min-height:500px; border: 1px solid black;' ></div>";

View File

@ -18,7 +18,12 @@ require_once ("include/functions_incidents.php");
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "IR")) { $incident_r = check_acl ($config['id_user'], 0, "IR");
$incident_w = check_acl ($config['id_user'], 0, "IW");
$incident_m = check_acl ($config['id_user'], 0, "IM");
$access = ($incident_r == true) ? 'IR' : (($incident_w == true) ? 'IW' : (($incident_m == true) ? 'IM' : 'IR'));
if (!$incident_r && !$incident_w && !$incident_m) {
db_pandora_audit("ACL Violation","Trying to access incident viewer"); db_pandora_audit("ACL Violation","Trying to access incident viewer");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
@ -178,7 +183,7 @@ if ($agent_search != 0) {
} }
$offset = (int) get_parameter ("offset", 0); $offset = (int) get_parameter ("offset", 0);
$groups = users_get_groups ($config["id_user"], "IR"); $groups = users_get_groups ($config["id_user"], $access);
//Select incidencts where the user has access to ($groups from //Select incidencts where the user has access to ($groups from
//get_user_groups), array_keys for the id, implode to pass to SQL //get_user_groups), array_keys for the id, implode to pass to SQL
@ -277,7 +282,7 @@ if ($count_total >= 1) {
echo '</td></tr><tr><td colspan=3>'; echo '</td></tr><tr><td colspan=3>';
echo "<b>" . __("Groups:") . "</b>" . '&nbsp;&nbsp;'; echo "<b>" . __("Groups:") . "</b>" . '&nbsp;&nbsp;';
html_print_select_groups($config["id_user"], "IR", true, "grupo", $grupo, 'javascript:this.form.submit();', '', '',false,false,false,'w155'); html_print_select_groups($config["id_user"], $access, true, "grupo", $grupo, 'javascript:this.form.submit();', '', '',false,false,false,'w155');
//echo "&nbsp;&nbsp;&nbsp;&nbsp;"; //echo "&nbsp;&nbsp;&nbsp;&nbsp;";
echo '</td></tr><tr><td colspan=3>'; echo '</td></tr><tr><td colspan=3>';
@ -390,7 +395,7 @@ else {
echo '<form method="post" action="'.$url.'&amp;action=mass" style="margin-bottom: 0px;">'; echo '<form method="post" action="'.$url.'&amp;action=mass" style="margin-bottom: 0px;">';
html_print_table ($table); html_print_table ($table);
echo '<div style="text-align:right; float:right;">'; echo '<div style="text-align:right; float:right;">';
if (check_acl ($config["id_user"], 0, "IW")) { if (check_acl ($config["id_user"], 0, "IW") || check_acl ($config["id_user"], 0, "IM")) {
html_print_submit_button (__('Delete incidents'), 'delete_btn', false, 'class="sub delete" style="margin-right: 5px;"'); html_print_submit_button (__('Delete incidents'), 'delete_btn', false, 'class="sub delete" style="margin-right: 5px;"');
} }
@ -400,7 +405,7 @@ else {
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';
unset ($table); unset ($table);
if (check_acl ($config["id_user"], 0, "IW")) { if (check_acl ($config["id_user"], 0, "IW") || check_acl ($config["id_user"], 0, "IM")) {
echo '<div style="text-align:right; float:right; padding-right: 5px;">'; echo '<div style="text-align:right; float:right; padding-right: 5px;">';
echo '<form method="post" action="index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form=1">'; echo '<form method="post" action="index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form=1">';
html_print_submit_button (__('Create incident'), 'crt', false, 'class="sub next"'); html_print_submit_button (__('Create incident'), 'crt', false, 'class="sub next"');

View File

@ -21,7 +21,7 @@ require_once ("include/functions_events.php"); //To get events group information
check_login (); check_login ();
if (! check_acl ($config["id_user"], 0, "IR")) { if (! check_acl ($config["id_user"], 0, "IR") && ! check_acl ($config["id_user"], 0, "IW") && ! check_acl ($config["id_user"], 0, "IM")) {
// Doesn't have access to this page // Doesn't have access to this page
db_pandora_audit("ACL Violation", "Trying to access incident details"); db_pandora_audit("ACL Violation", "Trying to access incident details");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -446,7 +446,7 @@ if (isset ($id_inc)) {
$table->cellpadding = 4; $table->cellpadding = 4;
$table->cellspacing = 4; $table->cellspacing = 4;
$table->class = "databox"; $table->class = "databox";
$table->width = '98%'; $table->width = '100%';
$table->head = array (); $table->head = array ();
$table->data = array (); $table->data = array ();
@ -491,7 +491,7 @@ if (isset ($id_inc)) {
// Upload control // Upload control
if ((check_acl($config["id_user"], $id_grupo, "IW")==1)) { if (check_acl($config["id_user"], $id_grupo, "IW") || check_acl($config["id_user"], $id_grupo, "IM")) {
echo '<div>'; echo '<div>';
echo '<a class="attachment" href="#">'; echo '<a class="attachment" href="#">';
@ -500,12 +500,26 @@ if (isset ($id_inc)) {
echo '</a>'; echo '</a>';
echo '</div>'; echo '</div>';
echo '<div><form method="post" id="file_control" action="index.php?sec=workspace&sec2=operation/incidents/incident_detail&id='.$id_inc.'&upload_file=1" enctype="multipart/form-data"><h4>'.__('Add attachment').'</h4>'; echo '<div><
echo '<table cellpadding="4" cellspacing="3" class="databox" width="98%"> form method="post" id="file_control" action="index.php?sec=workspace&sec2=operation/incidents/incident_detail&id='.$id_inc.'&upload_file=1"
<tr><td class="datos">'.__('Filename').'</td><td class="datos"><input type="file" name="userfile" value="userfile" class="sub" size="40" /></td></tr> enctype="multipart/form-data">
<tr><td class="datos2">'.__('Description').'</td><td class="datos2" colspan="3"><input type="text" name="file_description" size="47"></td></tr> <h4>'.__('Add attachment').'</h4>';
<tr><td colspan="2" style="text-align: right;"> <input type="submit" name="upload" value="'.__('Upload').'" class="sub wand"></td></tr> echo '<table cellpadding="4" cellspacing="3" class="databox" width="100%">
</table></form></div>'; <tr>
<td class="datos">'.__('Filename').'</td>
<td class="datos"><input type="file" name="userfile" value="userfile" class="sub" size="40" /></td>
</tr>
<tr>
<td class="datos2">'.__('Description').'</td>
<td class="datos2" colspan="3"><input type="text" name="file_description" size="47"></td>
</tr>
<tr>
<td colspan="2" style="text-align: right;">
<input type="submit" name="upload" value="'.__('Upload').'" class="sub wand"></td>
</tr>
</table>
</form>
</div>';
} }
} }
?> ?>

View File

@ -21,7 +21,7 @@ require_once ($config["homedir"] . '/include/functions_graph.php');
check_login (); check_login ();
if (! check_acl ($config['id_user'], 0, "IR") == 1) { if (! check_acl ($config['id_user'], 0, "IR") && ! check_acl ($config['id_user'], 0, "IW") && ! check_acl ($config['id_user'], 0, "IM")) {
db_pandora_audit("ACL Violation", "Trying to access Incident section"); db_pandora_audit("ACL Violation", "Trying to access Incident section");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;

View File

@ -26,14 +26,9 @@ $menu_operation = array ();
$menu_operation['class'] = 'operation'; $menu_operation['class'] = 'operation';
// Agent read, Server read // Agent read, Server read
if (check_acl ($config['id_user'], 0, "AR")) { $sub = array ();
if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "AW")) {
//View agents //View agents
$menu_operation["estado"]["text"] = __('Monitoring');
$menu_operation["estado"]["sec2"] = "operation/agentes/tactical";
$menu_operation["estado"]["refr"] = 0;
$menu_operation["estado"]["id"] = "oper-agents";
$sub = array ();
$sub["view"]["text"] = __('Views'); $sub["view"]["text"] = __('Views');
$sub["view"]["id"] = 'Views'; $sub["view"]["id"] = 'Views';
$sub["view"]["type"] = "direct"; $sub["view"]["type"] = "direct";
@ -75,43 +70,44 @@ if (check_acl ($config['id_user'], 0, "AR")) {
if ($config['log_collector'] == 1) { if ($config['log_collector'] == 1) {
enterprise_hook ('log_collector_menu'); enterprise_hook ('log_collector_menu');
} }
//End of view agents
//SNMP Console }
//SNMP Console
$sub2 = array();
if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "AW") ) {
$sub2["operation/snmpconsole/snmp_view"]["text"] = __("SNMP console");
$sub2["operation/snmpconsole/snmp_browser"]["text"] = __("SNMP browser");
enterprise_hook ('snmpconsole_submenu');
}
if (check_acl ($config['id_user'], 0, "PM"))
$sub2["operation/snmpconsole/snmp_mib_uploader"]["text"] = __("MIB uploader");
if (check_acl ($config['id_user'], 0, "LW") || check_acl ($config['id_user'], 0, "LM")) {
$sub2["godmode/snmpconsole/snmp_filters"]["text"] = __("SNMP filters");
$sub2["godmode/snmpconsole/snmp_trap_generator"]["text"] = __("SNMP trap generator");
}
if (!empty($sub2)) {
$sub["snmpconsole"]["sub2"] = $sub2;
$sub["snmpconsole"]["text"] = __('SNMP'); $sub["snmpconsole"]["text"] = __('SNMP');
$sub["snmpconsole"]["id"] = 'SNMP'; $sub["snmpconsole"]["id"] = 'SNMP';
$sub["snmpconsole"]["refr"] = 0; $sub["snmpconsole"]["refr"] = 0;
$sub["snmpconsole"]["type"] = "direct"; $sub["snmpconsole"]["type"] = "direct";
$sub["snmpconsole"]["subtype"] = "nolink"; $sub["snmpconsole"]["subtype"] = "nolink";
$sub2 = array(); }
$sub2["operation/snmpconsole/snmp_view"]["text"] = __("SNMP console");
$sub2["operation/snmpconsole/snmp_browser"]["text"] = __("SNMP browser"); if (!empty($sub)) {
$menu_operation["estado"]["text"] = __('Monitoring');
if (check_acl ($config['id_user'], 0, "PM")) $menu_operation["estado"]["sec2"] = "operation/agentes/tactical";
$sub2["operation/snmpconsole/snmp_mib_uploader"]["text"] = __("MIB uploader"); $menu_operation["estado"]["refr"] = 0;
$menu_operation["estado"]["id"] = "oper-agents";
if (check_acl ($config['id_user'], 0, "LW")) {
$sub2["godmode/snmpconsole/snmp_filters"]["text"] = __("SNMP filters");
$sub2["godmode/snmpconsole/snmp_trap_generator"]["text"] = __("SNMP trap generator");
}
enterprise_hook ('snmpconsole_submenu');
$sub["snmpconsole"]["sub2"] = $sub2;
$menu_operation["estado"]["sub"] = $sub; $menu_operation["estado"]["sub"] = $sub;
//End of view agents
} }
if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "MR")) { //Start network view
//Start network view $sub = array();
$menu_operation["network"]["text"] = __('Topology maps'); if (check_acl ($config['id_user'], 0, "MR") || check_acl ($config['id_user'], 0, "MW") || check_acl ($config['id_user'], 0, "MM")) {
$menu_operation["network"]["sec2"] = "operation/agentes/networkmap_list";
$menu_operation["network"]["refr"] = 0;
$menu_operation["network"]["id"] = "oper-networkconsole";
$sub = array();
}
if (check_acl ($config['id_user'], 0, "MR")) {
$sub["operation/agentes/networkmap_list"]["text"] = __('Network map'); $sub["operation/agentes/networkmap_list"]["text"] = __('Network map');
$sub["operation/agentes/networkmap_list"]["id"] = 'Network map'; $sub["operation/agentes/networkmap_list"]["id"] = 'Network map';
$sub["operation/agentes/networkmap_list"]["refr"] = 0; $sub["operation/agentes/networkmap_list"]["refr"] = 0;
@ -121,7 +117,7 @@ enterprise_hook ('networkmap_console');
enterprise_hook ('services_menu'); enterprise_hook ('services_menu');
if (check_acl ($config['id_user'], 0, "VR")) { if (check_acl ($config['id_user'], 0, "VR") || check_acl ($config['id_user'], 0, "VW") || check_acl ($config['id_user'], 0, "VM")) {
//Visual console //Visual console
$sub["godmode/reporting/map_builder"]["text"] = __('Visual console'); $sub["godmode/reporting/map_builder"]["text"] = __('Visual console');
$sub["godmode/reporting/map_builder"]["id"] = 'Visual console'; $sub["godmode/reporting/map_builder"]["id"] = 'Visual console';
@ -143,7 +139,7 @@ if (check_acl ($config['id_user'], 0, "VR")) {
$firstLetterNameVisualToShow = array('_', ',', '[', '('); $firstLetterNameVisualToShow = array('_', ',', '[', '(');
foreach ($layouts as $layout) { foreach ($layouts as $layout) {
if (! check_acl ($config["id_user"], $layout["id_group"], "AR")) { if (!check_acl ($config['id_user'], 0, "VR") && ! check_acl ($config['id_user'], 0, "VW") && ! check_acl ($config['id_user'], 0, "VM")) {
continue; continue;
} }
$name = io_safe_output($layout['name']); $name = io_safe_output($layout['name']);
@ -174,9 +170,9 @@ if (check_acl ($config['id_user'], 0, "VR")) {
$sub["godmode/reporting/map_builder"]["sub2"] = $sub2; $sub["godmode/reporting/map_builder"]["sub2"] = $sub2;
} }
} }
// GIS MAPS DESACTIVATE THIS PART; LIBRARY DOESN'T WORK CORRECTLY.
if (check_acl ($config['id_user'], 0, "AR")) {
if (check_acl ($config['id_user'], 0, "MR") || check_acl ($config['id_user'], 0, "MW") || check_acl ($config['id_user'], 0, "MM")) {
//INI GIS Maps //INI GIS Maps
if ($config['activate_gis']) { if ($config['activate_gis']) {
@ -218,12 +214,17 @@ if (check_acl ($config['id_user'], 0, "AR")) {
//END GIS Maps //END GIS Maps
} }
if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "MR")) if (!empty($sub)) {
$menu_operation["network"]["text"] = __('Topology maps');
$menu_operation["network"]["sec2"] = "operation/agentes/networkmap_list";
$menu_operation["network"]["refr"] = 0;
$menu_operation["network"]["id"] = "oper-networkconsole";
$menu_operation["network"]["sub"] = $sub; $menu_operation["network"]["sub"] = $sub;
}
//End networkview //End networkview
// Reports read // Reports read
if (check_acl ($config['id_user'], 0, "RR")) { if (check_acl ($config['id_user'], 0, "RR") || check_acl ($config['id_user'], 0, "RW") || check_acl ($config['id_user'], 0, "RM")) {
// Reporting // Reporting
$menu_operation["reporting"]["text"] = __('Reporting'); $menu_operation["reporting"]["text"] = __('Reporting');
$menu_operation["reporting"]["sec2"] = "godmode/reporting/reporting_builder"; $menu_operation["reporting"]["sec2"] = "godmode/reporting/reporting_builder";
@ -269,15 +270,21 @@ if (check_acl ($config['id_user'], 0, "ER")
$sub["operation/events/event_statistics"]["text"] = __('Statistics'); $sub["operation/events/event_statistics"]["text"] = __('Statistics');
$sub["operation/events/event_statistics"]["id"] = 'Statistics'; $sub["operation/events/event_statistics"]["id"] = 'Statistics';
//RSS //If ip doesn't is in list of allowed IP, isn't show this options
include_once ('include/functions_api.php'); include_once ('include/functions_api.php');
if (isInACL($_SERVER['REMOTE_ADDR'])) { if (isInACL($_SERVER['REMOTE_ADDR'])) {
$pss = get_user_info($config['id_user']); $pss = get_user_info($config['id_user']);
$hashup = md5($config['id_user'].$pss['password']); $hashup = md5($config['id_user'].$pss['password']);
//RSS
$sub["operation/events/events_rss.php?user=".$config['id_user']."&amp;hashup=".$hashup."&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["text"] = __('RSS'); $sub["operation/events/events_rss.php?user=".$config['id_user']."&amp;hashup=".$hashup."&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["text"] = __('RSS');
$sub["operation/events/events_rss.php?user=".$config['id_user']."&amp;hashup=".$hashup."&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["id"] = 'RSS'; $sub["operation/events/events_rss.php?user=".$config['id_user']."&amp;hashup=".$hashup."&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["id"] = 'RSS';
$sub["operation/events/events_rss.php?user=".$config['id_user']."&amp;hashup=".$hashup."&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["type"] = "direct"; $sub["operation/events/events_rss.php?user=".$config['id_user']."&amp;hashup=".$hashup."&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["type"] = "direct";
//Marquee
$sub["operation/events/events_marquee.php"]["text"] = __('Marquee');
$sub["operation/events/events_marquee.php"]["id"] = 'Marquee';
$sub["operation/events/events_marquee.php"]["type"] = "direct";
} }
//CSV //CSV
@ -285,11 +292,6 @@ if (check_acl ($config['id_user'], 0, "ER")
$sub["operation/events/export_csv.php?search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["id"] = 'CSV File'; $sub["operation/events/export_csv.php?search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["id"] = 'CSV File';
$sub["operation/events/export_csv.php?search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["type"] = "direct"; $sub["operation/events/export_csv.php?search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0&section=list&open_filter=0&pure="]["type"] = "direct";
//Marquee
$sub["operation/events/events_marquee.php"]["text"] = __('Marquee');
$sub["operation/events/events_marquee.php"]["id"] = 'Marquee';
$sub["operation/events/events_marquee.php"]["type"] = "direct";
//Sound Events //Sound Events
$javascript = "javascript: window.open('operation/events/sound_events.php');"; $javascript = "javascript: window.open('operation/events/sound_events.php');";
$javascript = 'javascript: alert(111);'; $javascript = 'javascript: alert(111);';
@ -307,7 +309,7 @@ if (check_acl ($config['id_user'], 0, "ER")
window.open(url, window.open(url,
'<?php __('Sound Alerts'); ?>', '<?php __('Sound Alerts'); ?>',
'width=475, height=275, resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no'); 'width=400, height=350, resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no');
} }
</script> </script>
<?php <?php
@ -335,7 +337,9 @@ $sub["operation/users/webchat"]["refr"] = 0;
//Incidents //Incidents
if (check_acl ($config['id_user'], 0, "IR")) { if (check_acl ($config['id_user'], 0, "IR")
|| check_acl ($config['id_user'], 0, "IW")
|| check_acl ($config['id_user'], 0, "IM")) {
$temp_sec2 = $sec2; $temp_sec2 = $sec2;
if($config['integria_enabled']) { if($config['integria_enabled']) {
$sec2 = "incident"; $sec2 = "incident";
@ -387,22 +391,21 @@ $menu_operation["workspace"]["sub"] = $sub;
// Extensions menu additions // Extensions menu additions
if (is_array ($config['extensions'])) { if (is_array ($config['extensions'])) {
$sub = array (); $sub = array ();
$sub2 = array (); $sub2 = array ();
if (check_acl ($config['id_user'], 0, "RR")) { if (check_acl ($config['id_user'], 0, "RR") || check_acl ($config['id_user'], 0, "RW") || check_acl ($config['id_user'], 0, "RM")) {
$sub["operation/agentes/exportdata"]["text"] = __('Export data'); $sub["operation/agentes/exportdata"]["text"] = __('Export data');
$sub["operation/agentes/exportdata"]["id"] = 'Export data'; $sub["operation/agentes/exportdata"]["id"] = 'Export data';
$sub["operation/agentes/exportdata"]["subsecs"] = array("operation/agentes/exportdata"); $sub["operation/agentes/exportdata"]["subsecs"] = array("operation/agentes/exportdata");
} }
if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "AD")) { if (check_acl ($config['id_user'], 0, "AR") || check_acl ($config['id_user'], 0, "AD") || check_acl ($config['id_user'], 0, "AW")) {
$sub["godmode/agentes/planned_downtime.list"]["text"] = __('Scheduled downtime'); $sub["godmode/agentes/planned_downtime.list"]["text"] = __('Scheduled downtime');
$sub["godmode/agentes/planned_downtime.list"]["id"] = 'Scheduled downtime'; $sub["godmode/agentes/planned_downtime.list"]["id"] = 'Scheduled downtime';
} }
if (check_acl ($config['id_user'], 0, "PM")) { if (check_acl ($config['id_user'], 0, "AW")) {
$sub["operation/servers/recon_view"]["text"] = __('Recon view'); $sub["operation/servers/recon_view"]["text"] = __('Recon view');
$sub["operation/servers/recon_view"]["id"] = 'Recon view'; $sub["operation/servers/recon_view"]["id"] = 'Recon view';
$sub["operation/servers/recon_view"]["refr"] = 0; $sub["operation/servers/recon_view"]["refr"] = 0;

View File

@ -24,7 +24,7 @@ ui_require_javascript_file ('calendar');
// ACL // ACL
check_login (); check_login ();
if (! check_acl ($config["id_user"], 0, "AR")) { if (! check_acl ($config["id_user"], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access event viewer"); "Trying to access event viewer");
require ("general/noaccess.php"); require ("general/noaccess.php");

View File

@ -22,8 +22,10 @@ require_once("include/functions_agents.php");
require_once("include/functions_snmp.php"); require_once("include/functions_snmp.php");
check_login (); check_login ();
$agent_a = check_acl ($config['id_user'], 0, "AR");
if (! check_acl ($config['id_user'], 0, "AR")) { $agent_w = check_acl ($config['id_user'], 0, "AW");
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
if (!$agent_a && !$agent_w) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access SNMP Console"); "Trying to access SNMP Console");
require ("general/noaccess.php"); require ("general/noaccess.php");
@ -41,7 +43,7 @@ $trap_type = (int) get_parameter ('trap_type', -1);
$group_by = (int)get_parameter('group_by', 0); $group_by = (int)get_parameter('group_by', 0);
$refr = (int)get_parameter("refr", 0); $refr = (int)get_parameter("refr", 0);
$user_groups = users_get_groups ($config['id_user'], "AR", false); $user_groups = users_get_groups ($config['id_user'], $access, false);
$str_user_groups = ''; $str_user_groups = '';
$i = 0; $i = 0;

View File

@ -80,7 +80,7 @@ $vconsole_read = check_acl ($config["id_user"], $id_group, "VR");
$vconsole_write = check_acl ($config["id_user"], $id_group, "VW"); $vconsole_write = check_acl ($config["id_user"], $id_group, "VW");
$vconsole_manage = check_acl ($config["id_user"], $id_group, "VM"); $vconsole_manage = check_acl ($config["id_user"], $id_group, "VM");
if (! $vconsole_read) { if (! $vconsole_read && !$vconsole_write && !$vconsole_manage) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access visual console without group access"); "Trying to access visual console without group access");
require ("general/noaccess.php"); require ("general/noaccess.php");

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0SP3 %define version 6.0SP3
%define release 160908 %define release 160912
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 6.0SP3 %define version 6.0SP3
%define release 160908 %define release 160912
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -65,7 +65,7 @@ INSERT INTO tconfig (token, value) VALUES ('graph_res','5');
INSERT INTO tconfig (token, value) VALUES ('step_compact','1'); INSERT INTO tconfig (token, value) VALUES ('step_compact','1');
INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc'); INSERT INTO tconfig (token, value) VALUES ('db_scheme_first_version','6.0orc');
INSERT INTO tconfig (token, value) VALUES('db_scheme_version','6.0SP3'); INSERT INTO tconfig (token, value) VALUES('db_scheme_version','6.0SP3');
INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD160908'); INSERT INTO tconfig (token, value) VALUES('db_scheme_build','PD160912');
INSERT INTO tconfig (token, value) VALUES ('show_unknown','0'); INSERT INTO tconfig (token, value) VALUES ('show_unknown','0');
INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1'); INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1');
INSERT INTO tconfig (token, value) VALUES ('style','pandora'); INSERT INTO tconfig (token, value) VALUES ('style','pandora');

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 6.0SP3-160908 Version: 6.0SP3-160912
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="6.0SP3-160908" pandora_version="6.0SP3-160912"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "6.0SP3"; my $pandora_version = "6.0SP3";
my $pandora_build = "160908"; my $pandora_build = "160912";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 6.0SP3 %define version 6.0SP3
%define release 160908 %define release 160912
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 6.0SP3 %define version 6.0SP3
%define release 160908 %define release 160912
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="6.0SP3" PI_VERSION="6.0SP3"
PI_BUILD="160908" PI_BUILD="160912"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "6.0SP3 PS160908"; my $version = "6.0SP3 PS160912";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;
@ -166,7 +166,7 @@ sub pandora_purgedb ($$) {
$conf->{'_string_purge'} = 7; $conf->{'_string_purge'} = 7;
} }
# Update alert with last_fired older than today - time_threshold # Update alert with last_fired older than today - time_threshold
my @templates = get_db_rows ($dbh, 'SELECT t1.id,t1.time_threshold FROM talert_templates t1 JOIN talert_template_modules t2 ON t1.id = t2.id_alert_template'); my @templates = get_db_rows ($dbh, 'SELECT t1.id,t1.time_threshold FROM talert_templates t1 WHERE EXISTS ( SELECT * FROM talert_template_modules t2 WHERE t1.id = t2.id_alert_template );');
foreach my $template(@templates) { foreach my $template(@templates) {
db_do($dbh, 'UPDATE talert_template_modules SET times_fired = 0 WHERE id_alert_template = ? AND times_fired > 0 AND last_fired < (? - ?)',$template->{'id'},time(),$template->{'time_threshold'}); db_do($dbh, 'UPDATE talert_template_modules SET times_fired = 0 WHERE id_alert_template = ? AND times_fired > 0 AND last_fired < (? - ?)',$template->{'id'},time(),$template->{'time_threshold'});
} }

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "6.0SP3 PS160908"; my $version = "6.0SP3 PS160912";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);