1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00
Signed-off-by: D9ping <D9ping@users.noreply.github.com>
This commit is contained in:
D9ping 2018-09-25 21:32:31 +02:00
parent 39605c14db
commit b292ee218c

View File

@ -29,7 +29,7 @@ function DisplayDHCPConfig() {
$errors .= _('Invalid DHCP range end.').'<br />'.PHP_EOL; $errors .= _('Invalid DHCP range end.').'<br />'.PHP_EOL;
} }
if (!ctype_digit($_POST['RangeLeaseTime'])) { if (!ctype_digit($_POST['RangeLeaseTime']) && $_POST['RangeLeaseTimeUnits'] !== 'infinite') {
$errors .= _('Invalid DHCP lease time, not a number.').'<br />'.PHP_EOL; $errors .= _('Invalid DHCP lease time, not a number.').'<br />'.PHP_EOL;
} }
@ -41,7 +41,12 @@ function DisplayDHCPConfig() {
if (empty($errors)) { if (empty($errors)) {
$config = 'interface='.$_POST['interface'].PHP_EOL. $config = 'interface='.$_POST['interface'].PHP_EOL.
'dhcp-range='.$_POST['RangeStart'].','.$_POST['RangeEnd']. 'dhcp-range='.$_POST['RangeStart'].','.$_POST['RangeEnd'].
',255.255.255.0,'.$_POST['RangeLeaseTime'].$_POST['RangeLeaseTimeUnits']; ',255.255.255.0,';
if ($_POST['RangeLeaseTimeUnits'] !== 'infinite') {
$config .= $_POST['RangeLeaseTime'];
}
$config .= $_POST['RangeLeaseTimeUnits'];
exec('echo "'.$config.'" > /tmp/dhcpddata', $temp); exec('echo "'.$config.'" > /tmp/dhcpddata', $temp);
system('sudo cp /tmp/dhcpddata '.RASPI_DNSMASQ_CONFIG, $return); system('sudo cp /tmp/dhcpddata '.RASPI_DNSMASQ_CONFIG, $return);
} else { } else {