mirror of
https://github.com/opnsense/core.git
synced 2026-10-12 02:20:36 +00:00
OpenVPN: allow multiple domains settings for client connection (#9281)
* OpenVPN: allow multiple domains settings for client connection * OpenVPN: allow multiple domains settings - update plugin files --------- Co-authored-by: Krisztian Ivancso <[email protected]>
This commit is contained in:
co-authored by
Krisztian Ivancso
parent
f469cf8529
commit
3dd24ff4a2
@@ -365,7 +365,9 @@ function openvpn_validate_cidr($value, $name, $multiple = false, $ipproto = 'ipv
|
||||
function openvpn_add_dhcpopts(&$settings, &$conf)
|
||||
{
|
||||
if (!empty($settings['dns_domain'])) {
|
||||
$conf .= "push \"dhcp-option DOMAIN {$settings['dns_domain']}\"\n";
|
||||
foreach (explode(",", $settings['dns_domain']) as $domain) {
|
||||
$conf .= "push \"dhcp-option DOMAIN {$domain}\"\n";
|
||||
}
|
||||
}
|
||||
if (!empty($settings['dns_domain_search'])) {
|
||||
foreach (explode(",", $settings['dns_domain_search']) as $domain) {
|
||||
|
||||
@@ -150,9 +150,11 @@
|
||||
</field>
|
||||
<field>
|
||||
<id>cso.dns_domain</id>
|
||||
<label>DNS Default Domain</label>
|
||||
<type>text</type>
|
||||
<help>Set Connection-specific DNS Suffix.</help>
|
||||
<label>DNS Domain List</label>
|
||||
<type>select_multiple</type>
|
||||
<style>tokenize</style>
|
||||
<allownew>true</allownew>
|
||||
<help>Set Connection-specific DNS Suffixes.</help>
|
||||
<grid_view>
|
||||
<visible>false</visible>
|
||||
</grid_view>
|
||||
|
||||
@@ -598,10 +598,11 @@ Set to 0 to disable, remember to change your client as well.
|
||||
</field>
|
||||
<field>
|
||||
<id>instance.dns_domain</id>
|
||||
<label>DNS Default Domain</label>
|
||||
<type>text</type>
|
||||
<style>role role_server</style>
|
||||
<help>Set Connection-specific DNS Suffix.</help>
|
||||
<label>DNS Domain list</label>
|
||||
<type>select_multiple</type>
|
||||
<style>tokenize role role_server</style>
|
||||
<allownew>true</allownew>
|
||||
<help>Set Connection-specific DNS Suffixes.</help>
|
||||
<grid_view>
|
||||
<visible>false</visible>
|
||||
</grid_view>
|
||||
|
||||
@@ -664,7 +664,9 @@ class OpenVPN extends BaseModel
|
||||
$options['push'][] = "\"register-dns\"";
|
||||
}
|
||||
if (!$node->dns_domain->isEmpty()) {
|
||||
$options['push'][] = "\"dhcp-option DOMAIN {$node->dns_domain}\"";
|
||||
foreach (explode(',', (string)$node->dns_domain) as $opt) {
|
||||
$options['push'][] = "\"dhcp-option DOMAIN {$opt}\"";
|
||||
}
|
||||
}
|
||||
if (!$node->dns_domain_search->isEmpty()) {
|
||||
foreach (explode(',', (string)$node->dns_domain_search) as $opt) {
|
||||
|
||||
@@ -57,7 +57,9 @@
|
||||
<Default>0</Default>
|
||||
<Required>Y</Required>
|
||||
</register_dns>
|
||||
<dns_domain type="HostnameField"/>
|
||||
<dns_domain type="HostnameField">
|
||||
<AsList>Y</AsList>
|
||||
</dns_domain>
|
||||
<dns_domain_search type="HostnameField">
|
||||
<AsList>Y</AsList>
|
||||
</dns_domain_search>
|
||||
@@ -350,7 +352,9 @@
|
||||
<Default>0</Default>
|
||||
<Required>Y</Required>
|
||||
</register_dns>
|
||||
<dns_domain type="HostnameField"/>
|
||||
<dns_domain type="HostnameField">
|
||||
<AsList>Y</AsList>
|
||||
</dns_domain>
|
||||
<dns_domain_search type="HostnameField">
|
||||
<AsList>Y</AsList>
|
||||
</dns_domain_search>
|
||||
|
||||
Reference in New Issue
Block a user