mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 08:02:51 +02:00
Minor fixes, some cleanups, and standardising on echo("x") instead of echo "x"
git-svn-id: http://www.observium.org/svn/observer/trunk@1728 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -6,17 +6,13 @@ session_start();
|
||||
|
||||
// Preflight checks
|
||||
if(!is_dir($config['rrd_dir']))
|
||||
echo "<div class='errorbox'>RRD Log Directory is missing ({$config['rrd_dir']}). Graphing may fail.</div>";
|
||||
|
||||
### RRD dir probably shouldn't be writable by apache :>
|
||||
#if(!$config['rrdcached'] && !is_writable($config['rrd_dir']))
|
||||
# echo "<div class='errorbox'>RRD Log Directory is not writable ({$config['rrd_dir']}). Graphing may fail.</div>";
|
||||
echo("<div class='errorbox'>RRD Log Directory is missing ({$config['rrd_dir']}). Graphing may fail.</div>");
|
||||
|
||||
if(!is_dir($config['temp_dir']))
|
||||
echo "<div class='errorbox'>Temp Directory is missing ({$config['tmp_dir']}). Graphing may fail.</div>";
|
||||
echo("<div class='errorbox'>Temp Directory is missing ({$config['tmp_dir']}). Graphing may fail.</div>");
|
||||
|
||||
if(!is_writable($config['temp_dir']))
|
||||
echo "<div class='errorbox'>Temp Directory is not writable ({$config['tmp_dir']}). Graphing may fail.</div>";
|
||||
echo("<div class='errorbox'>Temp Directory is not writable ({$config['tmp_dir']}). Graphing may fail.</div>");
|
||||
|
||||
if(isset($_GET['logout']) && $_SESSION['authenticated']) {
|
||||
mysql_query("INSERT INTO authlog (`user`,`address`,`result`) VALUES ('" . $_SESSION['username'] . "', '".$_SERVER["REMOTE_ADDR"]."', 'logged out')");
|
||||
@@ -50,7 +46,7 @@ if (file_exists('includes/authentication/' . $config['auth_mechanism'] . '.inc.p
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<div class='errorbox'>ERROR: no valid auth_mechanism defined</div>";
|
||||
echo("<div class='errorbox'>ERROR: no valid auth_mechanism defined</div>");
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ function authenticate($username,$password)
|
||||
}
|
||||
else
|
||||
{
|
||||
echo ldap_error($ds);
|
||||
echo(ldap_error($ds));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -93,7 +93,7 @@ function generate_graph_popup($graph_array)
|
||||
|
||||
function print_graph_popup($graph_array)
|
||||
{
|
||||
echo (generate_graph_popup($graph_array));
|
||||
echo(generate_graph_popup($graph_array));
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ function device_permitted($device_id)
|
||||
|
||||
function print_graph_tag ($args)
|
||||
{
|
||||
echo generate_graph_tag ($args);
|
||||
echo(generate_graph_tag ($args));
|
||||
}
|
||||
|
||||
function generate_graph_tag ($args)
|
||||
@@ -260,7 +260,7 @@ function generate_port_thumbnail($args)
|
||||
if(!$args['bg']) { $args['bg'] = "FFFFF"; }
|
||||
$args['content'] = "<img src='graph.php?type=".$args['graph_type']."&id=".$args['interface_id']."&from=".$args['from']."&to=".$args['to']."&width=".$args['width']."&height=".$args['height']."&legend=no&bg=".$args['bg']."'>";
|
||||
$output = generate_port_link($args, $args['content']);
|
||||
echo $output;
|
||||
echo($output);
|
||||
}
|
||||
|
||||
function print_optionbar_start ($height = 20, $width = 0, $marginbottom = 5)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
$iftype = fixiftype($interface[ifType]);
|
||||
|
||||
echo ("<p class=interface-header>$inf</p>");
|
||||
echo("<p class=interface-header>$inf</p>");
|
||||
if($ifalias && $ifalias != "") { echo("<span class=box-desc>$ifalias</span><br />"); }
|
||||
if($iftype && $iftype != "") { echo("<span class=box-desc>$iftype</span> ");
|
||||
if($mac && $mac != "") { echo("<span class=box-desc>$mac</span><br />");
|
||||
@@ -17,6 +17,6 @@
|
||||
echo("</span>");
|
||||
}
|
||||
|
||||
echo ("<span class=box-desc><b>$status</b></span>");
|
||||
echo("<span class=box-desc><b>$status</b></span>");
|
||||
|
||||
?>
|
||||
|
||||
@@ -54,12 +54,12 @@ if (isset($config['enable_bgp']) && $config['enable_bgp'])
|
||||
|
||||
foreach ($config['device_types'] as $devtype)
|
||||
{
|
||||
echo ' <li><a href="devices/' . $devtype['type'] . '/"><img src="images/icons/' . $devtype['icon'] . '" border="0" align="absmiddle" /> ' . $devtype['text'] . '</a></li>';
|
||||
echo(' <li><a href="devices/' . $devtype['type'] . '/"><img src="images/icons/' . $devtype['icon'] . '" border="0" align="absmiddle" /> ' . $devtype['text'] . '</a></li>');
|
||||
}
|
||||
|
||||
?>
|
||||
<li><hr width="140" /></li>
|
||||
<li><a href="devices/alerted/"><img src="images/16/server_error.png" border="0" align="absmiddle" /> Alerts (<?php echo $device_alerts ?>)</a></li>
|
||||
<li><a href="devices/alerted/"><img src="images/16/server_error.png" border="0" align="absmiddle" /> Alerts (<?php echo($device_alerts) ?>)</a></li>
|
||||
<?php
|
||||
if ($_SESSION['userlevel'] >= '10') {
|
||||
echo('
|
||||
@@ -118,7 +118,7 @@ if ($config['show_locations'])
|
||||
{
|
||||
if ($row['location'] != '')
|
||||
{
|
||||
echo ' <li><a href="?page=devices&location=' . urlencode($row['location']) . '"><img src="images/16/building.png" border="0" align="absmiddle" /> ' . $row['location'] . ' </a></li>';
|
||||
echo(' <li><a href="?page=devices&location=' . urlencode($row['location']) . '"><img src="images/16/building.png" border="0" align="absmiddle" /> ' . $row['location'] . ' </a></li>');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -277,7 +277,7 @@ echo(' <li><hr /></li>
|
||||
<li><a href="?page=edituser"><img src="images/16/user_edit.png" border="0" align="absmiddle" /> Edit User</a></li>
|
||||
<li><hr width="140" /></li>');
|
||||
}
|
||||
echo ('
|
||||
echo('
|
||||
<li><a href="authlog/"><img src="images/16/lock.png" border="0" align="absmiddle" /> Authlog</a></li>');
|
||||
} ?>
|
||||
</ul>
|
||||
|
||||
+18
-18
@@ -48,39 +48,39 @@ if($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['b
|
||||
|
||||
|
||||
<table cellpadding="2" cellspacing="0" border="0">
|
||||
<tr style="background-color: <?php echo $devices[bgcolour]; ?>">
|
||||
<tr style="background-color: <?php echo($devices[bgcolour]); ?>">
|
||||
<td width="5"></td>
|
||||
<td>Devices : </td>
|
||||
<td><?php echo $devices['count'] ?></td>
|
||||
<td><?php echo($devices['count']) ?></td>
|
||||
<td> ( </td>
|
||||
<td style="text-align: right"><span class="green"> <?php echo $devices['up'] ?> up</span></td>
|
||||
<td style="text-align: right"><span class="red"> <?php echo $devices['down'] ?> down</span></td>
|
||||
<td style="text-align: right"><span class="black"> <?php echo $devices['ignored'] ?> ignored</span> </td>
|
||||
<td style="text-align: right"><span class="grey"> <?php echo $devices['disabled'] ?> disabled</span></td>
|
||||
<td style="text-align: right"><span class="green"> <?php echo($devices['up']) ?> up</span></td>
|
||||
<td style="text-align: right"><span class="red"> <?php echo($devices['down']) ?> down</span></td>
|
||||
<td style="text-align: right"><span class="black"> <?php echo($devices['ignored']) ?> ignored</span> </td>
|
||||
<td style="text-align: right"><span class="grey"> <?php echo($devices['disabled']) ?> disabled</span></td>
|
||||
<td> ) </td>
|
||||
<td width="5"></td>
|
||||
</tr>
|
||||
<tr style="background-color: <?php echo $ports['bgcolour'] ?>">
|
||||
<tr style="background-color: <?php echo($ports['bgcolour']) ?>">
|
||||
<td width="5"></td><td>Ports : </td>
|
||||
<td><?php echo $ports['count'] ?></td>
|
||||
<td><?php echo($ports['count']) ?></td>
|
||||
<td> ( </td>
|
||||
<td style="text-align: right"><span class="green"> <?php echo $ports['up'] ?> up </span></td>
|
||||
<td style="text-align: right"><span class="red"> <?php echo $ports['down'] ?> down </span></td>
|
||||
<td style="text-align: right"><span class="black"> <?php echo $ports['ignored'] ?> ignored </span></td>
|
||||
<td style="text-align: right"><span class="grey"> <?php echo $ports['shutdown'] ?> shutdown</span></td>
|
||||
<td style="text-align: right"><span class="green"> <?php echo($ports['up']) ?> up </span></td>
|
||||
<td style="text-align: right"><span class="red"> <?php echo($ports['down']) ?> down </span></td>
|
||||
<td style="text-align: right"><span class="black"> <?php echo($ports['ignored']) ?> ignored </span></td>
|
||||
<td style="text-align: right"><span class="grey"> <?php echo($ports['shutdown']) ?> shutdown</span></td>
|
||||
<td> ) </td>
|
||||
<td width="5"></td>
|
||||
</tr>
|
||||
<?php if ($config['show_services']) { ?>
|
||||
<tr style="background-color: <?php echo $services['bgcolour'] ?>">
|
||||
<tr style="background-color: <?php echo($services['bgcolour']) ?>">
|
||||
<td width="5"></td>
|
||||
<td>Services : </td>
|
||||
<td><?php echo $services['count'] ?></td>
|
||||
<td><?php echo($services['count']) ?></td>
|
||||
<td> ( </td>
|
||||
<td style="text-align: right"><span class="green"><?php echo $services['up'] ?> up</span></td>
|
||||
<td style="text-align: right"><span class="red"> <?php echo $services['down'] ?> down</span></td>
|
||||
<td style="text-align: right"><span class="black"> <?php echo $services['ignored'] ?> ignored</span> </td>
|
||||
<td style="text-align: right"><span class="grey"> <?php echo $services['disabled'] ?> disabled</span></td>
|
||||
<td style="text-align: right"><span class="green"><?php echo($services['up']) ?> up</span></td>
|
||||
<td style="text-align: right"><span class="red"> <?php echo($services['down']) ?> down</span></td>
|
||||
<td style="text-align: right"><span class="black"> <?php echo($services['ignored']) ?> ignored</span> </td>
|
||||
<td style="text-align: right"><span class="grey"> <?php echo($services['disabled']) ?> disabled</span></td>
|
||||
<td> ) </td>
|
||||
<td width="5"></td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user