= "5") { $allowed = TRUE; } elseif ( devicepermitted($device_id)) { $allowed = TRUE; } elseif ( $permissions['port'][$interface_id]) { $allowed = TRUE; } else { $allowed = FALSE; } return $allowed; } function devicepermitted($device_id) { global $_SESSION; global $permissions; if ($_SESSION['userlevel'] >= "5") { $allowed = true; } elseif ( $permissions['device'][$device_id] ) { $allowed = true; } else { $allowed = false; } return $allowed; } function print_graph_tag ($args) { echo generate_graph_tag ($args); } function generate_graph_tag ($args) { global $config; $sep = "?"; $url = $config['base_url'] . "/graph.php"; foreach ($args as $key => $arg) { $url .= $sep.$key."=".$arg; $sep="&"; } return ""; } function print_percentage_bar ($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background) { $output = '
'.$left_text.'
'.$right_text.'
'; return $output; } function generate_if_link($args) { global $twoday; global $now; global $config; global $day; global $month; $args = ifNameDescr($args); if(!$args['content']) { $args['content'] = fixIfName($args['label']); } if(!$args['graph_type']) { $args['graph_type'] = 'bits'; } $class = ifclass($args['ifOperStatus'], $args['ifAdminStatus']); $graph_url = $config['base_url'] . "/graph.php?if=" . $args['interface_id'] . "&from=$day&to=$now&width=400&height=100&type=" . $args['graph_type']; $graph_url_month = $config['base_url'] . "/graph.php?if=" . $args['interface_id'] . "&from=$month&to=$now&width=400&height=100&type=" . $args['graph_type']; $device_id = getifhost($args['interface_id']); $link = ""; if($args['ifAlias']) { $link .= "
" . $args['ifAlias']; } $link .= "' "; $link .= $config['overlib_defaults'].");\" onmouseout=\"return nd();\" >".$args['content']."
"; return $link; } function generate_port_thumbnail($args) { if(!$args['bg']) { $args['bg'] = "FFFFF"; } $args['content'] = ""; $output = generate_if_link($args); echo $output; } function print_optionbar_start ($height = 20, $width = 0) { echo("
"); } function print_optionbar_end () { echo("
"); } ?>