From ad8622208cf9c6f3978bc1a41f2c58b9deafe300 Mon Sep 17 00:00:00 2001 From: Charlie Date: Thu, 22 Jan 2009 02:32:36 -0800 Subject: allow IPv4 gateways to be added via AJAX --- usr/local/www/interfaces.php | 4 +++- usr/local/www/system_gateways_edit.php | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'usr/local/www') diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 2916857..c302232 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -948,6 +948,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe"
+
@@ -1579,9 +1580,10 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" name = $('name').getValue(); var descr = $('gatewaydescr').getValue(); gatewayip = $('gatewayip').getValue(); + addrtype = $('addrtype').getValue(); var defaultgw = $('defaultgw').getValue(); var url = "system_gateways_edit.php"; - var pars = 'isAjax=true&defaultgw=' + escape(defaultgw) + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip); + var pars = 'isAjax=true&defaultgw=' + escape(defaultgw) + '&interface=' + escape(iface) + '&name=' + escape(name) + '&descr=' + escape(descr) + '&gateway=' + escape(gatewayip) + '&type=' + escape(addrtype); var myAjax = new Ajax.Request( url, { diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 9d64f01..15b60e1 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -158,6 +158,11 @@ if ($_POST) { write_config(); + if($_REQUEST['isAjax']) { + echo $_POST['name']; + exit; + } + header("Location: system_gateways.php"); exit; } -- cgit v1.1