Beispiel #1
0
             pfSense_interface_destroy($a_vlans[$id]['vlanif']);
         } else {
             pfSense_interface_destroy("{$a_vlans[$id]['if']}_vlan{$a_vlans[$id]['tag']}");
             $confif = convert_real_interface_to_friendly_interface_name("{$a_vlans[$id]['if']}_vlan{$a_vlans[$id]['tag']}");
         }
         if ($confif != "") {
             $config['interfaces'][$confif]['if'] = "{$_POST['if']}_vlan{$_POST['tag']}";
         }
     }
 }
 $vlan = array();
 $vlan['if'] = $_POST['if'];
 $vlan['tag'] = $_POST['tag'];
 $vlan['descr'] = $_POST['descr'];
 $vlan['vlanif'] = "{$_POST['if']}_vlan{$_POST['tag']}";
 $vlan['vlanif'] = interface_vlan_configure($vlan);
 if ($vlan['vlanif'] == "" || !stristr($vlan['vlanif'], "vlan")) {
     $input_errors[] = gettext("Error occured creating interface, please retry.");
 } else {
     if (isset($id) && $a_vlans[$id]) {
         $a_vlans[$id] = $vlan;
     } else {
         $a_vlans[] = $vlan;
     }
     write_config();
     if ($confif != "") {
         interface_configure($confif);
     }
     header("Location: interfaces_vlan.php");
     exit;
 }
        } else {
            if (isset($id) && $a_laggs[$id]) {
                $a_laggs[$id] = $lagg;
            } else {
                $a_laggs[] = $lagg;
            }
            write_config();
            $confif = convert_real_interface_to_friendly_interface_name($lagg['laggif']);
            if ($confif != "") {
                interface_configure($confif);
            }
            // reconfigure any VLANs with this lagg as their parent
            if (is_array($config['vlans']['vlan'])) {
                foreach ($config['vlans']['vlan'] as $vlan) {
                    if ($vlan['if'] == $lagg['laggif']) {
                        interface_vlan_configure($vlan);
                        $confif = convert_real_interface_to_friendly_interface_name($vlan['vlanif']);
                        if ($confif != "") {
                            interface_configure($confif);
                        }
                    }
                }
            }
            header("Location: interfaces_lagg.php");
            exit;
        }
    }
}
function build_member_list()
{
    global $pconfig, $portlist, $realifchecklist;