Commit aa3dff2b authored by Leigh Stoller's avatar Leigh Stoller

Fix PHP warnings.

parent dd5a0287
......@@ -40,7 +40,7 @@ function find_switch_macs(&$mac_list) {
$switch = $matches[1];
$card = $matches[2];
$port = $matches[3];
if ($mac_list[$MAC] &&
if (isset($mac_list[$MAC]) &&
(is_null($mac_list[$MAC]["class"]) ||
!isset($mac_list[$MAC]["class"]) ||
($mac_list[$MAC]["class"] == $class))) {
......@@ -187,7 +187,7 @@ function guess_IP ($prefix, $number) {
" i.role='" . TBDB_IFACEROLE_CONTROL . "'");
if (mysql_num_rows($query_result)) {
$row = mysql_fetch_array($query_result);
$IP = $row[IP];
$IP = $row["IP"];
break;
}
......@@ -196,7 +196,7 @@ function guess_IP ($prefix, $number) {
"where node_id='$node'");
if (mysql_num_rows($query_result)) {
$row = mysql_fetch_array($query_result);
$IP = $row[IP];
$IP = $row["IP"];
break;
}
......
......@@ -130,7 +130,7 @@ if (isset($use_temp_IP)) {
#
# Handle the node type
#
if ($type) {
if (isset($type) && $type != "") {
#
# If they gave us a type, lets see if that type exists or not
#
......@@ -163,7 +163,7 @@ $role = (isset($role) ? addslashes($role) : "testnode");
#
# Stash this information in the database
#
if ($identifier) {
if (isset($identifier) && $identifier != "") {
$identifier = "'" . addslashes($identifier) . "'";
} else {
$identifier = "NULL";
......
......@@ -144,7 +144,7 @@ if (isset($research)) {
"where $whereclause_qualified");
$mac_list = array();
while ($row = mysql_fetch_array($query_result)) {
$type = $row["is_control"];
$type = $row["type"];
$card = $row["card"];
$iface = "eth${card}";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment