Revision e680b2f9
Added by Renato Botelho over 12 years ago
usr/local/www/services_captiveportal.php | ||
---|---|---|
180 | 180 |
} |
181 | 181 |
} |
182 | 182 |
|
183 |
if ($_POST['timeout'] && (!is_numeric($_POST['timeout']) || ($_POST['timeout'] < 1))) { |
|
184 |
$input_errors[] = gettext("The timeout must be at least 1 minute."); |
|
183 |
if ($_POST['timeout']) { |
|
184 |
if (!is_numeric($_POST['timeout']) || ($_POST['timeout'] < 1)) |
|
185 |
$input_errors[] = gettext("The timeout must be at least 1 minute."); |
|
186 |
else if (isset($config['dhcpd']) && is_array($config['dhcpd'])) { |
|
187 |
foreach ($config['dhcpd'] as $dhcpd_if => $dhcpd_data) { |
|
188 |
if (!isset($dhcpd_data['enable'])) |
|
189 |
continue; |
|
190 |
if (!is_array($_POST['cinterface']) || !in_array($dhcpd_if, $_POST['cinterface'])) |
|
191 |
continue; |
|
192 |
|
|
193 |
$deftime = 7200; // Default lease time |
|
194 |
if (isset($dhcpd_data['defaultleasetime']) && is_numeric($dhcpd_data['defaultleasetime'])) |
|
195 |
$deftime = $dhcpd_data['defaultleasetime']; |
|
196 |
|
|
197 |
if ($_POST['timeout'] > $deftime) |
|
198 |
$input_errors[] = gettext("Hard timeout must be less or equal Default lease time set on DHCP Server"); |
|
199 |
} |
|
200 |
} |
|
185 | 201 |
} |
186 | 202 |
if ($_POST['idletimeout'] && (!is_numeric($_POST['idletimeout']) || ($_POST['idletimeout'] < 1))) { |
187 | 203 |
$input_errors[] = gettext("The idle timeout must be at least 1 minute."); |
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