示例#1
0
    $index = $_GET['index'];
} else {
    if (isset($_POST['index']) && $_POST['index']) {
        $index = $_POST['index'];
    }
}
if (!$index) {
    exit;
}
$optcfg =& $config['interfaces']['opt' . $index];
// Get interface informations.
$ifinfo = get_interface_info(get_ifname($optcfg['if']));
if ($config['interfaces']['opt' . $index]['ipaddr'] == "dhcp") {
    $pconfig['type'] = "DHCP";
    $pconfig['ipaddr'] = get_ipaddr($optcfg['if']);
    $pconfig['subnet'] = get_subnet_bits($optcfg['if']);
} else {
    $pconfig['type'] = "Static";
    $pconfig['ipaddr'] = $optcfg['ipaddr'];
    $pconfig['subnet'] = $optcfg['subnet'];
}
$pconfig['ipv6_enable'] = isset($optcfg['ipv6_enable']);
if ($config['interfaces']['opt' . $index]['ipv6addr'] == "auto") {
    $pconfig['ipv6type'] = "Auto";
    $pconfig['ipv6addr'] = get_ipv6addr($optcfg['if']);
} else {
    $pconfig['ipv6type'] = "Static";
    $pconfig['ipv6addr'] = $optcfg['ipv6addr'];
    $pconfig['ipv6subnet'] = $optcfg['ipv6subnet'];
}
$pconfig['descr'] = $optcfg['descr'];
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Network"), gettext("LAN Management"));
$lancfg =& $config['interfaces']['lan'];
$optcfg =& $config['interfaces']['lan'];
// Required for WLAN.
// Get interface informations.
$ifinfo = get_interface_info(get_ifname($lancfg['if']));
if (strcmp($lancfg['ipaddr'], "dhcp") == 0) {
    $pconfig['type'] = "DHCP";
    $pconfig['ipaddr'] = get_ipaddr($lancfg['if']);
    $pconfig['subnet'] = get_subnet_bits($lancfg['if']);
} else {
    $pconfig['type'] = "Static";
    $pconfig['ipaddr'] = $lancfg['ipaddr'];
    $pconfig['subnet'] = $lancfg['subnet'];
}
$pconfig['ipv6_enable'] = isset($lancfg['ipv6_enable']);
if (strcmp($lancfg['ipv6addr'], "auto") == 0) {
    $pconfig['ipv6type'] = "Auto";
    $pconfig['ipv6addr'] = get_ipv6addr($lancfg['if']);
} else {
    $pconfig['ipv6type'] = "Static";
    $pconfig['ipv6addr'] = $lancfg['ipv6addr'];
    $pconfig['ipv6subnet'] = $lancfg['ipv6subnet'];
}
$pconfig['gateway'] = get_defaultgateway();