Commit 0bc35548 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) refactor interfaces_bridge_edit.php

parent f47013c9
...@@ -36,86 +36,71 @@ require_once("unbound.inc"); ...@@ -36,86 +36,71 @@ require_once("unbound.inc");
require_once("services.inc"); require_once("services.inc");
$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_bridge.php'); if (!isset($config['bridges']) || !is_array($config['bridges'])) {
if (!is_array($config['bridges'])) {
$config['bridges'] = array(); $config['bridges'] = array();
} }
if (!isset($config['bridges']['bridged']) || !is_array($config['bridges']['bridged'])) {
if (!is_array($config['bridges']['bridged'])) {
$config['bridges']['bridged'] = array(); $config['bridges']['bridged'] = array();
} }
$a_bridges = &$config['bridges']['bridged']; $a_bridges = &$config['bridges']['bridged'];
$ifacelist = get_configured_interface_with_descr(); // interface list
foreach ($ifacelist as $bif => $bdescr) { $ifacelist = array();
if (substr(get_real_interface($bif), 0, 3) == "gre") foreach (get_configured_interface_with_descr() as $bif => $bdescr) {
unset($ifacelist[$bif]); if (substr(get_real_interface($bif), 0, 3) != "gre") {
$ifacelist[$bif] = $bdescr;
}
} }
if (is_numericint($_GET['id']))
$id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id']))
$id = $_POST['id'];
if (isset($id) && $a_bridges[$id]) { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// read form data
if (!empty($a_bridges[$_GET['id']])) {
$id = $_GET['id'];
}
// copy fields 1-on-1
$copy_fields = array('descr', 'bridgeif', 'maxaddr', 'timeout', 'maxage','fwdelay', 'hellotime', 'priority', 'proto', 'holdcnt', 'span');
foreach ($copy_fields as $fieldname) {
if (isset($a_bridges[$id][$fieldname])) {
$pconfig[$fieldname] = $a_bridges[$id][$fieldname];
} else {
$pconfig[$fieldname] = null;
}
}
// bool fields
$pconfig['enablestp'] = isset($a_bridges[$id]['enablestp']); $pconfig['enablestp'] = isset($a_bridges[$id]['enablestp']);
$pconfig['descr'] = $a_bridges[$id]['descr'];
$pconfig['bridgeif'] = $a_bridges[$id]['bridgeif']; // simple array fields
$pconfig['members'] = $a_bridges[$id]['members']; $array_fields = array('members', 'stp', 'edge', 'autoedge', 'ptp', 'autoptp', 'static', 'private');
$pconfig['maxaddr'] = $a_bridges[$id]['maxaddr']; foreach ($array_fields as $fieldname) {
$pconfig['timeout'] = $a_bridges[$id]['timeout']; if (!empty($a_bridges[$id][$fieldname])) {
if ($a_bridges[$id]['static']) $pconfig[$fieldname] = explode(',', $a_bridges[$id][$fieldname]);
$pconfig['static'] = $a_bridges[$id]['static']; } else {
if ($a_bridges[$id]['private']) $pconfig[$fieldname] = array();
$pconfig['private'] = $a_bridges[$id]['private']; }
if (isset($a_bridges[$id]['stp'])) }
$pconfig['stp'] = $a_bridges[$id]['stp'];
$pconfig['maxage'] = $a_bridges[$id]['maxage']; // array key/value sets
$pconfig['fwdelay'] = $a_bridges[$id]['fwdelay'];
$pconfig['hellotime'] = $a_bridges[$id]['hellotime'];
$pconfig['priority'] = $a_bridges[$id]['priority'];
$pconfig['proto'] = $a_bridges[$id]['proto'];
$pconfig['holdcnt'] = $a_bridges[$id]['holdcnt'];
if (!empty($a_bridges[$id]['ifpriority'])) { if (!empty($a_bridges[$id]['ifpriority'])) {
$pconfig['ifpriority'] = explode(",", $a_bridges[$id]['ifpriority']); foreach (explode(",", $a_bridges[$id]['ifpriority']) as $cfg) {
$ifpriority = array();
foreach ($pconfig['ifpriority'] as $cfg) {
list ($key, $value) = explode(":", $cfg); list ($key, $value) = explode(":", $cfg);
$embprioritycfg[$key] = $value; $pconfig['ifpriority_'.$key] = $value;
foreach ($embprioritycfg as $key => $value) {
$ifpriority[$key] = $value;
}
} }
$pconfig['ifpriority'] = $ifpriority;
} }
if (!empty($a_bridges[$id]['ifpathcost'])) { if (!empty($a_bridges[$id]['ifpathcost'])) {
$pconfig['ifpathcost'] = explode(",", $a_bridges[$id]['ifpathcost']); foreach (explode(",", $a_bridges[$id]['ifpathcost']) as $cfg) {
$ifpathcost = array();
foreach ($pconfig['ifpathcost'] as $cfg) {
list ($key, $value) = explode(":", $cfg); list ($key, $value) = explode(":", $cfg);
$embpathcfg[$key] = $value; $pconfig['ifpathcost_'.$key] = $value;
foreach ($embpathcfg as $key => $value) { }
$ifpathcost[$key] = $value; }
} } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
} // save / validate formdata
$pconfig['ifpathcost'] = $ifpathcost; if (!empty($a_bridges[$_POST['id']])) {
} $id = $_POST['id'];
$pconfig['span'] = $a_bridges[$id]['span']; }
if (isset($a_bridges[$id]['edge']))
$pconfig['edge'] = $a_bridges[$id]['edge'];
if (isset($a_bridges[$id]['autoedge']))
$pconfig['autoedge'] = $a_bridges[$id]['autoedge'];
if (isset($a_bridges[$id]['ptp']))
$pconfig['ptp'] = $a_bridges[$id]['ptp'];
if (isset($a_bridges[$id]['autoptp']))
$pconfig['autoptp'] = $a_bridges[$id]['autoptp'];
}
if ($_POST) {
unset($input_errors); $input_errors = array();
$pconfig = $_POST; $pconfig = $_POST;
/* input validation */ /* input validation */
...@@ -124,520 +109,538 @@ if ($_POST) { ...@@ -124,520 +109,538 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if ($_POST['maxage'] && !is_numeric($_POST['maxage'])) if (!empty($pconfig['maxage']) && !is_numeric($pconfig['maxage'])) {
$input_errors[] = gettext("Maxage needs to be an integer between 6 and 40."); $input_errors[] = gettext("Maxage needs to be an integer between 6 and 40.");
if ($_POST['maxaddr'] && !is_numeric($_POST['maxaddr'])) }
if (!empty($pconfig['maxaddr']) && !is_numeric($pconfig['maxaddr'])) {
$input_errors[] = gettext("Maxaddr needs to be an integer."); $input_errors[] = gettext("Maxaddr needs to be an integer.");
if ($_POST['timeout'] && !is_numeric($_POST['timeout'])) }
if (!empty($pconfig['timeout']) && !is_numeric($pconfig['timeout'])) {
$input_errors[] = gettext("Timeout needs to be an integer."); $input_errors[] = gettext("Timeout needs to be an integer.");
if ($_POST['fwdelay'] && !is_numeric($_POST['fwdelay'])) }
if (!empty($pconfig['fwdelay']) && !is_numeric($pconfig['fwdelay'])) {
$input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30."); $input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30.");
if ($_POST['hellotime'] && !is_numeric($_POST['hellotime'])) }
if (!empty($pconfig['hellotime']) && !is_numeric($pconfig['hellotime'])) {
$input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2."); $input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2.");
if ($_POST['priority'] && !is_numeric($_POST['priority'])) }
if (!empty($pconfig['priority']) && !is_numeric($pconfig['priority'])) {
$input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440."); $input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440.");
if ($_POST['holdcnt'] && !is_numeric($_POST['holdcnt'])) }
if (!empty($pconfig['holdcnt']) && !is_numeric($pconfig['holdcnt'])) {
$input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10."); $input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10.");
}
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST[$ifn] <> "" && !is_numeric($_POST[$ifn])) { if (!empty($pconfig['ifpriority_'.$ifn]) && !is_numeric($pconfig['ifpriority_'.$ifn])) {
$input_errors[] = sprintf(gettext("%s interface priority for STP needs to be an integer between 0 and 240."), $ifdescr); $input_errors[] = sprintf(gettext("%s interface priority for STP needs to be an integer between 0 and 240."), $ifdescr);
} }
} if (!empty($pconfig['ifpathcost_'.$ifn]) && !is_numeric($pconfig['ifpathcost_'.$ifn])) {
$i = 0;
foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"])) {
$input_errors[] = sprintf(gettext("%s interface path cost for STP needs to be an integer between 1 and 200000000."), $ifdescr); $input_errors[] = sprintf(gettext("%s interface path cost for STP needs to be an integer between 1 and 200000000."), $ifdescr);
} }
$i++;
} }
if (!is_array($_POST['members']) || count($_POST['members']) < 2) if (!is_array($pconfig['members']) || count($_POST['members']) < 2) {
$input_errors[] = gettext("You must select at least 2 member interfaces for a bridge."); $input_errors[] = gettext("You must select at least 2 member interfaces for a bridge.");
}
if (is_array($_POST['members'])) { if (is_array($pconfig['members'])) {
foreach($_POST['members'] as $ifmembers) { foreach($pconfig['members'] as $ifmembers) {
if (empty($config['interfaces'][$ifmembers])) if (empty($config['interfaces'][$ifmembers])) {
$input_errors[] = gettext("A member interface passed does not exist in configuration"); $input_errors[] = gettext("A member interface passed does not exist in configuration");
if (is_array($config['interfaces'][$ifmembers]['wireless']) && }
$config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap") if (!empty($config['interfaces'][$ifmembers]['wireless']['mode']) && $config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap") {
$input_errors[] = gettext("Bridging a wireless interface is only possible in hostap mode."); $input_errors[] = gettext("Bridging a wireless interface is only possible in hostap mode.");
if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers) }
if ($pconfig['span'] != "none" && $pconfig['span'] == $ifmembers) {
$input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue."); $input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue.");
} }
} }
}
if (!$input_errors) { if (count($input_errors) == 0) {
$bridge = array(); $bridge = array();
$bridge['members'] = implode(',', $_POST['members']); $bridge['enablestp'] = !empty($pconfig['enablestp']);
$bridge['enablestp'] = $_POST['enablestp'] ? true : false; // 1 on 1 copy
$bridge['descr'] = $_POST['descr']; $copy_fields = array('descr', 'maxaddr', 'timeout', 'bridgeif', 'maxage','fwdelay', 'hellotime', 'priority', 'proto', 'holdcnt');
$bridge['maxaddr'] = $_POST['maxaddr']; foreach ($copy_fields as $fieldname) {
$bridge['timeout'] = $_POST['timeout']; if (isset($pconfig[$fieldname]) && $pconfig[$fieldname] != "") {
if ($_POST['static']) $bridge[$fieldname] = $pconfig[$fieldname];
$bridge['static'] = implode(',', $_POST['static']); } else {
if ($_POST['private']) $bridge[$fieldname] = null;
$bridge['private'] = implode(',', $_POST['private']); }
if (isset($_POST['stp'])) }
$bridge['stp'] = implode(',', $_POST['stp']); if ($pconfig['span'] != "none") {
$bridge['maxage'] = $_POST['maxage']; $bridge['span'] = $pconfig['span'];
$bridge['fwdelay'] = $_POST['fwdelay']; }
$bridge['hellotime'] = $_POST['hellotime']; // simple array fields
$bridge['priority'] = $_POST['priority']; $array_fields = array('members', 'stp', 'edge', 'autoedge', 'ptp', 'autoptp', 'static', 'private');
$bridge['proto'] = $_POST['proto']; foreach ($array_fields as $fieldname) {
$bridge['holdcnt'] = $_POST['holdcnt']; if(!empty($pconfig[$fieldname])) {
$i = 0; $bridge[$fieldname] = implode(',', $pconfig[$fieldname]);
$ifpriority = ""; }
$ifpathcost = ""; }
// array key/value sets
$bridge['ifpriority'] = "";
$bridge['ifpathcost'] = "";
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST[$ifn] <> "") { if (isset($pconfig['ifpriority_'.$ifn]) && $pconfig['ifpriority_'.$ifn] != "") {
if ($i > 0) if (!empty($bridge['ifpriority'])) {
$ifpriority .= ","; $bridge['ifpriority'] .= ',';
$ifpriority .= $ifn.":".$_POST[$ifn];
} }
if ($_POST["{$ifn}0"] <> "") { $bridge['ifpriority'] .= $ifn.":".$pconfig['ifpriority_'.$ifn];
if ($i > 0) }
$ifpathcost .= ","; if (isset($pconfig['ifpathcost_'.$ifn]) && $pconfig['ifpathcost_'.$ifn] != "") {
$ifpathcost .= $ifn.":".$_POST["{$ifn}0"]; if (!empty($bridge['ifpathcost'])) {
$bridge['ifpathcost'] .= ',';
}
$bridge['ifpathcost'] .= $ifn.":".$pconfig['ifpathcost_'.$ifn];
} }
$i++;
} }
$bridge['ifpriority'] = $ifpriority;
$bridge['ifpathcost'] = $ifpathcost;
if ($_POST['span'] != "none")
$bridge['span'] = $_POST['span'];
else
unset($bridge['span']);
if (isset($_POST['edge']))
$bridge['edge'] = implode(',', $_POST['edge']);
if (isset($_POST['autoedge']))
$bridge['autoedge'] = implode(',', $_POST['autoedge']);
if (isset($_POST['ptp']))
$bridge['ptp'] = implode(',', $_POST['ptp']);
if (isset($_POST['autoptp']))
$bridge['autoptp'] = implode(',', $_POST['autoptp']);
$bridge['bridgeif'] = $_POST['bridgeif'];
interface_bridge_configure($bridge); interface_bridge_configure($bridge);
if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge")) if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge")) {
$input_errors[] = gettext("Error occurred creating interface, please retry."); $input_errors[] = gettext("Error occurred creating interface, please retry.");
else { } else {
if (isset($id) && $a_bridges[$id]) if (isset($id)) {
$a_bridges[$id] = $bridge; $a_bridges[$id] = $bridge;
else } else {
$a_bridges[] = $bridge; $a_bridges[] = $bridge;
}
write_config(); write_config();
$confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']); $confif = convert_real_interface_to_friendly_interface_name($bridge['bridgeif']);
if ($confif <> "") if ($confif <> "") {
interface_configure($confif); interface_configure($confif);
}
header("Location: interfaces_bridge.php"); header("Location: interfaces_bridge.php");
exit; exit;
} }
} }
} }
legacy_html_escape_form_data($pconfig);
include("head.inc"); include("head.inc");
?> ?>
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ $(document).ready(function() {
function show_source_port_range() { // advanced options
document.getElementById("sprtable").style.display = 'none'; $("#show_advanced").click(function(){
document.getElementById("sprtable1").style.display = ''; $(".act_show_advanced").show();
document.getElementById("sprtable2").style.display = ''; $("#show_advanced_opt").hide();
document.getElementById("sprtable3").style.display = ''; });
document.getElementById("sprtable4").style.display = ''; });
document.getElementById("sprtable5").style.display = '';
document.getElementById("sprtable6").style.display = '';
document.getElementById("sprtable7").style.display = '';
document.getElementById("sprtable8").style.display = '';
document.getElementById("sprtable9").style.display = '';
document.getElementById("sprtable10").style.display = '';
}
//]]>
</script> </script>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<div id="inputerrors"></div>
<section class="col-xs-12"> <section class="col-xs-12">
<form method="post" name="iform" id="iform">
<div class="content-box"> <div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<header class="content-box-head container-fluid"> <table class="table table-striped">
<h3><?=gettext("Bridge configuration");?></h3> <thead>
</header>
<div class="content-box-main">
<form action="interfaces_bridge_edit.php" method="post" name="iform" id="iform">
<table class="table table-striped table-sort">
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Member interfaces"); ?></td> <td width="22%"><strong><?=gettext("Bridge configuration");?></strong></td>
<td width="78%" class="vtable"> <td width="78%" align="right">
<select name="members[]" multiple="multiple" class="selectpicker" size="3" data-live-search="true"> <small><?=gettext("full help"); ?> </small>
<?php <i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i></a>
// let's fix this for now in the template, although it should be fixed at the top of the page &nbsp;
// $pconfig['members'] can be of different type now. </td>
if ( isset($pconfig['members']) && is_array($pconfig['members'])) { </tr>
$members_array = $pconfig['members']; </thead>
} elseif (!empty($pconfig['members'])) { <tbody>
$members_array = explode(',', $pconfig['members']); <tr>
} else { <td><a id="help_for_members" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Member interfaces"); ?></td>
$members_array = array(); <td>
} <select name="members[]" multiple="multiple" class="selectpicker" data-size="5" data-live-search="true">
foreach ($ifacelist as $ifn => $ifinfo) { <?php
echo "<option value=\"{$ifn}\""; foreach ($ifacelist as $ifn => $ifinfo):?>
if (in_array($ifn, $members_array)) <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['members']) ? "selected=\"selected\"" : "";?>>
echo " selected=\"selected\""; <?=$ifinfo;?>
echo ">{$ifinfo}</option>"; </option>
} <?php
unset($members_array); endforeach;?>
?>
</select> </select>
<br /> <div class="hidden" for="help_for_members">
<span class="vexpl"><?=gettext("Interfaces participating in the bridge."); ?></span> <?=gettext("Interfaces participating in the bridge."); ?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td><a id="help_for_descr" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description"); ?></td>
<td width="78%" class="vtable"> <td>
<input type="text" name="descr" id="descr" class="form-control unknown" size="50" value="<?=htmlspecialchars($pconfig['descr']);?>" /> <input type="text" name="descr" value="<?=$pconfig['descr'];?>" />
<div class="hidden" for="help_for_descr">
<?=gettext("You may enter a description here for your reference (not parsed).");?>
</div>
</td> </td>
</tr> </tr>
<tr id="sprtable"> <tr id="show_advanced_opt">
<td></td> <td></td>
<td> <td>
<p><input type="button" class="btn btn-xs btn-default" onclick="show_source_port_range()" value="<?=gettext("Show advanced options"); ?>" /></p> <input type="button" id="show_advanced" class="btn btn-xs btn-default" value="<?=gettext("Show advanced options"); ?>" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Advanced / RSTP/STP -->
<div class="tab-content content-box col-xs-12 __mb act_show_advanced" style="display:none">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<td colspan="2"><strong><?=gettext("Spanning Tree Protocol");?> (<?=gettext("RSTP/STP"); ?>)</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td width="22%"><a id="help_for_enablestp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Enable");?></td>
<td width="78%">
<input type="checkbox" name="enablestp" <?= !empty($pconfig['enablestp']) ? "checked=\"checked\"" : "";?> />
<div class="hidden" for="help_for_enablestp">
<?=gettext("Enable spanning tree options for this bridge."); ?>
</div>
</td> </td>
</tr> </tr>
<tr style="display:none" id="sprtable1"> <tr>
<td valign="top" class="vncell"><?=gettext("RSTP/STP"); ?> </td> <td><a id="help_for_proto" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Protocol"); ?></td>
<td class="vtable"> <td>
<input type="checkbox" name="enablestp" id="enablestp" <?php if ($pconfig['enablestp']) echo "checked=\"checked\"";?> />
<span class="vexpl"><strong><?=gettext("Enable spanning tree options for this bridge."); ?> </strong></span>
<br /><br />
<table id="stpoptions" border="0" cellpadding="6" cellspacing="0" summary="protocol" class="table table-striped">
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Protocol"); ?></td>
<td class="vtable" width="80%">
<select name="proto" id="proto" class="selectpicker"> <select name="proto" id="proto" class="selectpicker">
<?php <option value="rstp" <?=$pconfig['proto'] == "rstp" ? "selected=\"selected\"" : "";?> >
foreach (array("rstp", "stp") as $proto) { <?=gettext("RSTP");?>
echo "<option value=\"{$proto}\""; </option>
if ($pconfig['proto'] == $proto) <option value="stp" <?=$pconfig['proto'] == "stp" ? "selected=\"selected\"" : "";?> >
echo " selected=\"selected\""; <?=gettext("STP");?>
echo ">".strtoupper($proto)."</option>"; </option>
}
?>
</select> </select>
<br /> <div class="hidden" for="help_for_proto">
<span class="vexpl"><?=gettext("Protocol used for spanning tree."); ?> </span></td> <?=gettext("Protocol used for spanning tree."); ?>
</div>
</td>
</tr> </tr>
<tr> <td valign="top" class="vncell" width="20%"><?=gettext("STP interfaces"); ?></td> <tr>
<td class="vtable" width="80%"> <td><a id="help_for_stp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("STP interfaces"); ?></td>
<td>
<select name="stp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <select name="stp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php <?php
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr):?>
echo "<option value=\"{$ifn}\""; <option value="<?$ifn;?>" <?=in_array($ifn, $pconfig['stp']) ? "selected=\"selected\"" : "";?> >
if (stristr($pconfig['stp'], $ifn)) <?=$ifdescr;?>
echo " selected=\"selected\""; </option>
echo ">{$ifdescr}</option>"; <?php
} endforeach;?>
?>
</select> </select>
<br /> <div class="hidden" for="help_for_stp" >
<span class="vexpl" >
<?=gettext("Enable Spanning Tree Protocol on interface. The if_bridge(4) " . <?=gettext("Enable Spanning Tree Protocol on interface. The if_bridge(4) " .
"driver has support for the IEEE 802.1D Spanning Tree Protocol " . "driver has support for the IEEE 802.1D Spanning Tree Protocol " .
"(STP). STP is used to detect and remove loops in a " . "(STP). STP is used to detect and remove loops in a " .
"network topology."); ?> "network topology."); ?>
</span> </div>
</td></tr> </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Valid time"); ?></td> </tr>
<td class="vtable" width="80%"> <tr>
<input name="maxage" type="text" class="form-control unkown" id="maxage" size="8" value="<?=htmlspecialchars($pconfig['maxage']);?>" /> <?=gettext("seconds"); ?> <td><a id="help_for_maxage" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Valid time"); ?> (<?=gettext("seconds"); ?>)</td>
<br /> <td>
<span class="vexpl"> <input name="maxage" type="text" value="<?=$pconfig['maxage'];?>" />
<div class="hidden" for="help_for_maxage">
<?=gettext("Set the time that a Spanning Tree Protocol configuration is " . <?=gettext("Set the time that a Spanning Tree Protocol configuration is " .
"valid. The default is 20 seconds. The minimum is 6 seconds and " . "valid. The default is 20 seconds. The minimum is 6 seconds and " .
"the maximum is 40 seconds."); ?> "the maximum is 40 seconds."); ?>
</span> </div>
</td></tr> </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Forward time"); ?> </td> </tr>
<td class="vtable" width="80%"> <tr>
<input name="fwdelay" type="text" class="form-control unkown" id="fwdelay" size="8" value="<?=htmlspecialchars($pconfig['fwdelay']);?>" /> <?=gettext("seconds"); ?> <td><a id="help_for_fwdelay" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Forward time"); ?> (<?=gettext("seconds"); ?>)</td>
<br /> <td>
<span class="vexpl"> <input name="fwdelay" type="text" value="<?=$pconfig['fwdelay'];?>" />
<div class="hidden" for="help_for_fwdelay">
<?=gettext("Set the time that must pass before an interface begins forwarding " . <?=gettext("Set the time that must pass before an interface begins forwarding " .
"packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds."); ?> "packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds."); ?>
</span> </div>
</td></tr> </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hello time"); ?></td> </tr>
<td class="vtable" width="80%"> <tr>
<input name="hellotime" type="text" class="form-control unkown" size="8" id="hellotime" value="<?=htmlspecialchars($pconfig['hellotime']);?>" /> <?=gettext("seconds"); ?> <td><a id="help_for_hellotime" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hello time"); ?> (<?=gettext("seconds"); ?>)</td>
<br /> <td>
<span class="vexpl"> <input name="hellotime" type="text" value="<?=$pconfig['hellotime'];?>" />
<div class="hidden" for="help_for_hellotime">
<?=gettext("Set the time between broadcasting of Spanning Tree Protocol configuration messages. The hello time may only be changed when " . <?=gettext("Set the time between broadcasting of Spanning Tree Protocol configuration messages. The hello time may only be changed when " .
"operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds."); ?> "operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds."); ?>
</span> </div>
</td></tr> </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td> </tr>
<td class="vtable" width="80%"> <tr>
<input name="priority" type="text" class="form-control unkown" id="priority" value="<?=htmlspecialchars($pconfig['priority']);?>" /> <td><a id="help_for_priority" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Priority"); ?></td>
<br /> <td>
<span class="vexpl"> <input name="priority" type="text" value="<?=$pconfig['priority'];?>" />
<div class="hidden" for="help_for_priority">
<?=gettext("Set the bridge priority for Spanning Tree. The default is 32768. " . <?=gettext("Set the bridge priority for Spanning Tree. The default is 32768. " .
"The minimum is 0 and the maximum is 61440."); ?> "The minimum is 0 and the maximum is 61440."); ?>
</span> </div>
</td></tr> </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hold count"); ?></td> </tr>
<td class="vtable" width="80%"> <tr>
<input name="holdcnt" type="text" class="form-control unkown" id="holdcnt" value="<?=htmlspecialchars($pconfig['holdcnt']);?>" /> <td><a id="help_for_holdcnt" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hold count"); ?></td>
<br /> <td>
<span class="vexpl"> <input name="holdcnt" type="text" value="<?=$pconfig['holdcnt'];?>" />
<div class="hidden" for="help_for_holdcnt">
<?=gettext("Set the transmit hold count for Spanning Tree. This is the number" . <?=gettext("Set the transmit hold count for Spanning Tree. This is the number" .
" of packets transmitted before being rate limited. The " . " of packets transmitted before being rate limited. The " .
"default is 6. The minimum is 1 and the maximum is 10."); ?> "default is 6. The minimum is 1 and the maximum is 10."); ?>
</span> </div>
</td></tr> </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td> </tr>
<td class="vtable" width="80%"> <tr>
<table summary="priority" class="table table-striped"> <td><a id="help_for_intf_priority" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Priority"); ?></td>
<?php foreach ($ifacelist as $ifn => $ifdescr) <td>
echo "<tr><td>{$ifdescr}</td><td><input size=\"5\" name=\"{$ifn}\" type=\"text\" class=\"form-control unkown\" id=\"{$ifn}\" value=\"{$ifpriority[$ifn]}\" /></td></tr>"; <table class="table table-striped table-condensed">
?> <?php
<tr><td></td></tr> foreach ($ifacelist as $ifn => $ifdescr):?>
<tr>
<td><?=$ifdescr;?></td>
<td>
<input name="ifpriority_<?=$ifn;?>" type="text" value="<?=isset($pconfig['ifpriority_'.$ifn]) ? $pconfig['ifpriority_'.$ifn] : "";?>" />
</td>
</tr>
<?php
endforeach;?>
</table> </table>
<br /> <div class="hidden" for="help_for_intf_priority">
<span class="vexpl" >
<?=gettext("Set the Spanning Tree priority of interface to value. The " . <?=gettext("Set the Spanning Tree priority of interface to value. The " .
"default is 128. The minimum is 0 and the maximum is 240. Increments of 16."); ?> "default is 128. The minimum is 0 and the maximum is 240. Increments of 16."); ?>
</span> </div>
</td></tr> </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Path cost"); ?></td> </tr>
<td class="vtable" width="80%"> <tr>
<table summary="path cost" class="table table-striped"> <td><a id="help_for_intf_pathcost" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Path cost"); ?></td>
<?php $i = 0; foreach ($ifacelist as $ifn => $ifdescr) <td>
echo "<tr><td>{$ifdescr}</td><td><input size=\"8\" name=\"{$ifn}{$i}\" type=\"text\" class=\"form-control unkown\" id=\"{$ifn}{$i}\" value=\"{$ifpathcost[$ifn]}\" /></td></tr>"; <table class="table table-striped table-condensed">
?> <?php
<tr><td></td></tr> foreach ($ifacelist as $ifn => $ifdescr):?>
<tr>
<td><?=$ifdescr;?></td>
<td>
<input name="ifpathcost_<?=$ifn;?>" type="text" value="<?=isset($pconfig['ifpathcost_'.$ifn]) ? $pconfig['ifpathcost_'.$ifn] : "";?>" />
</td>
</tr>
<?php
endforeach;?>
</table> </table>
<br /> <div class="hidden" for="help_for_intf_pathcost">
<span class="vexpl" >
<?=gettext("Set the Spanning Tree path cost of interface to value. The " . <?=gettext("Set the Spanning Tree path cost of interface to value. The " .
"default is calculated from the link speed. To change a previously selected path cost back to automatic, set the cost to 0. ". "default is calculated from the link speed. To change a previously selected path cost back to automatic, set the cost to 0. ".
"The minimum is 1 and the maximum is 200000000."); ?> "The minimum is 1 and the maximum is 200000000."); ?>
</span> </div>
</td></tr> </td>
</tr>
</tbody>
</table> </table>
</td></tr> </div>
<tr style="display:none" id="sprtable2"> </div>
<td valign="top" class="vncell"><?=gettext("Cache size"); ?></td> <!-- Advanced options-->
<td class="vtable"> <div class="tab-content content-box col-xs-12 __mb act_show_advanced" style="display:none">
<input name="maxaddr" size="10" type="text" class="form-control unkown" id="maxaddr" value="<?=htmlspecialchars($pconfig['maxaddr']);?>" /> <?=gettext("entries"); ?> <div class="table-responsive">
<br /><span class="vexpl"> <table class="table table-striped">
<?=gettext("Set the size of the bridge address cache to size. The default is " . <thead>
".100 entries."); ?> <tr>
<td colspan="2"><strong><?=gettext("Advanced options");?></strong></td>
</tr>
</thead>
<tbody>
<tr>
<td width="22%"><a id="help_for_maxaddr" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Cache size"); ?> (<?=gettext("entries"); ?>)</td>
<td width="78%">
<input name="maxaddr" type="text" value="<?=$pconfig['maxaddr'];?>" />
<div class="hidden" for="help_for_maxaddr">
<?=gettext("Set the size of the bridge address cache to size. The default is .100 entries."); ?>
</span> </span>
</td> </td>
</tr> </tr>
<tr style="display:none" id="sprtable3"> <tr>
<td valign="top" class="vncell"><?=gettext("Cache entry expire time"); ?></td> <td><a id="help_for_timeout" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Cache entry expire time"); ?> (<?=gettext("seconds"); ?>)</td>
<td> <td>
<input name="timeout" type="text" class="form-control unkown" id="timeout" size="10" value="<?=htmlspecialchars($pconfig['timeout']);?>" /> <?=gettext("seconds"); ?> <input name="timeout" type="text" value="<?=$pconfig['timeout'];?>" />
<br /><span class="vexpl"> <div class="hidden" for="help_for_timeout">
<?=gettext("Set the timeout of address cache entries to this number of seconds. If " . <?=gettext("Set the timeout of address cache entries to this number of seconds. If " .
"seconds is zero, then address cache entries will not be expired. " . "seconds is zero, then address cache entries will not be expired. " .
"The default is 240 seconds."); ?> "The default is 240 seconds."); ?>
</span> </div>
</td> </td>
</tr> </tr>
<tr style="display:none" id="sprtable4"> <tr>
<td valign="top" class="vncell"><?=gettext("Span port"); ?></td> <td><a id="help_for_span" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Span port"); ?></td>
<td class="vtable"> <td>
<select name="span" class="selectpicker" id="span" data-live-search="true"> <select name="span" class="selectpicker" data-live-search="true">
<option value="none" selected="selected"><?=gettext("None"); ?></option> <option value="none"><?=gettext("None"); ?></option>
<?php <?php
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr):?>
echo "<option value=\"{$ifn}\""; <option value="<?=$ifn;?>" <?=$ifn == $pconfig['span'] ? "selected=\"selected\"" : "";?>>
if ($ifn == $pconfig['span']) <?=$ifdescr;?>
echo " selected=\"selected\""; </option>
echo ">{$ifdescr}</option>"; <?php
} endforeach;?>
?>
</select> </select>
<br /><span class="vexpl"> <div class="hidden" for="help_for_span">
<?=gettext("Add the interface named by interface as a span port on the " . <?=gettext("Add the interface named by interface as a span port on the " .
"bridge. Span ports transmit a copy of every frame received by " . "bridge. Span ports transmit a copy of every frame received by " .
"the bridge. This is most useful for snooping a bridged network " . "the bridge. This is most useful for snooping a bridged network " .
"passively on another host connected to one of the span ports of " . "passively on another host connected to one of the span ports of " .
"the bridge."); ?> "the bridge."); ?><br/>
</span> <span class="text-warning"><strong><?=gettext("Note:"); ?><br /></strong></span>
<p class="vexpl"><span class="red"><strong>
<?=gettext("Note:"); ?><br />
</strong></span>
<?=gettext("The span interface cannot be part of the bridge member interfaces."); ?> <?=gettext("The span interface cannot be part of the bridge member interfaces."); ?>
</p> </div>
</td> </td>
</tr> </tr>
<tr style="display:none" id="sprtable5"> <tr>
<td valign="top" class="vncell"><?=gettext("Edge ports"); ?></td> <td><a id="help_for_edge" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Edge ports"); ?></td>
<td class="vtable"> <td>
<select name="edge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <select name="edge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php <?php
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr):?>
echo "<option value=\"{$ifn}\""; <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['edge']) ? "selected=\"selected\"" : "";?>>
if (stristr($pconfig['edge'], $ifn)) <?=$ifdescr;?>
echo " selected=\"selected\""; </option>
echo ">{$ifdescr}</option>"; <?php
} endforeach;?>
?>
</select> </select>
<br /> <div class="hidden" for="help_for_edge">
<span class="vexpl">
<?=gettext("Set interface as an edge port. An edge port connects directly to " . <?=gettext("Set interface as an edge port. An edge port connects directly to " .
"end stations and cannot create bridging loops in the network; this " . "end stations and cannot create bridging loops in the network; this " .
"allows it to transition straight to forwarding."); ?> "allows it to transition straight to forwarding."); ?>
</span></td> </div>
</td>
</tr> </tr>
<tr style="display:none" id="sprtable6"> <tr>
<td valign="top" class="vncell"><?=gettext("Auto Edge ports"); ?></td> <td><a id="help_for_autoedge" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Auto Edge ports"); ?></td>
<td class="vtable"> <td>
<select name="autoedge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <select name="autoedge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php <?php
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr):?>
echo "<option value=\"{$ifn}\""; <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['autoedge']) ? "selected=\"selected\"" : "";?>>
if (stristr($pconfig['autoedge'], $ifn)) <?=$ifdescr;?>
echo " selected=\"selected\""; </option>
echo ">{$ifdescr}</option>"; <?php
} endforeach;?>
?>
</select> </select>
<br /> <div class="hidden" for="help_for_autoedge">
<span class="vexpl">
<?=gettext("Allow interface to automatically detect edge status. This is the " . <?=gettext("Allow interface to automatically detect edge status. This is the " .
"default for all interfaces added to a bridge."); ?></span> "default for all interfaces added to a bridge."); ?><br/>
<p class="vexpl"><span class="red"><strong> <span class="text-warning"><strong><?=gettext("Note:"); ?><br /></strong></span>
<?=gettext("Note:"); ?><br />
</strong></span>
<?=gettext("This will disable the autoedge status of interfaces."); ?> <?=gettext("This will disable the autoedge status of interfaces."); ?>
</p></td> </div>
</td>
</tr> </tr>
<tr style="display:none" id="sprtable7"> <tr>
<td valign="top" class="vncell"><?=gettext("PTP ports"); ?></td> <td><a id="help_for_ptp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("PTP ports"); ?></td>
<td class="vtable"> <td>
<select name="ptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <select name="ptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php <?php
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr):?>
echo "<option value=\"{$ifn}\""; <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['ptp']) ? "selected=\"selected\"" : "";?>>
if (stristr($pconfig['ptp'], $ifn)) <?=$ifdescr;?>
echo " selected=\"selected\""; </option>
echo ">{$ifdescr}</option>"; <?php
} endforeach;?>
?>
</select> </select>
<br /> <div class="hidden" for="help_for_ptp">
<span class="vexpl">
<?=gettext("Set the interface as a point-to-point link. This is required for " . <?=gettext("Set the interface as a point-to-point link. This is required for " .
"straight transitions to forwarding and should be enabled on a " . "straight transitions to forwarding and should be enabled on a " .
"direct link to another RSTP-capable switch."); ?> "direct link to another RSTP-capable switch."); ?>
</span></td> </div>
</td>
</tr> </tr>
<tr style="display:none" id="sprtable8"> <tr>
<td valign="top" class="vncell"><?=gettext("Auto PTP ports"); ?></td> <td><a id="help_for_autoptp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Auto PTP ports"); ?></td>
<td class="vtable"> <td>
<select name="autoptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <select name="autoptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php <?php
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr):?>
echo "<option value=\"{$ifn}\""; <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['autoptp']) ? "selected=\"selected\"" : "";?>>
if (stristr($pconfig['autoptp'], $ifn)) <?=$ifdescr;?>
echo " selected=\"selected\""; </option>
echo ">{$ifdescr}</option>"; <?php
} endforeach;?>
?>
</select> </select>
<br /> <div class="hidden" for="help_for_autoptp">
<span class="vexpl">
<?=gettext("Automatically detect the point-to-point status on interface by " . <?=gettext("Automatically detect the point-to-point status on interface by " .
"checking the full duplex link status. This is the default for " . "checking the full duplex link status. This is the default for " .
"interfaces added to the bridge."); ?></span> "interfaces added to the bridge."); ?><br/>
<p class="vexpl"><span class="red"><strong> <span class="text-warning"><strong><?=gettext("Note:"); ?><br /></strong></span>
<?=gettext("Note:"); ?><br />
</strong></span>
<?=gettext("The interfaces selected here will be removed from default autoedge status."); ?> <?=gettext("The interfaces selected here will be removed from default autoedge status."); ?>
</p></td> </div>
</td>
</tr> </tr>
<tr style="display:none" id="sprtable9"> <tr>
<td valign="top" class="vncell"><?=gettext("Sticky ports"); ?></td> <td><a id="help_for_static" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Sticky ports"); ?></td>
<td class="vtable"> <td>
<select name="static[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <select name="static[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php <?php
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr):?>
echo "<option value=\"{$ifn}\""; <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['static']) ? "selected=\"selected\"" : "";?>>
if (stristr($pconfig['static'], $ifn)) <?=$ifdescr;?>
echo " selected=\"selected\""; </option>
echo ">{$ifdescr}</option>"; <?php
} endforeach;?>
?>
</select> </select>
<br /> <div class="hidden" for="help_for_static">
<span class="vexpl">
<?=gettext("Mark an interface as a \"sticky\" interface. Dynamically learned " . <?=gettext("Mark an interface as a \"sticky\" interface. Dynamically learned " .
"address entries are treated as static once entered into the " . "address entries are treated as static once entered into the " .
"cache. Sticky entries are never aged out of the cache or " . "cache. Sticky entries are never aged out of the cache or " .
"replaced, even if the address is seen on a different interface."); ?> "replaced, even if the address is seen on a different interface."); ?>
</span></td> </div>
</td>
</tr> </tr>
<tr style="display:none" id="sprtable10"> <tr>
<td valign="top" class="vncell"><?=gettext("Private ports"); ?></td> <td><a id="help_for_private" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Private ports"); ?></td>
<td class="vtable"> <td>
<select name="private[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true"> <select name="private[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php <?php
foreach ($ifacelist as $ifn => $ifdescr) { foreach ($ifacelist as $ifn => $ifdescr):?>
echo "<option value=\"{$ifn}\""; <option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['private']) ? "selected=\"selected\"" : "";?>>
if (stristr($pconfig['private'], $ifn)) <?=$ifdescr;?>
echo " selected=\"selected\""; </option>
echo ">{$ifdescr}</option>"; <?php
} endforeach;?>
?>
</select> </select>
<br /> <div class="hidden" for="help_for_private">
<span class="vexpl">
<?=gettext("Mark an interface as a \"private\" interface. A private interface does not forward any traffic to any other port that is also " . <?=gettext("Mark an interface as a \"private\" interface. A private interface does not forward any traffic to any other port that is also " .
"a private interface."); ?> "a private interface."); ?>
</span></td> </div>
</td>
</tr> </tr>
</tbody>
</table>
</div>
</div>
<!-- Advanced / RSTP/STP -->
<div class="tab-content content-box col-xs-12 __mb">
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr> <tr>
<td width="22%" valign="top">&nbsp;</td> <td width="22%" valign="top">&nbsp;</td>
<td width="78%"> <td width="78%">
<input type="hidden" name="bridgeif" value="<?=htmlspecialchars($pconfig['bridgeif']); ?>" /> <input type="hidden" name="bridgeif" value="<?=$pconfig['bridgeif']; ?>" />
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" /> <input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_bridge.php');?>'" />
<?php if (isset($id) && $a_bridges[$id]): ?> <?php if (isset($id)): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?> <?php endif; ?>
</td> </td>
</tr> </tr>
</tbody>
</table> </table>
</form>
</div> </div>
</div> </div>
</form>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
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