diff --git a/html/images/icons/greyscale/port.png b/html/images/icons/greyscale/port.png new file mode 100644 index 000000000..1d9c3fd22 Binary files /dev/null and b/html/images/icons/greyscale/port.png differ diff --git a/html/images/icons/greyscale/ports.png b/html/images/icons/greyscale/ports.png new file mode 100644 index 000000000..1d9c3fd22 Binary files /dev/null and b/html/images/icons/greyscale/ports.png differ diff --git a/html/images/icons/ports.png b/html/images/icons/ports.png new file mode 100755 index 000000000..024138eb3 Binary files /dev/null and b/html/images/icons/ports.png differ diff --git a/html/includes/port-edit.inc.php b/html/includes/port-edit.inc.php new file mode 100644 index 000000000..dc54512c3 --- /dev/null +++ b/html/includes/port-edit.inc.php @@ -0,0 +1,49 @@ + $val) { + if (strncmp($key,"oldval_",7) == 0) { + + # Interface identifier passed as part of the field name + # + $interface_id = intval(substr($key,7)); + + $oldval = intval($val) ? 1 : 0; + $newval = $_POST['ignore_'.$interface_id] ? 1 : 0; + + # As checkboxes are not posted when unset - we effectively need to do a diff to work + # out a set->unset case. + # + if ($oldval == $newval) + continue; + + if (!mysql_query('UPDATE `ports` SET `ignore`='.$newval.' WHERE `device_id`='.$device_id.' AND `interface_id`='.$interface_id)) + $n = -1; + else + $n = mysql_affected_rows(); + + if ($n <0) { + $rows_updated = -1; + break; + }; + $rows_updated += $n; + }; +}; + + if($rows_updated > 0) { + $update_message = $rows_updated . " Device record updated."; + $updated = 1; + } elseif ($rows_updated = '-1') { + $update_message = "Device record unchanged. No update necessary."; + $updated = -1; + } else { + $update_message = "Device record update error."; + $updated = 0; + } + +?> diff --git a/html/pages/device/edit.inc.php b/html/pages/device/edit.inc.php index 7e0f0def5..155c582d4 100644 --- a/html/pages/device/edit.inc.php +++ b/html/pages/device/edit.inc.php @@ -6,6 +6,7 @@ if($_SESSION['userlevel'] < '7') { $panes = array('device' => 'Device Settings', + 'ports' => 'Port Settings', 'apps' => 'Applications', 'services' => 'Services'); diff --git a/html/pages/device/edit/ports.inc.php b/html/pages/device/edit/ports.inc.php new file mode 100644 index 000000000..c0c587f47 --- /dev/null +++ b/html/pages/device/edit/ports.inc.php @@ -0,0 +1,51 @@ +'); + +if($_POST['ignoreport']) { + if($_SESSION['userlevel'] == '10') { + include("includes/port-edit.inc.php"); + } +} + + +if($updated && $update_message) { + print_message($update_message); +} elseif ($update_message) { + print_error($update_message); +} + +echo("