Merge branch 'ent-2532-6107-6239-bug-ACL' into 'develop'

Fixed ACL enterprise in home screen

See merge request artica/pandorafms!1664
This commit is contained in:
vgilc 2018-08-03 15:09:44 +02:00
commit 80121c4689
1 changed files with 46 additions and 30 deletions

View File

@ -447,21 +447,23 @@ if (! isset ($config['id_user'])) {
$_GET["sec"] = "general/logon_ok"; $_GET["sec"] = "general/logon_ok";
break; break;
case 'Dashboard': case 'Dashboard':
$_GET["sec"] = "dashboard"; $_GET["sec"] = "reporting";
$_GET["sec2"] = ENTERPRISE_DIR.'/dashboard/main_dashboard'; $_GET["sec2"] = ENTERPRISE_DIR.'/dashboard/main_dashboard';
$id_dashboard_select = $id_dashboard_select =
db_get_value('id', 'tdashboard', 'name', $home_url); db_get_value('id', 'tdashboard', 'name', $home_url);
$_GET['id_dashboard_select'] = $id_dashboard_select; $_GET['id_dashboard_select'] = $id_dashboard_select;
break; break;
case 'Visual console': case 'Visual console':
$_GET["sec"] = "visualc"; $_GET["sec"] = "network";
$_GET["sec2"] = "operation/visual_console/index"; $_GET["sec2"] = "operation/visual_console/index";
break; break;
case 'Other': case 'Other':
$home_url = io_safe_output($home_url); $home_url = io_safe_output($home_url);
parse_str ($home_url, $res); $url_array = parse_url($home_url);
$_GET["sec"] = $res["sec"]; parse_str ($url_array['query'], $res);
$_GET["sec2"] = $res["sec2"]; foreach ($res as $key => $param) {
$_GET[$key] = $param;
}
break; break;
} }
} }
@ -1034,66 +1036,80 @@ else {
$home_url = $user_info['data_section']; $home_url = $user_info['data_section'];
} }
if ($home_page != '') { if ($home_page != '') {
switch ($home_page) { switch ($home_page) {
case 'Event list': case 'Event list':
require ('operation/events/events.php'); $_GET['sec'] = 'eventos';
$_GET['sec2'] = 'operation/events/events';
break; break;
case 'Group view': case 'Group view':
require ('operation/agentes/group_view.php'); $_GET['sec'] = 'view';
$_GET['sec2'] = 'operation/agentes/group_view';
break; break;
case 'Alert detail': case 'Alert detail':
require ('operation/agentes/alerts_status.php'); $_GET['sec'] = 'view';
$_GET['sec2'] = 'operation/agentes/alerts_status';
break; break;
case 'Tactical view': case 'Tactical view':
require ('operation/agentes/tactical.php'); $_GET['sec'] = 'view';
$_GET['sec2'] = 'operation/agentes/tactical';
break; break;
case 'Default': case 'Default':
require ('general/logon_ok.php'); $_GET['sec2'] = 'general/logon_ok';
break; break;
case 'Dashboard': case 'Dashboard':
$id_dashboard = db_get_value('id', 'tdashboard', 'name', $home_url); $id_dashboard = db_get_value('id', 'tdashboard', 'name', $home_url);
$str = 'sec=visualc&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard; $str = 'sec=reporting&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard;
parse_str($str, $res); parse_str($str, $res);
foreach ($res as $key => $param) { foreach ($res as $key => $param) {
$_GET[$key] = $param; $_GET[$key] = $param;
} }
require(ENTERPRISE_DIR.'/dashboard/main_dashboard.php');
break; break;
case 'Visual console': case 'Visual console':
$id_visualc = db_get_value('id', 'tlayout', 'name', $home_url); $id_visualc = db_get_value('id', 'tlayout', 'name', $home_url);
if (($home_url == '') || ($id_visualc == false)) { if (($home_url == '') || ($id_visualc == false)) {
$str = 'sec=visualc&sec2=operation/visual_console/index&refr=60'; $str = 'sec=network&sec2=operation/visual_console/index&refr=60';
} }
else else
$str = 'sec=visualc&sec2=operation/visual_console/render_view&id='.$id_visualc .'&refr=60'; $str = 'sec=network&sec2=operation/visual_console/render_view&id='.$id_visualc .'&refr=60';
parse_str($str, $res); parse_str($str, $res);
foreach ($res as $key => $param) { foreach ($res as $key => $param) {
$_GET[$key] = $param; $_GET[$key] = $param;
} }
require($_GET["sec2"] . '.php');
break; break;
case 'Other': case 'Other':
$home_url = io_safe_output($home_url); $home_url = io_safe_output($home_url);
parse_str ($home_url, $res); $url_array = parse_url($home_url);
parse_str ($url_array['query'], $res);
foreach ($res as $key => $param) { foreach ($res as $key => $param) {
$_GET[$key] = $param; $_GET[$key] = $param;
} }
if (isset($_GET['sec2'])) {
$file = $_GET['sec2'] . '.php';
if (!file_exists ($file)) {
unset($_GET['sec2']);
require('general/logon_ok.php');
}
else {
require($file);
}
}
break; break;
} }
if (isset($_GET['sec2'])) {
$file = $_GET['sec2'] . '.php';
// Translate some secs
$main_sec = get_sec($_GET['sec']);
$_GET['sec'] = $main_sec == false ? $_GET['sec'] : $main_sec;
if (
!file_exists ($file) ||
(
$_GET['sec2'] != 'general/logon_ok' &&
enterprise_hook ('enterprise_acl',
array ($config['id_user'], $_GET['sec'], $_GET['sec2'], true,
isset($_GET['sec3']) ? $_GET['sec3'] : '')
) == false
)
) {
unset($_GET['sec2']);
require ("general/noaccess.php");
}
else {
require($file);
}
} else {
require ("general/noaccess.php");
}
} }
else { else {
require("general/logon_ok.php"); require("general/logon_ok.php");