Commit b0704185 authored by Franco Fichtner's avatar Franco Fichtner

inc: fix call to undefined function is_dhcpv6_server_enabled()

While there, move the IPv4 sibling and add a require for the remaining
outside caller.
parent 5b7df974
...@@ -500,43 +500,6 @@ function reload_ttys() ...@@ -500,43 +500,6 @@ function reload_ttys()
exec('/bin/kill -HUP 1'); exec('/bin/kill -HUP 1');
} }
/* DHCP enabled on any interfaces? */
function is_dhcp_server_enabled() {
global $config;
if (!is_array($config['dhcpd']))
return false;
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
if (isset($dhcpifconf['enable']) && !empty($config['interfaces'][$dhcpif]))
return true;
}
return false;
}
/* DHCP enabled on any interfaces? */
function is_dhcpv6_server_enabled() {
global $config;
if (is_array($config['interfaces'])) {
foreach ($config['interfaces'] as $ifcfg) {
if (isset($ifcfg['enable']) && !empty($ifcfg['track6-interface']))
return true;
}
}
if (!isset($config['dhcpdv6']) || !is_array($config['dhcpdv6']))
return false;
foreach ($config['dhcpdv6'] as $dhcpv6if => $dhcpv6ifconf) {
if (isset($dhcpv6ifconf['enable']) && !empty($config['interfaces'][$dhcpv6if]))
return true;
}
return false;
}
/* radvd enabled on any interfaces? */ /* radvd enabled on any interfaces? */
function is_radvd_enabled() { function is_radvd_enabled() {
global $config; global $config;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
require_once("globals.inc"); require_once("globals.inc");
require_once("captiveportal.inc"); require_once("captiveportal.inc");
require_once("openvpn.inc"); require_once("openvpn.inc");
require_once("services.inc");
require_once("ipsec.inc"); require_once("ipsec.inc");
require_once("vpn.inc"); require_once("vpn.inc");
require_once("vslb.inc"); require_once("vslb.inc");
......
...@@ -364,6 +364,23 @@ function services_dhcpd_configure($family = "all", $blacklist = array()) ...@@ -364,6 +364,23 @@ function services_dhcpd_configure($family = "all", $blacklist = array())
} }
} }
function is_dhcp_server_enabled()
{
global $config;
if (!is_array($config['dhcpd'])) {
return false;
}
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
if (isset($dhcpifconf['enable']) && !empty($config['interfaces'][$dhcpif])) {
return true;
}
}
return false;
}
function services_dhcpdv4_configure() function services_dhcpdv4_configure()
{ {
global $config, $g; global $config, $g;
...@@ -977,6 +994,31 @@ function dhcpdzones($ddns_zones, $dhcpifconf) ...@@ -977,6 +994,31 @@ function dhcpdzones($ddns_zones, $dhcpifconf)
return $dhcpdconf; return $dhcpdconf;
} }
function is_dhcpv6_server_enabled()
{
global $config;
if (is_array($config['interfaces'])) {
foreach ($config['interfaces'] as $ifcfg) {
if (isset($ifcfg['enable']) && !empty($ifcfg['track6-interface'])) {
return true;
}
}
}
if (!isset($config['dhcpdv6']) || !is_array($config['dhcpdv6'])) {
return false;
}
foreach ($config['dhcpdv6'] as $dhcpv6if => $dhcpv6ifconf) {
if (isset($dhcpv6ifconf['enable']) && !empty($config['interfaces'][$dhcpv6if])) {
return true;
}
}
return false;
}
function services_dhcpdv6_configure($blacklist = array()) function services_dhcpdv6_configure($blacklist = array())
{ {
global $config, $g; global $config, $g;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment