# -> / for phpdoc

git-svn-id: http://www.observium.org/svn/observer/trunk@3239 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-25 11:29:53 +00:00
parent ba28732c3b
commit cacf913a55
235 changed files with 754 additions and 743 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
*
*/
## FIXME - fewer includes!
/// FIXME - fewer includes!
include_once("../includes/defaults.inc.php");
include_once("../config.php");
@@ -49,7 +49,7 @@ function adduser($username, $password, $level, $email = "", $realname = "", $can
function user_exists($username)
{
## FIXME this doesn't seem right? (adama)
/// FIXME this doesn't seem right? (adama)
return dbFetchCell("SELECT * FROM `users` WHERE `username` = ?", array($username));
}
+1 -1
View File
@@ -43,7 +43,7 @@ function authenticate($username,$password)
}
else
{
# FIXME return a warning that LDAP couldn't connect?
/// FIXME return a warning that LDAP couldn't connect?
}
return 0;
+1 -1
View File
@@ -502,7 +502,7 @@ function collectd_draw_rrd($host, $plugin, $pinst = null, $type, $tinst = null,
$has_min = true;
}
### Build legend. This may not work for all RRDs, i don't know :)
/// Build legend. This may not work for all RRDs, i don't know :)
if ($has_avg)
$graph[] = "COMMENT: Last";
if ($has_min)
+1 -1
View File
@@ -189,7 +189,7 @@ function generate_graph_popup($graph_array)
{
global $config;
## Take $graph_array and print day,week,month,year graps in overlib, hovered over graph
/// Take $graph_array and print day,week,month,year graps in overlib, hovered over graph
$original_from = $graph_array['from'];
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
### Authorises bill viewing and sets $ports as reference to mysql query containing ports for this bill
/// Authorises bill viewing and sets $ports as reference to mysql query containing ports for this bill
include("../includes/billing.php");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## Generate a list of ports and then call the multi_bits grapher to generate from the list
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
$i = 0;
@@ -1,6 +1,6 @@
<?php
## Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
/// Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
$oids = array('drop', 'punt', 'hostpunt');
$i = 0;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## FIXME - wtfbbq
/// FIXME - wtfbbq
if ($_SESSION['userlevel'] >= "5" || $auth)
{
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## Generate a list of ports and then call the multi_bits grapher to generate from the list
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
$i=0;
foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = ? AND D.device_id = I.device_id", array($vars['id'])) as $port)
{
+2 -2
View File
@@ -1,6 +1,6 @@
<?php
## Generate a list of ports and then call the multi_bits grapher to generate from the list
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";
@@ -32,7 +32,7 @@ foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ?", array($devic
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
if ($ignore != 1 && is_file($rrd_filename))
{
$port = ifLabel($port); ## Fix Labels! ARGH. This needs to be in the bloody database!
$port = ifLabel($port); /// Fix Labels! ARGH. This needs to be in the bloody database!
$rrd_filenames[] = $rrd_filename;
$rrd_list[$i]['filename'] = $rrd_filename;
+1 -1
View File
@@ -10,7 +10,7 @@ $rrd_options .= " COMMENT:'".str_pad($unit_long,$descr_len)." Cur Min
foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? ORDER BY `sensor_index`", array($class, $device['device_id'])) as $sensor)
{
# FIXME generic colour function
/// FIXME generic colour function
switch ($iter)
{
case "1":
+1 -1
View File
@@ -2,7 +2,7 @@
include("includes/graphs/common.inc.php");
### FIXME - THIS IS BROKEN
/// FIXME - THIS IS BROKEN
$sla = dbFetchRow("SELECT * FROM `slas` WHERE `sla_id` = ?", array($vars['id']));
$device = device_by_id_cache($sla['device_id']);
@@ -1,8 +1,8 @@
<?php
## Dear Tobias. You write in Perl, this makes me hate you forever.
## This is my translation of Smokeping's graphing.
## Thanks to Bill Fenner for Perl->Human translation:>
/// Dear Tobias. You write in Perl, this makes me hate you forever.
/// This is my translation of Smokeping's graphing.
/// Thanks to Bill Fenner for Perl->Human translation:>
$scale_min = 0;
$scale_rigid = TRUE;
@@ -1,8 +1,8 @@
<?php
## Dear Tobias. You write in Perl, this makes me hate you forever.
## This is my translation of Smokeping's graphing.
## Thanks to Bill Fenner for Perl->Human translation:>
/// Dear Tobias. You write in Perl, this makes me hate you forever.
/// This is my translation of Smokeping's graphing.
/// Thanks to Bill Fenner for Perl->Human translation:>
$scale_min = 0;
$scale_rigid = TRUE;
@@ -22,7 +22,7 @@ if($width > "500")
$descr_len = 12 + round(($width - 275) / 8);
}
# FIXME str_pad really needs a "limit to length" so we can rid of all the substrs all over the code to limit the length as below...
/// FIXME str_pad really needs a "limit to length" so we can rid of all the substrs all over the code to limit the length as below...
if($width > "500")
{
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." RTT Loss SDev RTT\:SDev\l'";
+1 -1
View File
@@ -10,7 +10,7 @@ $rrd_options .= " COMMENT:' Size Used %age\\l'";
foreach (dbFetchRows("SELECT * FROM storage where device_id = ?", array($device['device_id'])) as $storage)
{
# FIXME generic colour function
/// FIXME generic colour function
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
elseif ($iter=="4") { $colour="73880A"; } elseif ($iter=="5") { $colour="D01F3C"; } elseif ($iter=="6") { $colour="36393D"; }
elseif ($iter=="7") { $colour="FF0084"; $iter = "0"; }
+1 -1
View File
@@ -12,7 +12,7 @@ foreach (dbFetchRows("SELECT * FROM toner where device_id = ?", array($device['d
if ($colour['left'] == NULL)
{
# FIXME generic colour function
/// FIXME generic colour function
switch ($iter)
{
case "1":
@@ -39,7 +39,7 @@ foreach ($rrd_list as $rrd)
$descr = rrdtool_escape($rrd['descr'], $descr_len) . " In";
}
$descr_out = rrdtool_escape($rrd['descr_out'], $descr_len) . " Out";
$descr = str_replace("'", "", $descr); # FIXME does this mean ' should be filtered in rrdtool_escape? probably...
$descr = str_replace("'", "", $descr); /// FIXME does this mean ' should be filtered in rrdtool_escape? probably...
$descr_out = str_replace("'", "", $descr_out);
$rrd_options .= " DEF:".$in.$i."=".$rrd['filename'].":".$ds_in.":AVERAGE ";
@@ -39,7 +39,7 @@ foreach ($rrd_list as $rrd)
$descr = rrdtool_escape($rrd['descr'], $descr_len) . " In";
}
$descr_out = rrdtool_escape($rrd['descr_out'], $descr_len) . " Out";
$descr = str_replace("'", "", $descr); # FIXME does this mean ' should be filtered in rrdtool_escape? probably...
$descr = str_replace("'", "", $descr); /// FIXME does this mean ' should be filtered in rrdtool_escape? probably...
$descr_out = str_replace("'", "", $descr_out);
$rrd_options .= " DEF:".$in.$i."=".$rrd['filename'].":".$ds_in.":AVERAGE ";
@@ -7,7 +7,7 @@ $units_descr = substr(str_pad($units_descr, 18),0,18);
if($format == "octets" || $format == "bytes")
{
$units = "Bps";
$format = "bits"; # FIXME bits? or bytes?
$format = "bits"; /// FIXME bits? or bytes?
} else {
$units = "bps";
$format = "bits";
@@ -4,7 +4,7 @@ include("includes/graphs/common.inc.php");
if($width > "500")
{
$descr_len = 24; # FIXME may even be more imo?
$descr_len = 24; /// FIXME may even be more imo?
} else {
$descr_len = 12;
$descr_len += round(($width - 250) / 8);
@@ -62,13 +62,13 @@ foreach ($rrd_list as $i => $rrd)
$plusX = ",+";
}
## Suppress totalling?
/// Suppress totalling?
if (!$nototal)
{
$rrd_options .= " VDEF:tot".$rrd['ds'].$i."=".$rrd['ds'].$i.",TOTAL";
}
## This this not the first entry?
/// This this not the first entry?
if ($i) { $stack="STACK"; }
# if we've been passed a multiplier we must make a CDEF based on it!
$g_defname = $rrd['ds'];
@@ -79,7 +79,7 @@ foreach ($rrd_list as $i => $rrd)
$rrd_options .= " CDEF:" . $g_defname . $i . "min=" . $rrd['ds'] . $i . "min," . $multiplier . ",*";
$rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['ds'] . $i . "max," . $multiplier . ",*";
## If we've been passed a divider (divisor!) we make a CDEF for it.
/// If we've been passed a divider (divisor!) we make a CDEF for it.
} elseif (is_numeric($divider))
{
$g_defname = $rrd['ds'] . "_cdef";
@@ -88,7 +88,7 @@ foreach ($rrd_list as $i => $rrd)
$rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['ds'] . $i . "max," . $divider . ",/";
}
## Are our text values related to te multiplier/divisor or not?
/// Are our text values related to te multiplier/divisor or not?
if (isset($text_orig) && $text_orig)
{
$t_defname = $rrd['ds'];
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## Generate a list of ports and then call the multi_bits grapher to generate from the list
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
$i=0;
+2 -2
View File
@@ -16,7 +16,7 @@ if(is_numeric($vars['device']))
$device = device_by_name($vars['device']);
}
## FIXME -- remove these
/// FIXME -- remove these
$width = $vars['width'];
$height = $vars['height'];
@@ -43,7 +43,7 @@ if (is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.p
if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs'])
{
$auth = "1"; ## hardcode auth for all with config function
$auth = "1"; /// hardcode auth for all with config function
}
if (isset($config['allow_unauth_graphs_cidr']) && count($config['allow_unauth_graphs_cidr']) > 0)
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## Generate a list of ports and then call the multi_bits grapher to generate from the list
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
/// Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
$oids = array('dot3StatsAlignmentErrors', 'dot3StatsFCSErrors', 'dot3StatsSingleCollisionFrames', 'dot3StatsMultipleCollisionFrames',
'dot3StatsSQETestErrors', 'dot3StatsDeferredTransmissions', 'dot3StatsLateCollisions', 'dot3StatsExcessiveCollisions',
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
# FIXME uhh..
/// FIXME uhh..
if (1)
{
# $rrd_list[1]['filename'] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## Generate a list of ports and then call the multi_bits grapher to generate from the list
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
$i=0;
foreach (dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ? AND `pagpGroupIfIndex` = ?", array($port['device_id'], $port['ifIndex'])) as $int)
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
##$ds_in = "RserverCurrentConns";
##$ds_out = "RserverTotalConns";
///$ds_in = "RserverCurrentConns";
///$ds_out = "RserverTotalConns";
$scale_min = 0;
@@ -1,6 +1,6 @@
<?php
## Generate a list of ports and then call the multi_bits grapher to generate from the list
/// Generate a list of ports and then call the multi_bits grapher to generate from the list
$device = device_by_id_cache($id);
+1 -1
View File
@@ -8,7 +8,7 @@ if (is_numeric($vars['id']))
{
$device = device_by_id_cache($sensor['device_id']);
### This doesn't quite work for all yet.
/// This doesn't quite work for all yet.
#$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename($sensor['sensor_class']."-" . $sensor['sensor_type'] . "-".$sensor['sensor_index'].".rrd");
$rrd_filename = get_sensor_rrd($device, $sensor);
+1 -1
View File
@@ -8,7 +8,7 @@ if (is_numeric($vars['id']))
{
$device = device_by_id_cache($service['device_id']);
### This doesn't quite work for all yet.
/// This doesn't quite work for all yet.
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("service-" . $service['service_type'] . "-" . $service['service_id'] . ".rrd");
$title = generate_device_link($device);
+3 -3
View File
@@ -2,9 +2,9 @@
$src = device_by_id_cache($_GET['src']);
## Dear Tobias. You write in Perl, this makes me hate you forever.
## This is my translation of Smokeping's graphing.
## Thanks to Bill Fenner for Perl->Human translation:>
/// Dear Tobias. You write in Perl, this makes me hate you forever.
/// This is my translation of Smokeping's graphing.
/// Thanks to Bill Fenner for Perl->Human translation:>
$scale_min = 0;
$scale_rigid = TRUE;
+3 -3
View File
@@ -2,9 +2,9 @@
$dest = device_by_id_cache($_GET['dest']);
## Dear Tobias. You write in Perl, this makes me hate you forever.
## This is my translation of Smokeping's graphing.
## Thanks to Bill Fenner for Perl->Human translation:>
/// Dear Tobias. You write in Perl, this makes me hate you forever.
/// This is my translation of Smokeping's graphing.
/// Thanks to Bill Fenner for Perl->Human translation:>
$scale_min = 0;
$scale_rigid = TRUE;
+1 -1
View File
@@ -3,7 +3,7 @@
if(empty($graph_array['type'])) { $graph_array['type'] = $graph_type; }
if(empty($graph_array['device'])) { $graph_array['device'] = $device['device_id']; }
# FIXME not css alternating yet
/// FIXME not css alternating yet
if (!is_integer($g_i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo('<div style="background-color: '.$row_colour.';">');
+1 -1
View File
@@ -144,7 +144,7 @@ if (strpos($port['label'], "oopback") === false && !$graph_type)
unset($br);
if ($port_details)
{ ## Show which other devices are on the same subnet as this interface
{ /// Show which other devices are on the same subnet as this interface
foreach (dbFetchRows("SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `port_id` = ? AND `ipv4_address` NOT LIKE '127.%'", array($port['port_id'])) as $net)
{
$ipv4_network_id = $net['ipv4_network_id'];
+5 -5
View File
@@ -1,6 +1,6 @@
<?php
## FIXME - this could do with some performance improvements, i think. possible rearranging some tables and setting flags at poller time (nothing changes outside of then anyways)
/// FIXME - this could do with some performance improvements, i think. possible rearranging some tables and setting flags at poller time (nothing changes outside of then anyways)
$service_alerts = dbFetchCell("SELECT COUNT(service_id) FROM services WHERE service_status = '0'");
$if_alerts = dbFetchCell("SELECT COUNT(port_id) FROM `ports` WHERE `ifOperStatus` = 'down' AND `ifAdminStatus` = 'up' AND `ignore` = '0'");
@@ -320,7 +320,7 @@ $(document).ready(function() {
<?php
# FIXME does not check user permissions...
/// FIXME does not check user permissions...
foreach (dbFetchRows("SELECT sensor_class,COUNT(sensor_id) AS c FROM sensors GROUP BY sensor_class ORDER BY sensor_class ") as $row)
{
$used_sensors[$row['sensor_class']] = $row['c'];
@@ -458,7 +458,7 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
$separator++;
}
## BGP Sessions
/// BGP Sessions
if ($_SESSION['userlevel'] >= '5' && $routing_count['bgp'])
{
if ($separator)
@@ -474,7 +474,7 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
<li><a href="routing/protocol=bgp/type=internal/graph=NULL/"><img src="images/16/brick_link.png" border="0" align="absmiddle" /> BGP Internal</a></li>');
}
## Do Alerts at the bottom
/// Do Alerts at the bottom
if ($bgp_alerts)
{
echo('
@@ -511,7 +511,7 @@ if ($packages)
<?php
} # if ($packages)
### Custom menubar entries.
/// Custom menubar entries.
if(is_file("includes/print-menubar-custom.inc.php"))
{
include("includes/print-menubar-custom.inc.php");
+1 -1
View File
@@ -271,7 +271,7 @@ if (!function_exists('str_split')) {
}
}
// #####################################################
// ///////////////////////////////////////////////////#
/**
* @class QRcode
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## FIXME queries such as the one below should probably go into index.php?
/// FIXME queries such as the one below should probably go into index.php?
foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $device)
{
+3 -3
View File
@@ -229,7 +229,7 @@ if (!$vars['bare'] == "yes") {
<div style="clear:both; height:6px; display:block;"></div>
<?php
### To help debug the new URLs :)
/// To help debug the new URLs :)
if ($devel || $vars['devel'])
{
echo("<pre>");
@@ -240,7 +240,7 @@ if ($devel || $vars['devel'])
if ($_SESSION['authenticated'])
{
## Authenticated. Print a page.
/// Authenticated. Print a page.
if (isset($vars['page']) && !strstr("..", $vars['page']) && is_file("pages/" . $vars['page'] . ".inc.php"))
{
include("pages/" . $vars['page'] . ".inc.php");
@@ -254,7 +254,7 @@ if ($_SESSION['authenticated'])
}
} else {
## Not Authenticated. Print login.
/// Not Authenticated. Print login.
include("pages/logon.inc.php");
exit;
+3 -3
View File
@@ -47,7 +47,7 @@ if (is_array($config['branding']))
if (isset($_GET['device'])) { $where = "WHERE device_id = ".mres($_GET['device']); } else { $where = ""; }
## FIXME this shit probably needs tidied up.
/// FIXME this shit probably needs tidied up.
if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
{
@@ -197,7 +197,7 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
$_GET['format'] = 'png:gd';
}
if ($links > 30) ### Unflatten if there are more than 10 links. beyond that it gets messy
if ($links > 30) /// Unflatten if there are more than 10 links. beyond that it gets messy
{
# $maptool = $config['unflatten'] . ' -f -l 5 | ' . $config['sfdp'] . ' -Gpack -Gcharset=latin1 | '.$config['dot'];
$maptool = $config['neato'];
@@ -239,7 +239,7 @@ if (isset($_GET['format']) && preg_match("/^[a-z]*$/", $_GET['format']))
}
else
{
if ($_SESSION['authenticated']) ## FIXME level 10 only?
if ($_SESSION['authenticated']) /// FIXME level 10 only?
{
echo('<center>
<object width=1200 height=1000 data="'. $config['base_url'] . '/map.php?format=svg" type="image/svg+xml">
+1 -1
View File
@@ -27,7 +27,7 @@ else
$_POST['can_modify_passwd'] = 0;
}
# FIXME: missing email field here on the form
/// FIXME: missing email field here on the form
if (adduser($_POST['new_username'], $_POST['new_password'], $_POST['new_level'], '', $_POST['realname'], $_POST['can_modify_passwd']))
{
echo("<span class=info>User " . $_POST['username'] . " added!</span>");
+1 -1
View File
@@ -140,7 +140,7 @@ if (bill_permitted($bill_id))
echo("<h3>Billed Ports</h3>");
### Collected Earlier
/// Collected Earlier
foreach ($ports as $port)
{
echo(generate_port_link($port) . " on " . generate_device_link($port) . "<br />");
+1 -1
View File
@@ -31,7 +31,7 @@ if ($_POST['action'] == "reset_bill" && ($_POST['confirm'] == "rrd" || $_POST['c
dbDelete('bill_data', '`bill_id` = ?', array($bill_id));
}
if ($_POST['confirm'] == "rrd") {
### Stil todo
/// Stil todo
}
echo("<div class=infobox>Bill Reseting. Redirecting to Bills list.</div>");
+2 -2
View File
@@ -2,9 +2,9 @@
include("includes/javascript-interfacepicker.inc.php");
### This needs more verification. Is it already added? Does it exist?
/// This needs more verification. Is it already added? Does it exist?
### Calculation to extract MB/GB/TB of Kbps/Mbps/Gbps
/// Calculation to extract MB/GB/TB of Kbps/Mbps/Gbps
$base = $config["billing"]["base"];
+1 -1
View File
@@ -125,7 +125,7 @@
}
$i++;
} ### PERMITTED
} /// PERMITTED
}
echo("</table>");
+1 -1
View File
@@ -258,7 +258,7 @@ for ($x=1;$x<32;$x++) {
");
$i++;
} ### PERMITTED
} /// PERMITTED
}
echo("</table>");
}
+1 -1
View File
@@ -69,7 +69,7 @@
</tr>");
$i++;
} ### PERMITTED
} /// PERMITTED
}
}
echo("</table>");
+1 -1
View File
@@ -31,7 +31,7 @@ if ($_SESSION['userlevel'] < '10') { include("includes/error-no-perm.inc.php");
}
}
# FIXME v mysql query should be replaced by authmodule
/// FIXME v mysql query should be replaced by authmodule
$userlist = dbFetchRows("SELECT * FROM `users`");
foreach ($userlist as $userentry)
{
+2 -2
View File
@@ -184,7 +184,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
</li>');
}
### $loadbalancer_tabs is used in device/loadbalancer/ to build the submenu. we do it here to save queries
/// $loadbalancer_tabs is used in device/loadbalancer/ to build the submenu. we do it here to save queries
if ($device['os'] == "netscaler") /// Netscaler
{
@@ -207,7 +207,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
</li>');
}
### $routing_tabs is used in device/routing/ to build the tabs menu. we built it here to save some queries
/// $routing_tabs is used in device/routing/ to build the tabs menu. we built it here to save some queries
$device_routing_count['loadbalancer_rservers'] = dbFetchCell("SELECT COUNT(*) FROM `loadbalancer_rservers` WHERE `device_id` = ?", array($device['device_id']));
if ($device_routing_count['loadbalancer_rservers']) { $routing_tabs[] = 'loadbalancer_rservers'; }
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
### Sections are printed in the order they exist in $config['graph_sections']
### Graphs are printed in the order they exist in $config['graph_types']
/// Sections are printed in the order they exist in $config['graph_sections']
/// Graphs are printed in the order they exist in $config['graph_types']
$link_array = array('page' => 'device',
'device' => $device['device_id'],
+2 -2
View File
@@ -2,7 +2,7 @@
echo('<table width="100%">');
# FIXME missing heading
/// FIXME missing heading
foreach (dbFetchRows("SELECT * FROM `hrDevice` WHERE `device_id` = ? ORDER BY `hrDeviceIndex`", array($device['device_id'])) as $hrdevice)
{
@@ -45,7 +45,7 @@ foreach (dbFetchRows("SELECT * FROM `hrDevice` WHERE `device_id` = ? ORDER BY `h
$graph_array['from'] = $config['time']['day'];
$graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
# FIXME click on graph should also link to port, but can't use generate_port_link here...
/// FIXME click on graph should also link to port, but can't use generate_port_link here...
$mini_graph = overlib_link(generate_port_url($interface), generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
echo("<td>$mini_graph</td>");
+2 -2
View File
@@ -4,11 +4,11 @@ $link_array = array('page' => 'device',
'device' => $device['device_id'],
'tab' => 'loadbalancer');
## Cisco ACE
/// Cisco ACE
$type_text['loadbalancer_rservers'] = "Rservers";
$type_text['loadbalancer_vservers'] = "Serverfarms";
## Citrix Netscaler
/// Citrix Netscaler
$type_text['netscaler_vsvr'] = "VServers";
print_optionbar_start();
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
### Sections are printed in the order they exist in $config['graph_sections']
### Graphs are printed in the order they exist in $config['graph_types']
/// Sections are printed in the order they exist in $config['graph_sections']
/// Graphs are printed in the order they exist in $config['graph_types']
$link_array = array('page' => 'device',
'device' => $device['device_id'],
+2 -2
View File
@@ -57,7 +57,7 @@ if ($services['total'])
echo("</div>");
}
### FIXME - split this into overview/syslog.inc.php?
/// FIXME - split this into overview/syslog.inc.php?
if ($config['enable_syslog'])
{
$syslog = dbFetchRows("SELECT *, DATE_FORMAT(timestamp, '%Y-%m-%d %T') AS date from syslog WHERE device_id = ? ORDER BY timestamp DESC LIMIT 20", array($device['device_id']));
@@ -76,7 +76,7 @@ echo("</td>");
echo("<td style='width: 50%; vertical-align: top;'>");
### Right Pane
/// Right Pane
include("overview/processors.inc.php");
include("overview/mempools.inc.php");
include("overview/storage.inc.php");
@@ -19,9 +19,9 @@ if (count($sensors))
$sensor['sensor_current'] = "NaN";
}
### FIXME - make this "four graphs in popup" a function/include and "small graph" a function.
### FIXME - So now we need to clean this up and move it into a function. Isn't it just "print-graphrow"?
### FIXME - DUPLICATED IN health/sensors
/// FIXME - make this "four graphs in popup" a function/include and "small graph" a function.
/// FIXME - So now we need to clean this up and move it into a function. Isn't it just "print-graphrow"?
/// FIXME - DUPLICATED IN health/sensors
$graph_colour = str_replace("#", "", $row_colour);
+3 -3
View File
@@ -67,7 +67,7 @@ $link_array = array('page' => 'device',
'port' => $port['port_id']);
$menu_options['graphs'] = 'Graphs';
$menu_options['realtime'] = 'Real time'; ### FIXME CONDITIONAL
$menu_options['realtime'] = 'Real time'; /// FIXME CONDITIONAL
$menu_options['arp'] = 'ARP Table';
$menu_options['events'] = 'Eventlog';
@@ -129,8 +129,8 @@ if (dbFetchCell("SELECT count(*) FROM mac_accounting WHERE port_id = '".$port['p
if (dbFetchCell("SELECT COUNT(*) FROM juniAtmVp WHERE port_id = '".$port['port_id']."'") > "0" )
{
### FIXME ATM VPs
### FIXME URLs BROKEN
/// FIXME ATM VPs
/// FIXME URLs BROKEN
echo(" | ATM VPs : ");
if ($vars['view'] == "junose-atm-vp" && $vars['graph'] == "bits") { echo("<span class='pagemenu-selected'>"); }
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
## FIXME - REWRITE!
/// FIXME - REWRITE!
$hostname = $device['hostname'];
$hostid = $device['port_id'];
+1 -1
View File
@@ -2,7 +2,7 @@
global $config;
### FIXME functions!
/// FIXME functions!
if (!$graph_type) { $graph_type = "pagp_bits"; }
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
### FIXME - do this in a function and/or do it in graph-realtime.php
/// FIXME - do this in a function and/or do it in graph-realtime.php
if(!isset($vars['interval'])) {
if ($device['os'] == "linux") {
+3 -3
View File
@@ -70,7 +70,7 @@ if ($vars['view'] == 'minigraphs')
echo("<div style='display: block; clear: both; margin: auto; min-height: 500px;'>");
unset ($seperator);
## FIXME - FIX THIS. UGLY.
/// FIXME - FIX THIS. UGLY.
foreach (dbFetchRows("select * from ports WHERE device_id = ? ORDER BY ifIndex", array($device['device_id'])) as $port)
{
echo("<div style='display: block; padding: 3px; margin: 3px; min-width: 183px; max-width:183px; min-height:90px; max-height:90px; text-align: center; float: left; background-color: #e9e9e9;'>
@@ -96,8 +96,8 @@ if ($vars['view'] == 'minigraphs')
global $port_cache, $port_index_cache;
$ports = dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ? AND `deleted` = '0' ORDER BY `ifIndex` ASC", array($device['device_id']));
### As we've dragged the whole database, lets pre-populate our caches :)
### FIXME - we should probably split the fetching of link/stack/etc into functions and cache them here too to cut down on single row queries.
/// As we've dragged the whole database, lets pre-populate our caches :)
/// FIXME - we should probably split the fetching of link/stack/etc into functions and cache them here too to cut down on single row queries.
foreach ($ports as $port)
{
$port_cache[$port['port_id']] = $port;
+2 -2
View File
@@ -7,11 +7,11 @@ $link_array = array('page' => 'device',
#$type_text['overview'] = "Overview";
$type_text['ipsec_tunnels'] = "IPSEC Tunnels";
## Cisco ACE
/// Cisco ACE
$type_text['loadbalancer_rservers'] = "Rservers";
$type_text['loadbalancer_vservers'] = "Serverfarms";
## Citrix Netscaler
/// Citrix Netscaler
$type_text['netscaler_vsvr'] = "VServers";
$type_text['bgp'] = "BGP";
+3 -3
View File
@@ -102,7 +102,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
}
else
{
#$peername = gethostbyaddr($peer['bgpPeerIdentifier']); ## FFffuuu DNS ## Cache this in discovery?
#$peername = gethostbyaddr($peer['bgpPeerIdentifier']); /// FFffuuu DNS /// Cache this in discovery?
# if ($peername == $peer['bgpPeerIdentifier'])
# {
# unset($peername);
@@ -121,7 +121,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
$this_afisafi = $afi.$safi;
$peer['afi'] .= $sep . $afi .".".$safi;
$sep = "<br />";
$peer['afisafi'][$this_afisafi] = 1; ## Build a list of valid AFI/SAFI for this peer
$peer['afisafi'][$this_afisafi] = 1; /// Build a list of valid AFI/SAFI for this peer
}
unset($sep);
@@ -157,7 +157,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
case 'prefixes_ipv6multicast':
list(,$afisafi) = explode("_", $vars['view']);
if (isset($peer['afisafi'][$afisafi])) { $peer['graph'] = 1; }
# FIXME no break??
/// FIXME no break??
case 'updates':
$graph_array['type'] = "bgp_" . $vars['view'];
$graph_array['id'] = $peer['bgpPeer_id'];
+6 -6
View File
@@ -4,7 +4,7 @@ $i_i = "0";
echo('<table width=100% border=0 cellpadding=5>');
#### Loop Instances
/// Loop Instances
foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `device_id` = ?", array($device['device_id'])) as $instance)
{
@@ -40,7 +40,7 @@ foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `device_id` = ?", arr
echo('<table width=100% border=0 cellpadding=5>');
echo('<tr><th></th><th>Area Id</th><th>Status</th><th>Ports</th></tr>');
##### Loop Areas
///# Loop Areas
$i_a = 0;
foreach (dbFetchRows("SELECT * FROM `ospf_areas` WHERE `device_id` = ?", array($device['device_id'])) as $area)
{
@@ -61,7 +61,7 @@ foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `device_id` = ?", arr
echo('<table width=100% border=0 cellpadding=5>');
echo('<tr><th></th><th>Port</th><th>Status</th><th>Port Type</th><th>Port State</th></tr>');
##### Loop Ports
///# Loop Ports
$i_p = $i_a + 1;
$p_sql = "SELECT * FROM `ospf_ports` AS O, `ports` AS P WHERE O.`ospfIfAdminStat` = 'enabled' AND O.`device_id` = ? AND O.`ospfIfAreaId` = ? AND P.port_id = O.port_id";
foreach (dbFetchRows($p_sql, array($device['device_id'], $area['ospfAreaId'])) as $ospfport)
@@ -96,11 +96,11 @@ foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `device_id` = ?", arr
echo('</tr>');
$i_a++;
} ### End loop areas
} /// End loop areas
echo('<tr bgcolor="#ffffff"><th></th><th>Router Id</th><th>Device</th><th>IP Address</th><th>Status</th></tr>');
## Loop Neigbours
/// Loop Neigbours
$i_n = 1;
foreach (dbFetchRows("SELECT * FROM `ospf_nbrs` WHERE `device_id` = ?", array($device['device_id'])) as $nbr)
{
@@ -141,7 +141,7 @@ foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `device_id` = ?", arr
echo('</tr>');
$i_i++;
} ### End loop instances
} /// End loop instances
echo('</table>');
+1 -1
View File
@@ -2,7 +2,7 @@
include("includes/geshi/geshi.php");
# FIXME svn stuff still using optc etc, won't work, needs updating!
/// FIXME svn stuff still using optc etc, won't work, needs updating!
if ($_SESSION['userlevel'] >= "7")
{
+3 -3
View File
@@ -1,6 +1,6 @@
<?php
### Set Defaults here
/// Set Defaults here
if(!isset($vars['format'])) { $vars['format'] = "list_detail"; }
@@ -99,9 +99,9 @@ foreach (dbFetch('SELECT `features` FROM `devices` AS D WHERE 1 GROUP BY `featur
<select name="location" id="location">
<option value="">All Locations</option>
<?php
### fix me function?
/// fix me function?
foreach (getlocations() as $location) ## FIXME function name sucks maybe get_locations ?
foreach (getlocations() as $location) /// FIXME function name sucks maybe get_locations ?
{
if ($location)
{
+5 -5
View File
@@ -31,7 +31,7 @@ $sql = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id
$sql = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'");
}
### These things need to become more generic, and more manageable across different frontpages... rewrite inc :>
/// These things need to become more generic, and more manageable across different frontpages... rewrite inc :>
if ($config['warn']['ifdown'])
{
@@ -100,7 +100,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
if ($config['enable_syslog'])
{
## Open Syslog Div
/// Open Syslog Div
echo("<div style='margin: 4px; clear: both; padding: 5px;'>
<h3>Recent Syslog Messages</h3>
");
@@ -116,11 +116,11 @@ if ($config['enable_syslog'])
}
echo("</table>");
echo("</div>"); ## Close Syslog Div
echo("</div>"); /// Close Syslog Div
} else {
## Open eventlog Div
/// Open eventlog Div
echo("<div style='margin: 4px; clear: both; padding: 5px;'>
<h3>Recent Eventlog Entries</h3>
");
@@ -142,7 +142,7 @@ if ($config['enable_syslog'])
}
echo("</table>");
echo("</div>"); ## Close Syslog Div
echo("</div>"); /// Close Syslog Div
}
echo("</div>");
+5 -5
View File
@@ -95,7 +95,7 @@ $sql = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id
$sql = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'");
}
### These things need to become more generic, and more manageable across different frontpages... rewrite inc :>
/// These things need to become more generic, and more manageable across different frontpages... rewrite inc :>
if ($config['warn']['ifdown'])
{
@@ -164,7 +164,7 @@ if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== FALSE && $c
if ($config['enable_syslog'])
{
## Open Syslog Div
/// Open Syslog Div
echo("<div style='margin: 4px; clear: both; padding: 5px;'>
<h3>Recent Syslog Messages</h3>
");
@@ -180,11 +180,11 @@ if ($config['enable_syslog'])
}
echo("</table>");
echo("</div>"); ## Close Syslog Div
echo("</div>"); /// Close Syslog Div
} else {
## Open eventlog Div
/// Open eventlog Div
echo("<div style='margin: 4px; clear: both; padding: 5px;'>
<h3>Recent Eventlog Entries</h3>
");
@@ -206,7 +206,7 @@ if ($config['enable_syslog'])
}
echo("</table>");
echo("</div>"); ## Close Syslog Div
echo("</div>"); /// Close Syslog Div
}
echo("</div>");
+3 -3
View File
@@ -2,7 +2,7 @@
unset($vars['page']);
### Setup here
/// Setup here
if($_SESSION['widescreen'])
{
@@ -46,7 +46,7 @@ if (!$auth)
}
# Load our list of available graphtypes for this object
# FIXME not all of these are going to be valid
/// FIXME not all of these are going to be valid
if ($handle = opendir($config['install_dir'] . "/html/includes/graphs/".$type."/"))
{
while (false !== ($file = readdir($handle)))
@@ -238,7 +238,7 @@ if (!$auth)
echo(generate_link("Hide Legend",$vars, array('page' => "graphs", 'legend' => "no")));
}
### FIXME : do this properly
/// FIXME : do this properly
# if ($type == "port" && $subtype == "bits")
# {
echo(' | ');
+1 -1
View File
@@ -10,7 +10,7 @@ if ($used_sensors['current']) $datas[] = 'current';
if ($used_sensors['power']) $datas[] = 'power';
if ($used_sensors['dBm']) $datas[] = 'dBm';
# FIXME generalize -> static-config ?
/// FIXME generalize -> static-config ?
$type_text['overview'] = "Overview";
$type_text['temperature'] = "Temperature";
$type_text['humidity'] = "Humidity";
+1 -1
View File
@@ -18,7 +18,7 @@ foreach (dbFetchRows("SELECT * FROM `processors` AS P, `devices` AS D WHERE D.de
{
$device = $proc;
# FIXME should that really be done here? :-)
/// FIXME should that really be done here? :-)
$text_descr = $proc['processor_descr'];
$text_descr = str_replace("Routing Processor", "RP", $text_descr);
$text_descr = str_replace("Switching Processor", "SP", $text_descr);
+4 -4
View File
@@ -1,6 +1,6 @@
<?php
## FIXME - a little ugly...
/// FIXME - a little ugly...
if ($_SESSION['userlevel'] >= '5')
{
@@ -39,9 +39,9 @@ foreach (dbFetchRows($sql, $param) as $sensor)
if ($sensor['sensor_current'] >= $sensor['sensor_limit']) { $alert = '<img src="images/16/flag_red.png" alt="alert" />'; } else { $alert = ""; }
}
### FIXME - make this "four graphs in popup" a function/include and "small graph" a function.
### FIXME - So now we need to clean this up and move it into a function. Isn't it just "print-graphrow"?
### FIXME - DUPLICATED IN device/overview/sensors
/// FIXME - make this "four graphs in popup" a function/include and "small graph" a function.
/// FIXME - So now we need to clean this up and move it into a function. Isn't it just "print-graphrow"?
/// FIXME - DUPLICATED IN device/overview/sensors
$graph_colour = str_replace("#", "", $row_colour);
+4 -4
View File
@@ -2,7 +2,7 @@
$pagetitle[] = "Ports";
### Set Defaults here
/// Set Defaults here
if(!isset($vars['format'])) { $vars['format'] = "list_basic"; }
@@ -96,9 +96,9 @@ foreach ($ports as $data)
<select style="width: 200px;" name="location" id="location">
<option value="">All Locations</option>
<?php
### fix me function?
/// fix me function?
foreach (getlocations() as $location) ## FIXME function name sucks maybe get_locations ?
foreach (getlocations() as $location) /// FIXME function name sucks maybe get_locations ?
{
if ($location)
{
@@ -306,7 +306,7 @@ list($format, $subformat) = explode("_", $vars['format']);
$ports = dbFetchRows($query, $param);
### FIXME - only populate what we need to search at this point, because we shouldn't show *all* ports, as it's silly.
/// FIXME - only populate what we need to search at this point, because we shouldn't show *all* ports, as it's silly.
foreach ($ports as $p)
{
+1 -1
View File
@@ -6,7 +6,7 @@ if ($_GET['optb'] == "graphs" || $_GET['optc'] == "graphs") { $graphs = "graphs"
#$datas[] = 'overview';
### $routing_count is populated by print-menubar.inc.php
/// $routing_count is populated by print-menubar.inc.php
#$type_text['overview'] = "Overview";
$type_text['bgp'] = "BGP";
+2 -2
View File
@@ -63,7 +63,7 @@ else
echo(generate_link("Down",$vars, array('state' => 'down')));
}
## End BGP Menu
/// End BGP Menu
if (!isset($vars['view'])) { $vars['view'] = 'details'; }
@@ -184,7 +184,7 @@ else
$this_afisafi = $afi.$safi;
$peer['afi'] .= $sep . $afi .".".$safi;
$sep = "<br />";
$peer['afisafi'][$this_afisafi] = 1; ## Build a list of valid AFI/SAFI for this peer
$peer['afisafi'][$this_afisafi] = 1; /// Build a list of valid AFI/SAFI for this peer
}
unset($sep);
+2 -2
View File
@@ -5,7 +5,7 @@ $i_i = "0";
echo('<table width=100% border=0 cellpadding=10>');
echo('<tr><th>Device</th><th>Router Id</th><th>Status</th><th>ABR</th><th>ASBR</th><th>Areas</th><th>Ports</th><th>Neighbours</th></tr>');
#### Loop Instances
/// Loop Instances
foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `ospfAdminStat` = 'enabled'") as $instance)
{
@@ -40,7 +40,7 @@ foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `ospfAdminStat` = 'en
echo('</tr>');
$i_i++;
} ### End loop instances
} /// End loop instances
echo('</table>');
+1 -1
View File
@@ -177,6 +177,6 @@ if($_GET['optb'] == "all" ) {
include("includes/error-no-perm.inc.php");
} ## End Permission if
} /// End Permission if
?>