Exemplo n.º 1
0
function display_tabs()
{
    /* purge old flows if they exist */
    purgeFlows();
    /* draw the categories tabs on the top of the page */
    if (isset($_REQUEST['tab'])) {
        $_SESSION['flowview_current_tab'] = $_REQUEST['tab'];
    } elseif (isset($_SESSION['flowview_current_tab'])) {
        /* do nothing */
    } else {
        $_SESSION['flowview_current_tab'] = 'filters';
    }
    $ct = $_SESSION['flowview_current_tab'];
    print "<table class='tabs' width='100%' cellspacing='0' cellpadding='3' align='center'><tr>\n";
    print "<td bgcolor='" . ($ct == 'filters' ? "silver" : "#DFDFDF") . "' nowrap='nowrap' width='" . strlen('Filters') * 9 . "' align='center' class='tab'>\n\t\t\t<span class='textHeader'><a title='Setup Flows' href='flowview.php?tab=filters'>Filters</a></span>\n\t\t\t</td>\n\n\t\t\t<td width='1'></td>\n";
    if (api_user_realm_auth('flowview_devices.php')) {
        print "<td bgcolor='" . ($ct == 'listeners' ? "silver" : "#DFDFDF") . "' nowrap='nowrap' width='" . strlen('Listeners') * 9 . "' align='center' class='tab'>\n\t\t\t\t<span class='textHeader'><a title='Manage Listeners' href='flowview_devices.php?tab=listeners'>Listeners</a></span>\n\t\t\t\t</td>\n\n\t\t\t\t<td width='1'></td>\n";
    }
    if (api_user_realm_auth('flowview_schedules.php')) {
        print "<td bgcolor='" . ($ct == 'sched' ? "silver" : "#DFDFDF") . "' nowrap='nowrap' width='" . strlen('Schedules') * 9 . "' align='center' class='tab'>\n\t\t\t\t<span class='textHeader'><a title='Manage e-Mail Reports' href='flowview_schedules.php?tab=sched'>Schedules</a></span>\n\t\t\t\t</td>\n\n\t\t\t\t<td width='1'></td>\n";
    }
    if (isset($_SESSION['flowview_flows']) && is_array($_SESSION['flowview_flows']) && sizeof($_SESSION['flowview_flows'])) {
        foreach ($_SESSION['flowview_flows'] as $sessionid => $data) {
            if (!isset($data['title'])) {
                $_SESSION['flowview_flows'][$sessionid]['title'] = $data['title'] = "Unknown";
            }
            print "<td bgcolor='" . ($ct == $sessionid ? "silver" : "#DFDFDF") . "' nowrap='nowrap' width='" . strlen($data['title']) * 9 . "' align='center' class='tab'>\n\t\t\t\t<span class='textHeader'><a style='white-space:nowrap;' href='flowview.php?tab={$sessionid}' title='View Flow'>" . $data['title'] . "</a>&nbsp<a href='flowview.php?action=killsession&session={$sessionid}' title='Remove Flow Cache'>x</a></span>\n\t\t\t\t</td>\n\n\t\t\t\t<td width='1'></td>\n";
        }
    }
    print "<td></td>\n</tr></table>\n";
}
Exemplo n.º 2
0
function display_tabs()
{
    /* purge old flows if they exist */
    purgeFlows();
    /* draw the categories tabs on the top of the page */
    $tab = get_nfilter_request_var('tab');
    if ($tab == '') {
        if (isset($_SESSION['flowview_current_tab'])) {
            $tab = $_SESSION['flowview_current_tab'];
        } else {
            $tab = 'filters';
            $_SESSION['flowview_current_tab'] = 'filters';
        }
    }
    print "<div class='tabs' style='float:left;'><nav><ul>\n";
    print "<li><a class='pic " . ($tab == 'filters' ? ' selected' : '') . "' title='Flow Filters' href='flowview.php?tab=filters'>Filters</a></li>\n";
    if (api_user_realm_auth('flowview_devices.php')) {
        print "<li><a class='pic " . ($tab == 'listeners' ? ' selected' : '') . "' title='Manage Listeners' href='flowview_devices.php?tab=listeners'>Listeners</a></li>\n";
    }
    if (api_user_realm_auth('flowview_schedules.php')) {
        print "<li><a class='pic " . ($tab == 'sched' ? ' selected' : '') . "' title='Manage Schedules' href='flowview_schedules.php?tab=sched'>Schedules</a></li>\n";
    }
    if (isset($_SESSION['flowview_flows']) && is_array($_SESSION['flowview_flows']) && sizeof($_SESSION['flowview_flows'])) {
        foreach ($_SESSION['flowview_flows'] as $sessionid => $data) {
            if (!isset($data['title'])) {
                $_SESSION['flowview_flows'][$sessionid]['title'] = $data['title'] = "Unknown";
            }
            print "<li><a class='pic " . ($tab == $sessionid ? 'selected' : '') . "' title='View Flow' href='flowview.php?action=view&tab={$sessionid}'>" . $data['title'] . "</a><a class='pic' href='flowview.php?action=killsession&session={$sessionid}' title='Remove Flow Cache'><span class='fa fa-remove deviceDown'></span></a></li>\n";
        }
    }
    print "</ul></nav></div>\n";
}