diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-11-25 04:39:49 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-11-25 04:39:49 +0000 |
commit | 0f94b28097ef802933e3aed8036b49260c7d0f50 (patch) | |
tree | 413b6c358c46b8aae0c9dcacc023b4fd188f0ed7 /usr/local/www/interfaces.php | |
parent | 3f79a732b6947eea00eb2da5dc63901e435541ae (diff) | |
download | pfsense-0f94b28097ef802933e3aed8036b49260c7d0f50.zip pfsense-0f94b28097ef802933e3aed8036b49260c7d0f50.tar.gz |
Do extra checking on return value
Diffstat (limited to 'usr/local/www/interfaces.php')
-rwxr-xr-x | usr/local/www/interfaces.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index e9460f0..5e4fd86 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -1426,13 +1426,13 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" var descr = $('gatewaydescr').getValue(); gatewayip = $('gatewayip').getValue(); var url = "system_gateways_edit.php"; - var pars = 'interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip); + var pars = 'isAjax=true&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip); var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, - onComplete: save_callback() + onComplete: save_callback }); } function addOption(selectbox,text,value ) @@ -1446,11 +1446,16 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" function report_failure() { alert("Sorry, we could not create your gateway at this time."); } - function save_callback() { - document.getElementById("addgateway").style.display = 'none'; - hide_add_gateway(); - $('status').innerHTML = ''; - addOption($('gateway'), name, name); + function save_callback(transport) { + var response = transport.responseText; + if(response) { + document.getElementById("addgateway").style.display = 'none'; + hide_add_gateway(); + $('status').innerHTML = ''; + addOption($('gateway'), name, name); + } else { + report_failure(); + } } <?php if ($if == "wan" || $if == "lan") |