mirror of
https://github.com/opnsense/plugins.git
synced 2026-02-03 20:40:37 -05:00
net/isc-dhcp: small change for #5164
This commit is contained in:
parent
14a1301888
commit
7de2634b88
5 changed files with 8 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
PLUGIN_NAME= isc-dhcp
|
||||
PLUGIN_VERSION= 1.0
|
||||
PLUGIN_REVISION= 1
|
||||
PLUGIN_COMMENT= ISC DHCPv4/v6 server
|
||||
PLUGIN_DEPENDS= isc-dhcp44-server
|
||||
PLUGIN_MAINTAINER= franco@opnsense.org
|
||||
|
|
|
|||
|
|
@ -14,3 +14,4 @@ Plugin Changelog
|
|||
* First release resembling the core state of 25.7.11
|
||||
* Minor changes due to "radvd" extraction out of DHCPv6 configuration
|
||||
* Minor changes regarding "track6" mode handling
|
||||
* Added DHCPv6 static mappings export
|
||||
|
|
|
|||
|
|
@ -1197,7 +1197,7 @@ EOD;
|
|||
service_log("done.\n", $verbose);
|
||||
}
|
||||
|
||||
function dhcpd_staticmap($proto = null, $valid_addresses = true, $ifconfig_details = null, $allow_disabled = false)
|
||||
function dhcpd_staticmap($proto = null, $valid_addresses = true, $ifconfig_details = null, $allow_disabled = false, $for_export = false)
|
||||
{
|
||||
$staticmap = [];
|
||||
foreach (empty($proto) ? [4, 6] : [$proto] as $inet) {
|
||||
|
|
@ -1243,7 +1243,9 @@ function dhcpd_staticmap($proto = null, $valid_addresses = true, $ifconfig_detai
|
|||
}
|
||||
|
||||
if ($domain !== null) {
|
||||
$domain = preg_replace('/\s*;\s*/', ',', trim($domain));
|
||||
/* first entry only unless requested */
|
||||
$domain = !$for_export ? preg_split('/[ ;]+/', $domain)[0] :
|
||||
preg_replace('/\s*;\s*/', ',', trim($domain));
|
||||
}
|
||||
|
||||
$entry = [
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|||
}
|
||||
header(url_safe('Location: /services_dhcp.php?if=%s', array($if)));
|
||||
} elseif ($act == "export") {
|
||||
$static = dhcpd_staticmap(4, true, null, true);
|
||||
$static = dhcpd_staticmap(4, true, null, true, true);
|
||||
|
||||
header("Content-Type: text/csv");
|
||||
header("Content-Disposition: attachment; filename=\"isc_export_{$if}.csv\"");
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|||
}
|
||||
exit;
|
||||
} elseif ($act == "export") {
|
||||
$static = dhcpd_staticmap(6, true, null, true);
|
||||
$static = dhcpd_staticmap(6, true, null, true, true);
|
||||
|
||||
header("Content-Type: text/csv");
|
||||
header("Content-Disposition: attachment; filename=\"isc_dhcpdv6_export_{$if}.csv\"");
|
||||
|
|
|
|||
Loading…
Reference in a new issue