Commit 46c460bb authored by Ad Schellevis's avatar Ad Schellevis

cleanup, move link_interface_to_vlans to interfaces_assign.php and remove unused code

parent 5525a08a
......@@ -4040,31 +4040,6 @@ function link_interface_to_track6($int, $action = '')
}
}
function link_interface_to_vlans($int, $action = '')
{
global $config;
if (empty($int)) {
return;
}
if (isset($config['vlans']['vlan'])) {
$ifaces = array();
foreach ($config['vlans']['vlan'] as $vlan) {
if ($int == $vlan['if']) {
if ($action == "update") {
interfaces_bring_up($int);
} elseif ($action == "") {
$ifaces[$vlan['tag']] = $vlan;
}
}
}
if (!empty($ifaces)) {
return $ifaces;
}
}
}
function link_interface_to_vips($int, $action = '')
{
global $config;
......
......@@ -35,6 +35,20 @@ require_once("system.inc");
require_once("interfaces.inc");
require_once("services.inc");
function link_interface_to_vlans($int)
{
global $config;
if (isset($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
if ($int == $vlan['if']) {
interfaces_bring_up($int);
}
}
}
}
function list_interfaces() {
global $config;
$interfaces = array();
......@@ -202,7 +216,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if(!empty($config['interfaces']['lan']) && !empty($config['dhcpd']['wan']) && !empty($config['dhcpd']['wan']) ) {
unset($config['dhcpd']['wan']);
}
link_interface_to_vlans($realid, "update");
link_interface_to_vlans($realid);
header(url_safe('Location: /interfaces_assign.php'));
exit;
}
......
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