mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
cleanup, move link_interface_to_vlans to interfaces_assign.php and remove unused code
This commit is contained in:
parent
5525a08adb
commit
46c460bb3f
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user