---- Changes since 1.430 ----
Fixed bug that can cause option definitions and values to be incorrectly ordered.
Custom option types defined at a higher level (such as in a subnet) can be used in the Edit Options page at lower levels (such as in a host).
+---- Changes since 1.440 ----
+When a subnet or host is renamed, the user's ACL is updated to match.
&error("$text{'eacl_np'} $text{'eacl_puh'}")
unless &can('rw', \%access, $host) &&
(!$npar || &can('rw', \%access, $npar));
+ $oldname = $host->{'values'}->[0];
}
# save
elsif ($par eq $npar) {
# Update host
&save_directive($par, [ $host ], [ $host ], $indent);
+ if ($oldname ne $in{'name'}) {
+ &drop_dhcpd_acl('hst', \%access, $oldname);
+ &save_dhcpd_acl('rw', 'hst', \%access, $in{'name'});
+ }
}
else {
# Move this host
&error("'$in{'network'}' $text{'ssub_invalidsubaddr'}");
&check_ipaddress($in{'netmask'}) ||
&error("'$in{'netmask'}' $text{'ssub_invalidnmask'}");
+ $oldnetwork = $sub->{'values'}->[0];
$sub->{'values'} = [ $in{'network'}, "netmask", $in{'netmask'} ];
}
&save_directive($npar, [ ], [ $sub ], $nindent);
}
elsif ($par eq $npar) {
- # Update the subnet
+ # Update the subnet in the current parent
&save_directive($par, [ $sub ], [ $sub ], $nindent);
+ if ($in{'network'} ne $oldnetwork) {
+ # Fix the ACL
+ &drop_dhcpd_acl('sub', \%access, $oldnetwork);
+ &save_dhcpd_acl('rw','sub',\%access,
+ $in{'network'});
+ }
}
else {
# Move the subnet