diff --git a/html/includes/authentication/ldap.inc.php b/html/includes/authentication/ldap.inc.php index f6b0be082..7e99173ad 100644 --- a/html/includes/authentication/ldap.inc.php +++ b/html/includes/authentication/ldap.inc.php @@ -139,6 +139,7 @@ function deluser($username) function get_userlist() { global $config, $ds; + $userlist = array(); $filter = '(' . $config['auth_ldap_prefix'] . '*)'; diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 4a6b7f201..3ba26544c 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -102,7 +102,7 @@ function generate_overlib_content($graph_array, $text) function get_percentage_colours($percentage) { - + $background = array(); if ($percentage > '90') { $background['left']='c4323f'; $background['right']='C96A73'; } elseif ($percentage > '75') { $background['left']='bf5d5b'; $background['right']='d39392'; } elseif ($percentage > '50') { $background['left']='bf875b'; $background['right']='d3ae92'; } @@ -330,7 +330,7 @@ function print_graph_tag($args) function generate_graph_tag($args) { - + $urlargs = array(); foreach ($args as $key => $arg) { $urlargs[] = $key."=".$arg; @@ -410,6 +410,7 @@ function generate_port_link($port, $text = NULL, $type = NULL) { global $config; + $graph_array = array(); $port = ifNameDescr($port); if (!$text) { $text = fixIfName($port['label']); } if ($type) { $port['graph_type'] = $type; } @@ -535,6 +536,8 @@ function devclass($device) function getlocations() { + $ignore_dev_location = array(); + $locations = array(); # Fetch override locations, not through get_dev_attrib, this would be a huge number of queries $rows = dbFetchRows("SELECT attrib_type,attrib_value,device_id FROM devices_attribs WHERE attrib_type LIKE 'override_sysLocation%' ORDER BY attrib_type"); foreach ($rows as $row) @@ -610,6 +613,7 @@ function generate_ap_link($args, $text = NULL, $type = NULL) $content = "
".$args['text']." - " . fixifName($args['label']) . "
"; if ($args['ifAlias']) { $content .= $args['ifAlias']."
"; } $content .= "
"; + $graph_array = array(); $graph_array['type'] = $args['graph_type']; $graph_array['legend'] = "yes"; $graph_array['height'] = "100"; diff --git a/html/pages/bill/pdf_history.inc.php b/html/pages/bill/pdf_history.inc.php index 77eb8c53a..b9b2f3607 100644 --- a/html/pages/bill/pdf_history.inc.php +++ b/html/pages/bill/pdf_history.inc.php @@ -110,6 +110,7 @@ // Device Information function listBillPorts($bill_id) { + $device = array(); $res = ""; $res .= ""; $res .= " "; @@ -146,6 +147,7 @@ // Bitrate Graph overview function graphOverviewBitrate($bill_id, $history) { global $pdf; + $img = array(); $img['bitrate'] = genGraphs($bill_id, "bitrate", $history['timestampfrom'], $history['timestampto'], $history['type']); $bitrate = $pdf->serializeTCPDFtagParameters(array($img['bitrate'], 10, 44, 280, '', 'PNG', '', 'T')); @@ -157,6 +159,7 @@ // Transfer Graph overview function graphOverviewTransfer($bill_id, $history) { global $pdf; + $img = array(); $img['bw_day'] = genGraphs($bill_id, "day", $history['timestampfrom'], $history['timestampto']); $img['bw_hour'] = genGraphs($bill_id, "hour", $history['timestampfrom'], $history['timestampto']); diff --git a/includes/billing.php b/includes/billing.php index 52ac54c0d..5952b165d 100644 --- a/includes/billing.php +++ b/includes/billing.php @@ -49,6 +49,7 @@ function getDates($dayofmonth, $months=0) $last_from = date_format($date_start, 'Ymd') . "000000"; $last_to = date_format($date_end, 'Ymd') . "235959"; + $return = array(); $return['0'] = $date_from; $return['1'] = $date_to; $return['2'] = $last_from; @@ -76,6 +77,7 @@ function getValue($host, $port, $id, $inout) function getLastPortCounter($port_id,$inout) { + $return = array(); $rows = dbFetchCell("SELECT count(counter) from `port_" . mres($inout) . "_measurements` WHERE `port_id`='" . mres($port_id)."'"); if ($rows > 0) @@ -92,6 +94,7 @@ function getLastPortCounter($port_id,$inout) function getLastMeasurement($bill_id) { + $return = array(); $rows = dbFetchCell("SELECT count(delta) from bill_data WHERE bill_id='".mres($bill_id)."'"); if ($rows > 0) @@ -142,6 +145,7 @@ function get95thout($bill_id,$datefrom,$dateto) function getRates($bill_id,$datefrom,$dateto) { + $data = array(); $mq_text = "SELECT count(delta) FROM bill_data "; $mq_text .= " WHERE bill_id = '".mres($bill_id)."'"; $mq_text .= " AND timestamp > '".mres($datefrom)."' AND timestamp <= '".mres($dateto)."'"; diff --git a/includes/common.php b/includes/common.php index 39de0bfd1..1436df8d2 100644 --- a/includes/common.php +++ b/includes/common.php @@ -147,6 +147,7 @@ function get_port_by_ifIndex($device_id, $ifIndex) function get_all_devices($device, $type = "") { global $cache; + $devices = array(); // FIXME needs access control checks! // FIXME respect $type (server, network, etc) -- needs an array fill in topnav. diff --git a/includes/functions.php b/includes/functions.php index 90a807cbf..9684a475d 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -132,6 +132,7 @@ function percent_colour($perc) function interface_errors($rrd_file, $period = '-1d') // Returns the last in/out errors value in RRD { global $config; + $errors = array(); $cmd = $config['rrdtool']." fetch -s $period -e -300s $rrd_file AVERAGE | grep : | cut -d\" \" -f 4,5"; $data = trim(shell_exec($cmd)); @@ -584,6 +585,7 @@ function match_network($nets, $ip, $first=false) function snmp2ipv6($ipv6_snmp) { $ipv6 = explode('.',$ipv6_snmp); + $ipv6_2 = array(); # Workaround stupid Microsoft bug in Windows 2008 -- this is fixed length! # < fenestro> "because whoever implemented this mib for Microsoft was ignorant of RFC 2578 section 7.7 (2)" @@ -600,6 +602,7 @@ function snmp2ipv6($ipv6_snmp) function ipv62snmp($ipv6) { + $ipv6_split = array(); $ipv6_ex = explode(':',Net_IPv6::uncompress($ipv6)); for ($i = 0;$i < 8;$i++) { $ipv6_ex[$i] = zeropad($ipv6_ex[$i],4); } $ipv6_ip = implode('',$ipv6_ex); diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php index 3f26df736..4f3419eda 100644 --- a/includes/polling/functions.inc.php +++ b/includes/polling/functions.inc.php @@ -222,6 +222,7 @@ function poll_device($device, $options) rrdtool_update($ping_rrd, "N:$ping_time"); } + $update_array = array(); $update_array['last_polled'] = array('NOW()'); $update_array['last_polled_timetaken'] = $device_time; $update_array['last_ping'] = array('NOW()'); diff --git a/includes/rrdtool.inc.php b/includes/rrdtool.inc.php index 097d64366..c8f197ee0 100644 --- a/includes/rrdtool.inc.php +++ b/includes/rrdtool.inc.php @@ -205,6 +205,7 @@ function rrdtool_create($filename, $options) function rrdtool_update($filename, $options) { + $values = array(); // Do some sanitisation on the data if passed as an array. if (is_array($options)) { diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index c5d0117a6..72286d1d6 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -53,6 +53,7 @@ function snmp_get_multi($device, $oids, $options = "-OQUs", $mib = NULL, $mibdir if (!$debug) { $cmd .= " 2>/dev/null"; } $data = trim(external_exec($cmd)); $runtime_stats['snmpget']++; + $array = array(); foreach (explode("\n", $data) as $entry) { list($oid,$value) = explode("=", $entry); @@ -189,7 +190,7 @@ function snmp_walk($device, $oid, $options = NULL, $mib = NULL, $mibdir = NULL) return $data; } -function snmpwalk_cache_cip($device, $oid, $array, $mib = 0) +function snmpwalk_cache_cip($device, $oid, $array = array(), $mib = 0) { global $config; diff --git a/scripts/mailscanner.php b/scripts/mailscanner.php index 9075933f0..b80fdb9ff 100644 --- a/scripts/mailscanner.php +++ b/scripts/mailscanner.php @@ -43,6 +43,7 @@ } } } + $var = array(); $var['mess_recv'] = (isset($stats['mess_recv']) ? $stats['mess_recv'] : "U"); $var['mess_rejected'] = (isset($stats['mess_rejected']) ? $stats['mess_rejected'] : "U"); $var['mess_relay'] = (isset($stats['mess_relay']) ? $stats['mess_relay'] : "U"); diff --git a/scripts/ntp-client.php b/scripts/ntp-client.php index 61f33e892..bfabaf33c 100644 --- a/scripts/ntp-client.php +++ b/scripts/ntp-client.php @@ -60,6 +60,7 @@ } } } + $var = array(); $var['offset'] = (isset($ntp['offset']) ? $ntp['offset'] : "U"); $var['frequency'] = (isset($ntp['frequency']) ? $ntp['frequency'] : "U"); if ($newstats_style) { diff --git a/scripts/ntpd-server.php b/scripts/ntpd-server.php index 7650b368d..04289e8f5 100644 --- a/scripts/ntpd-server.php +++ b/scripts/ntpd-server.php @@ -58,6 +58,7 @@ } } } + $var = array(); $var['stratum'] = (isset($ntpd['stratum']) ? $ntpd['stratum'] : "U"); $var['offset'] = (isset($ntpd['offset']) ? $ntpd['offset'] : "U"); $var['frequency'] = (isset($ntpd['frequency']) ? $ntpd['frequency'] : "U"); diff --git a/scripts/powerdns.php b/scripts/powerdns.php index 41d24e099..bb222348c 100755 --- a/scripts/powerdns.php +++ b/scripts/powerdns.php @@ -51,6 +51,7 @@ } } } + $var = array(); $var['corrupt-packets'] = (isset($pdns['corrupt-packets']) ? $pdns['corrupt-packets'] : "U"); $var['deferred-cache-inserts'] = (isset($pdns['deferred-cache-inserts']) ? $pdns['deferred-cache-inserts'] : "U"); $var['deferred-cache-lookup'] = (isset($pdns['deferred-cache-lookup']) ? $pdns['deferred-cache-lookup'] : "U"); diff --git a/scripts/removespikes.php b/scripts/removespikes.php index b088ad5b0..c4e7d31f4 100755 --- a/scripts/removespikes.php +++ b/scripts/removespikes.php @@ -656,6 +656,7 @@ function outputStatistics($rra) { function updateXML(&$output, &$rra) { global $numspike, $percent, $avgnan, $method, $total_kills; + $new_array = array(); /* variance subroutine */ $rra_num = 0; @@ -797,6 +798,7 @@ function debug($string) { function standard_deviation($samples) { $sample_count = count($samples); + $sample_square = array(); for ($current_sample = 0; $sample_count > $current_sample; ++$current_sample) { $sample_square[$current_sample] = pow($samples[$current_sample], 2); diff --git a/scripts/shoutcast.php b/scripts/shoutcast.php index a9a428cba..f00118e90 100644 --- a/scripts/shoutcast.php +++ b/scripts/shoutcast.php @@ -73,6 +73,7 @@ function doSNMPv2($vars) { $res = array(); foreach ($vars as $items=>$server) { + $var = array(); $var['bitrate'] = (isset($server['5']) ? (($server['5'] / 8) * 1000) : "0"); //$var['bitrate'] = (isset($server['5']) ? ($server['5'] * 1024) : "0"); $var['traf_in'] = (isset($server['1']) ? ($var['bitrate'] * $server['1']) : "0");