mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
Add API to delete sections
This commit is contained in:
@ -391,6 +391,17 @@ foreach my $m (@{$section->{'members'}}) {
|
||||
}
|
||||
}
|
||||
|
||||
# delete_section(&conf, §ion)
|
||||
# Remove a section and all it's members from the config file
|
||||
sub delete_section
|
||||
{
|
||||
my ($conf, $section) = @_;
|
||||
my $lref = &read_file_lines($section->{'file'});
|
||||
my $len = $section->{'eline'} - $section->{'line'} + 1;
|
||||
splice(@$lref, $section->{'line'}, $len);
|
||||
&renumber($conf, $section->{'line'}, $section->{'file'}, -$len);
|
||||
}
|
||||
|
||||
# renumber(&conf, line, file, offset)
|
||||
sub renumber
|
||||
{
|
||||
|
Reference in New Issue
Block a user