mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Fix handling of infinite lease time.
This commit is contained in:
		| @@ -143,10 +143,10 @@ function validateDHCPInput() | ||||
|         if (!filter_var($_POST['RangeEnd'], FILTER_VALIDATE_IP) && !empty($_POST['RangeEnd'])) { | ||||
|             $errors .= _('Invalid DHCP range end.').'<br />'.PHP_EOL; | ||||
|         } | ||||
|         if (!ctype_digit($_POST['RangeLeaseTime']) && $_POST['RangeLeaseTimeUnits'] !== 'infinite') { | ||||
|         if (!ctype_digit($_POST['RangeLeaseTime']) && $_POST['RangeLeaseTimeUnits'] !== 'i') { | ||||
|             $errors .= _('Invalid DHCP lease time, not a number.').'<br />'.PHP_EOL; | ||||
|         } | ||||
|         if (!in_array($_POST['RangeLeaseTimeUnits'], array('m', 'h', 'd', 'infinite'))) { | ||||
|         if (!in_array($_POST['RangeLeaseTimeUnits'], array('m', 'h', 'd', 'i'))) { | ||||
|             $errors .= _('Unknown DHCP lease time unit.').'<br />'.PHP_EOL; | ||||
|         } | ||||
|         if ($_POST['Metric'] !== '' && !ctype_digit($_POST['Metric'])) { | ||||
| @@ -181,7 +181,7 @@ function updateDnsmasqConfig($iface,$status) | ||||
| { | ||||
|     $config = '# RaspAP '.$iface.' configuration'.PHP_EOL; | ||||
|     $config .= 'interface='.$iface.PHP_EOL.'dhcp-range='.$_POST['RangeStart'].','.$_POST['RangeEnd'].','.$_POST['SubnetMask'].','; | ||||
|     if ($_POST['RangeLeaseTimeUnits'] !== 'infinite') { | ||||
|     if ($_POST['RangeLeaseTimeUnits'] !== 'i') { | ||||
|         $config .= $_POST['RangeLeaseTime']; | ||||
|     } | ||||
|     $config .= $_POST['RangeLeaseTimeUnits'].PHP_EOL; | ||||
|   | ||||
| @@ -107,7 +107,7 @@ | ||||
|         <option value="m"><?php echo _("Minute(s)"); ?></option> | ||||
|         <option value="h"><?php echo _("Hour(s)"); ?></option> | ||||
|         <option value="d"><?php echo _("Day(s)"); ?></option> | ||||
|         <option value="infinite"><?php echo _("Infinite"); ?></option> | ||||
|         <option value="i"><?php echo _("Infinite"); ?></option> | ||||
|       </select> | ||||
|     </div> | ||||
|   </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user