diff --git a/pandora_console/operation/visual_console/view.php b/pandora_console/operation/visual_console/view.php index 12ca2e3869..2ab81d490c 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, @@ -380,7 +380,7 @@ if ($pure === false) { echo ''; echo ''; - if ($aclWrite || $aclManage) { + if ($aclWrite === true || $aclManage === true) { echo html_print_checkbox_switch('edit-mode', 1, false, true); } @@ -406,7 +406,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; @@ -419,7 +419,7 @@ if ($pure === true) { // Countdown. echo '
  • '; - if (is_metaconsole()) { + if (is_metaconsole() === true) { echo '
    '; } else { echo '
    '; @@ -444,11 +444,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 '
  • '; @@ -501,7 +503,7 @@ ui_require_css_file('form');