Modified the view to restrict some controls when the strict ACL is enabled

This commit is contained in:
Alejandro Gallardo Escobar 2015-01-30 20:41:54 +01:00
parent d2164592b3
commit 7f40abbca6
1 changed files with 60 additions and 45 deletions

View File

@ -23,6 +23,8 @@ $status_agent = get_parameter('statusAgent', AGENT_STATUS_ALL);
$search_module = get_parameter('searchModule', ''); $search_module = get_parameter('searchModule', '');
$status_module = get_parameter('statusModule', -1); $status_module = get_parameter('statusModule', -1);
$strict_acl = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']);
// ---------------------Tabs ------------------------------------------- // ---------------------Tabs -------------------------------------------
$enterpriseEnable = false; $enterpriseEnable = false;
if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) { if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) {
@ -38,6 +40,7 @@ $url = 'index.php?' .
$tabs = array(); $tabs = array();
if (!$strict_acl) {
$tabs['tag'] = array( $tabs['tag'] = array(
'text' => "<a href='" . sprintf($url, "tag") . "'>" . 'text' => "<a href='" . sprintf($url, "tag") . "'>" .
html_print_image("images/tag.png", true, html_print_image("images/tag.png", true,
@ -75,34 +78,44 @@ if ($enterpriseEnable) {
array("title" => __('Policies'))) . "</a>", array("title" => __('Policies'))) . "</a>",
'active' => ($tab == "policies")); 'active' => ($tab == "policies"));
} }
}
$header_title = __('Tree view') . " - " . __('Sort the agents by %s'); $header_title = __('Tree view');
$header_sub_title = __('Sort the agents by %s');
switch ($tab) { switch ($tab) {
case 'tag': case 'tag':
$header_title = sprintf($header_title, __('tags')); $header_sub_title = sprintf($header_sub_title, __('tags'));
break; break;
case 'os': case 'os':
$header_title = sprintf($header_title, __('OS')); $header_sub_title = sprintf($header_sub_title, __('OS'));
break; break;
case 'group': case 'group':
$header_title = sprintf($header_title, __('groups')); $header_sub_title = sprintf($header_sub_title, __('groups'));
break; break;
case 'module_group': case 'module_group':
$header_title = sprintf($header_title, __('module groups')); $header_sub_title = sprintf($header_sub_title, __('module groups'));
break; break;
case 'module': case 'module':
$header_title = sprintf($header_title, __('modules')); $header_sub_title = sprintf($header_sub_title, __('modules'));
break; break;
case 'policies': case 'policies':
if ($enterpriseEnable) if ($enterpriseEnable)
$header_title = sprintf($header_title, __('policies')); $header_sub_title = sprintf($header_sub_title, __('policies'));
break; break;
} }
if (defined('METACONSOLE')) if (defined('METACONSOLE')) {
ui_meta_print_header($header_title, "", $tabs); if ($strict_acl)
else $header_sub_title = '';
ui_meta_print_header($header_title, $header_sub_title, $tabs);
}
else{
if (!$strict_acl)
$header_title = $header_title ." - ". $header_sub_title;
ui_print_page_header($header_title, "images/extensions.png", false, "", false, $tabs); ui_print_page_header($header_title, "images/extensions.png", false, "", false, $tabs);
}
// ---------------------Tabs ------------------------------------------- // ---------------------Tabs -------------------------------------------
@ -128,8 +141,8 @@ else {
} }
// --------------------- form filter ----------------------------------- // --------------------- form filter -----------------------------------
$table = new StdClass(); $table = new StdClass();
// $table->class = "blank";
$table->width = "100%"; $table->width = "100%";
$table->data = array(); $table->data = array();
$table->rowspan = array(); $table->rowspan = array();
@ -174,9 +187,11 @@ $table->data[] = $row;
enterprise_hook('open_meta_frame'); enterprise_hook('open_meta_frame');
if (!$strict_acl) {
echo '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$tab.'&pure='.$config['pure'].'">'; echo '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$tab.'&pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);
echo '</form>'; echo '</form>';
}
// --------------------- form filter ----------------------------------- // --------------------- form filter -----------------------------------
ui_include_time_picker(); ui_include_time_picker();