diff --git a/pandora_console/operation/visual_console/view.php b/pandora_console/operation/visual_console/view.php index 0b229c46d8..ceb2aa7745 100644 --- a/pandora_console/operation/visual_console/view.php +++ b/pandora_console/operation/visual_console/view.php @@ -1,9 +1,8 @@ toArray(); $groupId = $visualConsoleData['groupId']; -$visualConsoleName = $visualConsoleData['name']; +$visualConsoleName = io_safe_input(strip_tags(io_safe_output($visualConsoleData['name']))); // ACL. -$aclRead = check_acl_restricted_all($config['id_user'], $groupId, 'VR'); -$aclWrite = check_acl_restricted_all($config['id_user'], $groupId, 'VW'); -$aclManage = check_acl_restricted_all($config['id_user'], $groupId, 'VM'); +$aclRead = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VR'); +$aclWrite = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VW'); +$aclManage = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VM'); -if (!$aclRead && !$aclWrite && !$aclManage) { +if ($aclRead === false && $aclWrite === false && $aclManage === false) { db_pandora_audit( 'ACL Violation', 'Trying to access visual console without group access' @@ -121,9 +121,9 @@ $options['consoles_list']['text'] = ''.html_print_image( 'images/wand_services.png', true, @@ -198,7 +198,7 @@ $options['view']['text'] = ''.html_print_image( 'images/full_screen.png', @@ -368,7 +368,7 @@ if ($pure === false) { echo ''; echo ''; - if ($aclWrite || $aclManage) { + if ($aclWrite === true || $aclManage === true) { echo html_print_checkbox_switch('edit-mode', 1, false, true); } @@ -394,7 +394,7 @@ if ($pure === true) { // Quit fullscreen. echo '
  • '; - if (is_metaconsole()) { + if (is_metaconsole() === true) { $urlNoFull = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$visualConsoleId.'&refr='.$refr; } else { $urlNoFull = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$visualConsoleId.'&refr='.$refr; @@ -407,7 +407,7 @@ if ($pure === true) { // Countdown. echo '
  • '; - if (is_metaconsole()) { + if (is_metaconsole() === true) { echo '
    '; } else { echo '
    '; @@ -432,11 +432,13 @@ if ($pure === true) { // Console name. echo '
  • '; - if (is_metaconsole()) { - echo '
    '.$visualConsoleName.'
    '; - } else { - echo '
    '.$visualConsoleName.'
    '; - } + + html_print_div( + [ + 'class' => (is_metaconsole() === true) ? 'vc-title-meta' : 'vc-title', + 'content' => $visualConsoleName, + ] + ); echo '
  • '; @@ -465,7 +467,7 @@ if ($pure === true) { // Check groups can access user. $aclUserGroups = []; -if (!users_can_manage_group_all('AR')) { +if (users_can_manage_group_all('AR') === false) { $aclUserGroups = array_keys(users_get_groups(false, 'AR')); } @@ -489,7 +491,7 @@ ui_require_css_file('form');