Merge pull request #93 from laf/issue-92

Resolved critical bugs from scrutinizer
This commit is contained in:
Paul Gear 2014-02-23 07:15:36 +10:00
commit e8815831f7
7 changed files with 9 additions and 9 deletions

View File

@ -26,7 +26,7 @@ foreach (dbFetchRows("SELECT *, A.id AS id FROM `alerts` AS A, `devices` AS D WH
$msg = $alert['message']; $msg = $alert['message'];
$alert_text .= "$date $host $msg"; $alert_text .= "$date $host $msg";
dbUpdate(array('alerted' => '1'), 'alerts', '`id` = ?' array($id)) dbUpdate(array('alerted' => '1'), 'alerts', '`id` = ?', array($id));
} }

View File

@ -20,7 +20,7 @@ include("includes/functions.php");
$handle = fopen("ips.txt", "w"); $handle = fopen("ips.txt", "w");
foreach (dbFetchRows("SELECT * FROM `ipv4_networks`")) foreach (dbFetchRows("SELECT * FROM `ipv4_networks`") as $data)
{ {
$cidr = $data['ipv4_network']; $cidr = $data['ipv4_network'];
list ($network, $bits) = explode("/", $cidr); list ($network, $bits) = explode("/", $cidr);

View File

@ -28,7 +28,7 @@ $rrd_options .= " DEF:rtt=$rrd_file:rtt:AVERAGE ";
$rrd_options .= " VDEF:avg=rtt,AVERAGE "; $rrd_options .= " VDEF:avg=rtt,AVERAGE ";
$rrd_options .= " LINE1:avg#CCCCFF:'".str_pad('Average',$descr_len-3)."':dashes"; $rrd_options .= " LINE1:avg#CCCCFF:'".str_pad('Average',$descr_len-3)."':dashes";
$rrd_options .= " GPRINT:rtt:AVERAGE:%4.1lf".$unit."\\\l "; $rrd_options .= " GPRINT:rtt:AVERAGE:%4.1lf".$unit."\\\l ";
$rrd_options .= " LINE1:rtt#CC0000:'" . rrdtool_escape($descr,$descr_len-3)) . "'"; $rrd_options .= " LINE1:rtt#CC0000:'" . rrdtool_escape($descr,$descr_len-3) . "'";
$rrd_options .= " GPRINT:rtt:LAST:%4.1lf".$unit." "; $rrd_options .= " GPRINT:rtt:LAST:%4.1lf".$unit." ";
$rrd_options .= " GPRINT:rtt:MIN:%4.1lf".$unit." "; $rrd_options .= " GPRINT:rtt:MIN:%4.1lf".$unit." ";
$rrd_options .= " GPRINT:rtt:MAX:%4.1lf".$unit."\\\l "; $rrd_options .= " GPRINT:rtt:MAX:%4.1lf".$unit."\\\l ";

View File

@ -170,7 +170,7 @@
// Transfer overview // Transfer overview
function transferOverview($bill_id, $history) { function transferOverview($bill_id, $history) {
global $list_colour_a, $list_colour_b, $config['billing']['base']; global $list_colour_a, $list_colour_b, $config;
$i = 0; $i = 0;
$tot = array(); $tot = array();

View File

@ -34,7 +34,7 @@ foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $dev);
if ($updated) { print_message("Device Settings Saved"); } if ($updated) { print_message("Device Settings Saved"); }
if (dbFetchCell("SELECT COUNT(*) from `services` WHERE `device_id` = ?" array($device['device_id'])) > '0') if (dbFetchCell("SELECT COUNT(*) from `services` WHERE `device_id` = ?", array($device['device_id'])) > '0')
{ {
$i = "1"; $i = "1";
foreach (dbFetchRows("select * from services WHERE device_id = ? ORDER BY service_type", array($device['device_id'])) as $service) foreach (dbFetchRows("select * from services WHERE device_id = ? ORDER BY service_type", array($device['device_id'])) as $service)
@ -43,7 +43,7 @@ if (dbFetchCell("SELECT COUNT(*) from `services` WHERE `device_id` = ?" array($d
} }
} }
if($existform if($existform)
{ {
echo('<div style="float: left;">'); echo('<div style="float: left;">');
echo(" echo("

View File

@ -15,7 +15,7 @@ $sep = "";
foreach ($menu_options as $option => $text) foreach ($menu_options as $option => $text)
{ {
if ($_GET['type'] == $option) { echo("<span class='pagemenu-selected'>"); } if ($_GET['type'] == $option) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="'.generate_url($vars, array('type' => $option)).'">'.$text.'</a>') echo('<a href="'.generate_url($vars, array('type' => $option)).'">'.$text.'</a>');
if ($_GET['type'] == $option) { echo("</span>"); } if ($_GET['type'] == $option) { echo("</span>"); }
echo(" | "); echo(" | ");
} }
@ -33,7 +33,7 @@ foreach ($graph_types as $type => $descr)
echo("$type_sep"); echo("$type_sep");
if ($_GET['opte'] == $type) { echo("<span class='pagemenu-selected'>"); } if ($_GET['opte'] == $type) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/type=loadbalancer_vservers/graphs/'.$type.'/">'.$descr.'</a>'); echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/type=loadbalancer_vservers/graphs/'.$type.'/">'.$descr.'</a>');
echo('<a href="'.generate_url($vars, array('type' => 'loadbalancer_ace_vservers')).'">'.$text.'</a>') echo('<a href="'.generate_url($vars, array('type' => 'loadbalancer_ace_vservers')).'">'.$text.'</a>');
if ($_GET['opte'] == $type) { echo("</span>"); } if ($_GET['opte'] == $type) { echo("</span>"); }
$type_sep = " | "; $type_sep = " | ";

View File

@ -56,7 +56,7 @@
} }
function clearStats($mailstats) { function clearStats($mailstats) {
if (file_exists($mailstats) { if (file_exists($mailstats)) {
$fp = fopen($mailstats, 'w'); $fp = fopen($mailstats, 'w');
fwrite($fp, "mess_recv:0\n"); fwrite($fp, "mess_recv:0\n");
fwrite($fp, "mess_rejected:0\n"); fwrite($fp, "mess_rejected:0\n");