Revision e680b2f9
Added by Renato Botelho over 12 years ago
usr/local/www/services_dhcp.php | ||
---|---|---|
254 | 254 |
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers."); |
255 | 255 |
|
256 | 256 |
if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) |
257 |
$input_errors[] = gettext("The default lease time must be at least 60 seconds."); |
|
257 |
$input_errors[] = gettext("The default lease time must be at least 60 seconds."); |
|
258 |
|
|
259 |
if (isset($config['captiveportal']) && is_array($config['captiveportal'])) { |
|
260 |
$deftime = 7200; // Default value if it's empty |
|
261 |
if (is_numeric($_POST['deftime'])) |
|
262 |
$deftime = $_POST['deftime']; |
|
263 |
|
|
264 |
foreach ($config['captiveportal'] as $cpZone => $cpdata) { |
|
265 |
if (!isset($cpdata['enable'])) |
|
266 |
continue; |
|
267 |
if (!isset($cpdata['timeout']) || !is_numeric($cpdata['timeout'])) |
|
268 |
continue; |
|
269 |
$cp_ifs = explode(',', $cpdata['interface']); |
|
270 |
if (!in_array($if, $cp_ifs)) |
|
271 |
continue; |
|
272 |
if ($cpdata['timeout'] > $deftime) |
|
273 |
$input_errors[] = sprintf(gettext( |
|
274 |
"The Captive Portal zone '%s' has Hard Timeout parameter set to a value bigger than Default lease time (%s)."), $cpZone, $deftime); |
|
275 |
} |
|
276 |
} |
|
277 |
|
|
258 | 278 |
if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) |
259 | 279 |
$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time."); |
260 | 280 |
if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain']))) |
Also available in: Unified diff
Add checks to make sure CP hard timeout is less or equal DHCP server default lease time. It fixes #2899