2012-01-12 Vanessa Gil <vanessa.gil@artica.es>
godmode/netflow/nf_edit.php godmode/netflow/nf_report.php godmode/netflow/nf_report_form.php godmode/netflow/nf_report_item.php include/functions_netflow.php operation/netflow/nf_view.php operation/netflow/nf_reporting.php: changes netflow acl. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5356 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4794156850
commit
2e7da2fa96
|
@ -1,3 +1,12 @@
|
|||
2012-01-12 Vanessa Gil <vanessa.gil@artica.es>
|
||||
godmode/netflow/nf_edit.php
|
||||
godmode/netflow/nf_report.php
|
||||
godmode/netflow/nf_report_form.php
|
||||
godmode/netflow/nf_report_item.php
|
||||
include/functions_netflow.php
|
||||
operation/netflow/nf_view.php
|
||||
operation/netflow/nf_reporting.php: changes netflow acl.
|
||||
|
||||
2012-01-12 Junichi Satoh <junichi@rworks.jp>
|
||||
|
||||
* godmode/admin_access_logs.php: Fixed user filtering does not work.
|
||||
|
|
|
@ -92,8 +92,9 @@ if ($multiple_delete) {
|
|||
__('Not deleted. Error deleting data'));
|
||||
}
|
||||
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
// Get group list that user has access
|
||||
$groups_user = users_get_groups ($config['id_user'], "AW", false, true);
|
||||
$groups_user = users_get_groups ($config['id_user'], "AW", $own_info['is_admin'], true);
|
||||
|
||||
$groups_id = array();
|
||||
foreach($groups_user as $key => $groups){
|
||||
|
|
|
@ -78,17 +78,9 @@ if ($multiple_delete) {
|
|||
__('Not deleted. Error deleting data'));
|
||||
}
|
||||
|
||||
/*
|
||||
$filter = array ();
|
||||
|
||||
$filter['offset'] = (int) get_parameter ('offset');
|
||||
$filter['limit'] = (int) $config['block_size'];
|
||||
|
||||
$reports = db_get_all_rows_filter ('tnetflow_report', $filter);
|
||||
*/
|
||||
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
// Get group list that user has access
|
||||
$groups_user = users_get_groups ($config['id_user'], "IW", false, true);
|
||||
$groups_user = users_get_groups ($config['id_user'], "IW", $own_info['is_admin'], true);
|
||||
|
||||
$groups_id = array();
|
||||
foreach($groups_user as $key => $groups){
|
||||
|
|
|
@ -35,7 +35,7 @@ $update = (string)get_parameter('update', 0);
|
|||
$create = (string)get_parameter('create', 0);
|
||||
|
||||
if ($id) {
|
||||
$permission = netflow_check_report_group ($id);
|
||||
$permission = netflow_check_report_group ($id, false);
|
||||
if (!$permission) { //no tiene permisos para acceder a un informe
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
|
|
|
@ -112,9 +112,9 @@ if ($filters === false) {
|
|||
$filters = array ();
|
||||
}
|
||||
|
||||
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
// Get group list that user has access
|
||||
$groups_user = users_get_groups ($config['id_user'], "IW", $is_admin, true);
|
||||
$groups_user = users_get_groups ($config['id_user'], "IW", $own_info['is_admin'], true);
|
||||
$groups_id = array();
|
||||
foreach($groups_user as $key => $groups){
|
||||
$groups_id[] = $groups['id_grupo'];
|
||||
|
|
|
@ -87,14 +87,22 @@ function netflow_check_filter_group ($id_sg) {
|
|||
return false;
|
||||
}
|
||||
|
||||
//permite validar si un informe pertenece a un grupo permitido para el usuario
|
||||
/* Permite validar si un informe pertenece a un grupo permitido para el usuario.
|
||||
* Si mode = false entonces es modo godmode y solo puede ver el grupo All el admin
|
||||
* Si es modo operation (mode = true) entonces todos pueden ver el grupo All
|
||||
*/
|
||||
|
||||
function netflow_check_report_group ($id_report) {
|
||||
function netflow_check_report_group ($id_report, $mode=false) {
|
||||
global $config;
|
||||
|
||||
$id_group = db_get_value('id_group', 'tnetflow_report', 'id_report', $id_report);
|
||||
if (!$mode) {
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
$mode = $own_info['is_admin'];
|
||||
}
|
||||
$id_group = db_get_value('id_group', 'tnetflow_report', 'id_report', $id_report);
|
||||
|
||||
// Get group list that user has access
|
||||
$groups_user = users_get_groups ($config['id_user'], "IW", false, true);
|
||||
$groups_user = users_get_groups ($config['id_user'], "IW", $mode, true);
|
||||
$groups_id = array();
|
||||
$has_permission = false;
|
||||
|
||||
|
@ -105,6 +113,7 @@ function netflow_check_report_group ($id_report) {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a filter.
|
||||
*
|
||||
|
@ -115,32 +124,12 @@ function netflow_check_report_group ($id_report) {
|
|||
* @return array A netflow filter matching id and filter.
|
||||
*/
|
||||
function netflow_filter_get_filter ($id_sg, $filter = false, $fields = false) {
|
||||
global $config;
|
||||
|
||||
/*
|
||||
$id_group = db_get_value('id_group', 'tnetflow_filter', 'id_sg', $id_sg);
|
||||
// Get group list that user has access
|
||||
$groups_user = users_get_groups ($config['id_user'], "AR", false, true);
|
||||
$groups_id = array();
|
||||
$has_permission = false;
|
||||
|
||||
foreach($groups_user as $key => $groups){
|
||||
if ($groups['id_grupo'] == $id_group)
|
||||
$has_permission = true;
|
||||
}
|
||||
*/
|
||||
|
||||
//if ($has_permission) {
|
||||
if (! is_array ($filter))
|
||||
$filter = array ();
|
||||
$filter['id_sg'] = (int) $id_sg;
|
||||
|
||||
return db_get_row_filter ('tnetflow_filter', $filter, $fields);
|
||||
/*
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,7 @@ $filter['limit'] = (int) $config['block_size'];
|
|||
*/
|
||||
|
||||
// Get group list that user has access
|
||||
$groups_user = users_get_groups ($config['id_user'], "AR", false, true);
|
||||
$groups_user = users_get_groups ($config['id_user'], "AR", true, true);
|
||||
|
||||
$groups_id = array();
|
||||
foreach($groups_user as $key => $groups){
|
||||
|
|
|
@ -33,7 +33,7 @@ if (! check_acl ($config["id_user"], 0, "AR")) {
|
|||
$id = io_safe_input (get_parameter('id'));
|
||||
|
||||
if ($id) {
|
||||
$permission = netflow_check_report_group ($id);
|
||||
$permission = netflow_check_report_group ($id, true);
|
||||
if (!$permission) { //no tiene permisos para acceder a un informe
|
||||
require ("general/noaccess.php");
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue