Merge branch 'master' of github.com:webmin/webmin

This commit is contained in:
Jamie Cameron
2020-09-10 12:28:02 -07:00
4 changed files with 21 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -299,7 +299,8 @@ if ($mode == 0) {
$file = &date_subs($path);
}
else {
$file = &transname();
my $ext = &has_command("gzip") ? '.tar.gz' : '.tar';
$file = &transname_timestamped("backup", $ext);
}
# Get module descriptions

View File

@@ -101,7 +101,7 @@ else {
# Key algorithm
print &ui_table_row($text{'zonekey_alg'},
&ui_select("alg", "RSASHA1",
&ui_select("alg", "RSASHA256",
[ &list_dnssec_algorithms() ]));
# Key size

View File

@@ -343,6 +343,23 @@ push(@main::temporary_files, $rv);
return $rv;
}
=head2 transname_timestamped([filename], [extension])
Behaves exactly like transname, but returns a filename with current timestamp
=item filename - Optional filename prefix to preppend
=item extension - Optional extension for a filename to append
=cut
sub transname_timestamped
{
my ($fname, $fextension) = @_;
my $fdate = strftime('%Y%m%d_%H%M%S', localtime());
$fname = "${fname}-" if ($fname);
return &transname("$fname$fdate$fextension");
}
=head2 trunc(string, maxlen)
Truncates a string to the shortest whole word less than or equal to the