mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 19:00:34 +02:00
DHCP: Allow DNS Update configuration in the web user interface
This commit is contained in:
committed by
Michael Tremer
parent
f5fb9a0466
commit
b510e12ac1
@@ -599,6 +599,78 @@ print <<END
|
||||
<td width='40%' align='right'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
|
||||
</tr>
|
||||
</table>
|
||||
END
|
||||
;
|
||||
&Header::closebox();
|
||||
|
||||
# DHCP DNS update support (RFC2136)
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'dhcp dns update'});
|
||||
|
||||
my %checked = ();
|
||||
$checked{'DNS_UPDATE_ENABLED'}{'on'} = ( $dhcpsettings{'DNS_UPDATE_ENABLED'} ne 'on') ? '' : "checked='checked'";
|
||||
|
||||
print <<END
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td width='25%' class='boldbase'>$Lang::tr{'dhcp dns enable update'}</td>
|
||||
<td class='base'><input type='checkbox' name='DNS_UPDATE_ENABLED' $checked{'DNS_UPDATE_ENABLED'}{'on'}>
|
||||
</td>
|
||||
<tr>
|
||||
</table>
|
||||
|
||||
<table width='100%'>
|
||||
END
|
||||
;
|
||||
my @domains = ();
|
||||
|
||||
# Print options for each interface.
|
||||
foreach my $itf (@ITFs) {
|
||||
# Check if DHCP for this interface is enabled.
|
||||
if ($dhcpsettings{"ENABLE_${itf}"} eq 'on') {
|
||||
# Check for same domain name.
|
||||
next if ($dhcpsettings{"DOMAIN_NAME_${itf}"} ~~ @domains);
|
||||
my $lc_itf = lc($itf);
|
||||
|
||||
# Select previously configured update algorithm.
|
||||
my %selected = ();
|
||||
$selected{'DNS_UPDATE_ALGO_${inf}'}{$dhcpsettings{'DNS_UPDATE_ALGO_${inf}'}} = 'selected';
|
||||
|
||||
print <<END
|
||||
<tr>
|
||||
<td colspan='6'> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='6' class='boldbase'><b>$dhcpsettings{"DOMAIN_NAME_${itf}"}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='10%' class='boldbase'>$Lang::tr{'dhcp dns key name'}:</td>
|
||||
<td width='20%'><input type='text' name='DNS_UPDATE_KEY_NAME_${itf}' value='$dhcpsettings{"DNS_UPDATE_KEY_NAME_${itf}"}'></td>
|
||||
<td width='10%' class='boldbase' align='right'>$Lang::tr{'dhcp dns update secret'}: </td>
|
||||
<td width='20%'><input type='password' name='DNS_UPDATE_SECRET_${itf}' value='$dhcpsettings{"DNS_UPDATE_SECRET_${itf}"}'></td>
|
||||
<td width='10%' class='boldbase' align='right'>$Lang::tr{'dhcp dns update algo'}: </td>
|
||||
<td width='20%'>
|
||||
<select name='DNS_UPDATE_ALGO_${itf}'>
|
||||
<option value='hmac-sha1' $selected{'DNS_UPDATE_ALGO_${itf}'}{'hmac-sha1'}>HMAC-SHA1</option>
|
||||
<option value='hmac-md5' $selected{'DNS_UPDATE_ALGO_${itf}'}{'hmac-md5'}>HMAC-MD5</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
|
||||
# Store configured domain based on the interface
|
||||
# in the temporary variable.
|
||||
push(@domains, $dhcpsettings{"DOMAIN_NAME_${itf}"});
|
||||
}
|
||||
print <<END
|
||||
</table>
|
||||
<hr>
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td align='right'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
END
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user