diff options
author | Chris Buechler <cmb@pfsense.org> | 2016-01-28 22:52:49 -0600 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-01-28 22:52:49 -0600 |
commit | c4db25a571d2cd354db6bf2ee0a06e37c1eb5541 (patch) | |
tree | b8ef3ad2be8dbe5849f45fbc3f77a91558120456 | |
parent | f8ccc7041f216992388f3d61f72991f5b29399e7 (diff) | |
download | pfsense-c4db25a571d2cd354db6bf2ee0a06e37c1eb5541.zip pfsense-c4db25a571d2cd354db6bf2ee0a06e37c1eb5541.tar.gz |
Add topology selection to OpenVPN client page. Ticket #5764
-rw-r--r-- | src/usr/local/www/vpn_openvpn_client.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/usr/local/www/vpn_openvpn_client.php b/src/usr/local/www/vpn_openvpn_client.php index 4f7cb9e..43549c4 100644 --- a/src/usr/local/www/vpn_openvpn_client.php +++ b/src/usr/local/www/vpn_openvpn_client.php @@ -65,6 +65,8 @@ require("guiconfig.inc"); require_once("openvpn.inc"); require_once("pkg-utils.inc"); +global $openvpn_topologies; + $pgtitle = array(gettext("VPN"), gettext("OpenVPN"), gettext("Client")); $shortcut_section = "openvpn"; @@ -188,6 +190,7 @@ if ($_GET['act'] == "edit") { $pconfig['use_shaper'] = $a_client[$id]['use_shaper']; $pconfig['compression'] = $a_client[$id]['compression']; $pconfig['passtos'] = $a_client[$id]['passtos']; + $pconfig['topology'] = $a_client[$id]['topology']; // just in case the modes switch $pconfig['autokey_enable'] = "yes"; @@ -253,6 +256,10 @@ if ($_POST) { $input_errors[] = $result; } + if (!array_key_exists($pconfig['topology'], $openvpn_topologies)) { + $input_errors[] = gettext("The field 'Topology' contains an invalid selection"); + } + if ($pconfig['proxy_addr']) { if ($result = openvpn_validate_host($pconfig['proxy_addr'], 'Proxy host or address')) { @@ -373,6 +380,7 @@ if ($_POST) { } $client['description'] = $pconfig['description']; $client['mode'] = $pconfig['mode']; + $client['topology'] = $pconfig['topology']; $client['custom_options'] = str_replace("\r\n", "\n", $pconfig['custom_options']); if ($tls_mode) { @@ -719,6 +727,13 @@ $section->addInput(new Form_Input( $openvpn_compression_modes ))->setHelp('Compress tunnel packets using the LZO algorithm. Adaptive compression will dynamically disable compression for a period of time if OpenVPN detects that the data in the packets is not being compressed efficiently.'); + $section->addInput(new Form_Select( + 'topology', + 'Topology', + $pconfig['topology'], + $openvpn_topologies + ))->setHelp('Specifies the method used to configure a virtual adapter IP address.'); + $section->addInput(new Form_Checkbox( 'passtos', 'Type-of-Service', @@ -880,6 +895,7 @@ events.push(function() { function dev_mode_change() { hideCheckbox('no_tun_ipv6', ($('#dev_mode').val() == 'tap')); + hideInput('topology', ($('#dev_mode').val() == 'tap')); } // Process "Automatically generate a shared key" checkbox |