Make sure atd is running if needed

https://github.com/webmin/webmin/issues/2461
This commit is contained in:
Jamie Cameron 2025-04-27 09:52:43 -07:00
parent d073280e80
commit b92d8d11d6
2 changed files with 10 additions and 0 deletions

View File

@ -72,6 +72,15 @@ if ($in{'bg'} == 1 && $can_schedule) {
eval { $download{'time'} = timelocal(0, $in{'min'}, $in{'hour'},
$in{'day'}, $in{'month'}, $in{'year'}-1900) };
$@ && &error($text{'download_edate2'});
# Validate that atd is running, if needed
if (&foreign_installed("at") && !$module_info{'usermin'}) {
&foreign_require("at");
my ($init, $r, $atboot) = &at::get_init_status();
if ($init && $r == 0) {
&error(&text('download_eatd', &get_webprefix().'/at/'));
}
}
}
if (defined($in{'email_def'}) && !$in{'email_def'}) {
# Validate email

View File

@ -78,6 +78,7 @@ download_failed=Download failed : $1
download_eaccess=You are not allowed to download files to $1
download_eucannot=You are not allowed to download files as user $1
download_egcannot=The selected group does not contain the selected user
download_eatd=Scheduled downloads are not possible unless the At daemon is running. It can be started in the <a href='$1'>scheduled commands</a> module.
cancel_err=Failed to cancel downloads
cancel_enone=None selected