Révision 565488c9
Ajouté par Renato Botelho il y a plus de 9 ans
usr/local/www/services_dhcp.php | ||
---|---|---|
216 | 216 |
return true; |
217 | 217 |
} |
218 | 218 |
|
219 |
if ($_POST) {
|
|
219 |
if (isset($_POST['submit'])) {
|
|
220 | 220 |
|
221 | 221 |
unset($input_errors); |
222 | 222 |
|
... | ... | |
518 | 518 |
} |
519 | 519 |
|
520 | 520 |
write_config(); |
521 |
} |
|
522 |
} |
|
521 | 523 |
|
522 |
$retval = 0; |
|
523 |
$retvaldhcp = 0; |
|
524 |
$retvaldns = 0; |
|
525 |
/* Stop DHCP so we can cleanup leases */ |
|
526 |
killbyname("dhcpd"); |
|
527 |
dhcp_clean_leases(); |
|
528 |
/* dnsmasq_configure calls dhcpd_configure */ |
|
529 |
/* no need to restart dhcpd twice */ |
|
530 |
if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) { |
|
531 |
$retvaldns = services_dnsmasq_configure(); |
|
532 |
if ($retvaldns == 0) { |
|
533 |
clear_subsystem_dirty('hosts'); |
|
534 |
clear_subsystem_dirty('staticmaps'); |
|
535 |
} |
|
536 |
} else if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) { |
|
537 |
$retvaldns = services_unbound_configure(); |
|
538 |
if ($retvaldns == 0) |
|
539 |
clear_subsystem_dirty('unbound'); |
|
540 |
} else { |
|
541 |
$retvaldhcp = services_dhcpd_configure(); |
|
542 |
if ($retvaldhcp == 0) |
|
543 |
clear_subsystem_dirty('staticmaps'); |
|
524 |
if (isset($_POST['submit']) || isset($_POST['apply'])) { |
|
525 |
$retval = 0; |
|
526 |
$retvaldhcp = 0; |
|
527 |
$retvaldns = 0; |
|
528 |
/* Stop DHCP so we can cleanup leases */ |
|
529 |
killbyname("dhcpd"); |
|
530 |
dhcp_clean_leases(); |
|
531 |
/* dnsmasq_configure calls dhcpd_configure */ |
|
532 |
/* no need to restart dhcpd twice */ |
|
533 |
if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) { |
|
534 |
$retvaldns = services_dnsmasq_configure(); |
|
535 |
if ($retvaldns == 0) { |
|
536 |
clear_subsystem_dirty('hosts'); |
|
537 |
clear_subsystem_dirty('staticmaps'); |
|
544 | 538 |
} |
545 |
if ($dhcpd_enable_changed) |
|
546 |
$retvalfc = filter_configure(); |
|
547 |
|
|
548 |
if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) |
|
549 |
$retval = 1; |
|
550 |
$savemsg = get_std_save_message($retval); |
|
539 |
} else if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) { |
|
540 |
$retvaldns = services_unbound_configure(); |
|
541 |
if ($retvaldns == 0) |
|
542 |
clear_subsystem_dirty('unbound'); |
|
543 |
} else { |
|
544 |
$retvaldhcp = services_dhcpd_configure(); |
|
545 |
if ($retvaldhcp == 0) |
|
546 |
clear_subsystem_dirty('staticmaps'); |
|
551 | 547 |
} |
548 |
if ($dhcpd_enable_changed) |
|
549 |
$retvalfc = filter_configure(); |
|
550 |
|
|
551 |
if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) |
|
552 |
$retval = 1; |
|
553 |
$savemsg = get_std_save_message($retval); |
|
552 | 554 |
} |
553 | 555 |
|
554 | 556 |
if ($act == "delpool") { |
... | ... | |
1195 | 1197 |
<input type="hidden" name="pool" value="<?php echo $pool; ?>" /> |
1196 | 1198 |
<?php endif; ?> |
1197 | 1199 |
<input name="if" type="hidden" value="<?=htmlspecialchars($if);?>" /> |
1198 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
|
|
1200 |
<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
|
|
1199 | 1201 |
</td> |
1200 | 1202 |
</tr> |
1201 | 1203 |
<tr> |
Formats disponibles : Unified diff
Do now call write_config() when click on Apply Changes because it was already done and it causes dhcpd to restart one more time on secondary nodes. It fixes #3797