Fix to format config only at the very end if no issues

This commit is contained in:
Ilia Rostovtsev
2021-11-05 01:48:43 +03:00
parent 6ccfd2c7bc
commit 0ec35a3581
5 changed files with 9 additions and 5 deletions

View File

@@ -41,9 +41,10 @@ else {
}
&flush_file_lines();
&unlock_file($d->{'file'});
&format_config_file($d->{'file'});
&update_last_config_change();
&after_changing();
&format_config_file($d->{'file'});
&webmin_log("dir", $in{'delete'} ? 'delete' : 'save',
&virtual_name($v, 1).":".$d->{'words'}->[0], \%in);

View File

@@ -36,9 +36,10 @@ else {
}
&flush_file_lines();
&unlock_file($d->{'file'});
&format_config_file($d->{'file'});
&update_last_config_change();
&after_changing();
&format_config_file($d->{'file'});
&webmin_log("files", $in{'delete'} ? 'delete' : 'save',
"$in{'file'}:$d->{'words'}->[0]", \%in);

View File

@@ -39,9 +39,10 @@ else {
&flush_file_lines();
&update_last_config_change();
&unlock_file($vconf->[0]->{'file'});
&format_config_file($vconf->[0]->{'file'});
&after_changing();
&format_config_file($vconf->[0]->{'file'});
&webmin_log("dir", "create", &virtual_name($v, 1).":$in{'path'}", \%in);
&redirect("virt_index.cgi?virt=$in{'virt'}");

View File

@@ -33,9 +33,10 @@ else {
&flush_file_lines();
&update_last_config_change();
&unlock_file($in{'file'});
&format_config_file($in{'file'});
&after_changing();
&format_config_file($in{'file'});
&webmin_log("files", "create", "$in{'file'}:$in{'path'}", \%in);
&redirect("htaccess_index.cgi?file=".&urlize($in{'file'}));

View File

@@ -246,7 +246,6 @@ foreach my $m (@{$dirsect->{'members'}}) {
&save_directive_struct(undef, $virt, $conf, $conf);
&flush_file_lines();
&unlock_file($f);
&format_config_file($f);
&update_last_config_change();
&unlock_apache_files();
@@ -273,6 +272,7 @@ if (!$found) {
}
&after_changing();
&format_config_file($f);
&webmin_log("virt", "create", ($in{'name_def'} ? $addr : $in{'name'}).$port,
\%in);