Revision 7994c3f8
Added by Ermal Luçi almost 17 years ago
usr/local/www/interfaces.php | ||
---|---|---|
245 | 245 |
|
246 | 246 |
if ($_POST['apply']) { |
247 | 247 |
|
248 |
unlink_if_exists("{$g['tmp_path']}/config.cache"); |
|
248 |
unset($input_errors); |
|
249 |
if (!file_exists($d_landirty_path)) |
|
250 |
$intput_errors[] = "You have already applied your settings!"; |
|
251 |
else { |
|
252 |
unlink_if_exists("{$g['tmp_path']}/config.cache"); |
|
249 | 253 |
unlink_if_exists("{$d_landirty_path}"); |
250 | 254 |
|
251 | 255 |
ob_flush(); |
... | ... | |
269 | 273 |
|
270 | 274 |
/* set up static routes */ |
271 | 275 |
system_routing_configure(); |
272 |
|
|
276 |
} |
|
277 |
header("Location: interfaces.php?if={$if}"); |
|
278 |
exit; |
|
273 | 279 |
} else if ($_POST) { |
274 | 280 |
|
275 | 281 |
unset($input_errors); |
... | ... | |
280 | 286 |
|
281 | 287 |
if ($_POST['enable'] || $if == "wan" || $if = "lan") { |
282 | 288 |
/* optional interface if list */ |
283 |
$iflist = get_configured_interface_with_descr(true);
|
|
289 |
$iflist = get_configured_interface_with_descr(); |
|
284 | 290 |
|
285 | 291 |
/* description unique? */ |
286 | 292 |
foreach ($iflist as $ifent => $ifdescr) { |
... | ... | |
306 | 312 |
|
307 | 313 |
/* input validation */ |
308 | 314 |
if ($_POST['type'] == "static") { |
309 |
if ($if == "wan") { |
|
310 |
$reqdfields = explode(" ", "ipaddr subnet gateway"); |
|
311 |
$reqdfieldsn = explode(",", "IP address,Subnet bit count,Gateway"); |
|
312 |
} else { |
|
313 |
$reqdfields = explode(" ", "ipaddr subnet"); |
|
314 |
$reqdfieldsn = explode(",", "IP address,Subnet bit count"); |
|
315 |
} |
|
315 |
$reqdfields = explode(" ", "ipaddr subnet gateway"); |
|
316 |
$reqdfieldsn = explode(",", "IP address,Subnet bit count,Gateway"); |
|
316 | 317 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |
317 | 318 |
} else if ($_POST['type'] == "PPPoE") { |
318 | 319 |
if ($_POST['pppoe_dialondemand']) { |
Also available in: Unified diff
Fix applying interface settings and prevent it from being applied multiple times as in ocasions with browser glitches. Remove some only wan part code.