Revision 4476d447
Added by Ermal Luçi almost 17 years ago
usr/local/www/interfaces.php | ||
---|---|---|
150 | 150 |
$pconfig['alias-address'] = $wancfg['alias-address']; |
151 | 151 |
$pconfig['alias-subnet'] = $wancfg['alias-subnet']; |
152 | 152 |
$pconfig['descr'] = remove_bad_chars($wancfg['descr']); |
153 |
$pconfig['enable'] = $if == "wan" ? true : isset($wancfg['enable']); |
|
153 |
if ($if == "wan" || $if == "lan") |
|
154 |
$pconfig['enable'] = true; |
|
155 |
else |
|
156 |
$pconfig['enable'] = isset($wancfg['enable']); |
|
154 | 157 |
|
155 | 158 |
if (is_array($config['aliases']['alias'])) |
156 | 159 |
foreach($config['aliases']['alias'] as $alias) |
... | ... | |
190 | 193 |
if ($_POST) { |
191 | 194 |
|
192 | 195 |
unset($input_errors); |
193 |
// $pconfig = $_POST;
|
|
196 |
$pconfig = $_POST; |
|
194 | 197 |
|
195 | 198 |
/* filter out spaces from descriptions */ |
196 | 199 |
$_POST['descr'] = remove_bad_chars($_POST['descr']); |
197 | 200 |
|
198 |
if ($_POST['enable'] || $if == "wan") { |
|
201 |
if ($_POST['enable'] || $if == "wan" || $if = "lan") {
|
|
199 | 202 |
/* optional interface if list */ |
200 | 203 |
$iflist = get_configured_interface_with_descr(true); |
201 | 204 |
|
... | ... | |
356 | 359 |
} |
357 | 360 |
|
358 | 361 |
$wancfg['descr'] = remove_bad_chars($_POST['descr']); |
359 |
$wancfg['enable'] = $if == "wan" ? true : $_POST['enable'] ? true : false; |
|
362 |
if ($if == "wan" || $if == "lan") |
|
363 |
$wancfg['enable'] = true; |
|
364 |
else |
|
365 |
$wancfg['enable'] = $_POST['enable'] ? true : false; |
|
360 | 366 |
|
361 | 367 |
if ($_POST['type'] == "static") { |
362 | 368 |
$wancfg['ipaddr'] = $_POST['ipaddr']; |
... | ... | |
495 | 501 |
$wancfg['mtu'] = $_POST['mtu']; |
496 | 502 |
|
497 | 503 |
write_config(); |
498 |
|
|
504 |
|
|
499 | 505 |
if ($if = "lan") { |
500 | 506 |
/* restart snmp so that it binds to correct address */ |
501 | 507 |
services_snmpd_configure(); |
... | ... | |
528 | 534 |
// Populate page descr if it does not exist. |
529 | 535 |
if($if == "wan" && !$wancfg['descr']) |
530 | 536 |
$wancfg['descr'] = "WAN"; |
537 |
else if ($if == "lan" && !$wancfg['descr']) |
|
538 |
$wancfg['descr'] = "LAN"; |
|
531 | 539 |
|
532 | 540 |
$pgtitle = array("Interfaces", $wancfg['descr']); |
533 | 541 |
$closehead = false; |
... | ... | |
586 | 594 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> |
587 | 595 |
<?php include("fbegin.inc"); ?> |
588 | 596 |
<?php if ($input_errors) print_input_errors($input_errors); ?> |
597 |
|
|
589 | 598 |
<?php if ($savemsg) print_info_box($savemsg); ?> |
590 | 599 |
<form action="interfaces_wan.php?if=<?php echo "{$if}";?>" method="post" name="iform" id="iform"> |
591 | 600 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
592 | 601 |
<tr> |
593 | 602 |
<td colspan="2" valign="top" class="listtopic">General configuration</td> |
594 | 603 |
</tr> |
595 |
<?php if ($if != "wan"): ?> |
|
604 |
<?php if ($if != "wan" || $if != "lan"): ?>
|
|
596 | 605 |
<tr> |
597 | 606 |
<td width="22%" valign="top" class="vtable"> </td> |
598 | 607 |
<td width="78%" class="vtable"> |
... | ... | |
939 | 948 |
<script language="JavaScript"> |
940 | 949 |
<!-- |
941 | 950 |
<?php |
942 |
if ($if == "wan") |
|
951 |
if ($if == "wan" || $if = "lan")
|
|
943 | 952 |
echo "\$('allcfg').appear();"; |
944 | 953 |
else |
945 | 954 |
echo "show_allcfg(document.iform.enable);"; |
Also available in: Unified diff
Merge lan configuration to the interfaces_wan.php page wich does the configuration of all
other assigned interfaces.