mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Add ACL for stopping and starting atd https://github.com/virtualmin/virtualmin-gpl/issues/246
This commit is contained in:
@@ -21,7 +21,10 @@ print &ui_table_row($text{'acl_users'},
|
||||
]), 3);
|
||||
|
||||
print &ui_table_row($text{'acl_allow'},
|
||||
&ui_yesno_radio("allow", $o->{'allow'}));
|
||||
&ui_yesno_radio("allow", $o->{'allow'}), 3);
|
||||
|
||||
print &ui_table_row($text{'acl_stop'},
|
||||
&ui_yesno_radio("stop", $o->{'stop'}), 3);
|
||||
}
|
||||
|
||||
# acl_security_save(&options)
|
||||
@@ -34,5 +37,6 @@ $o->{'users'} = $in{'mode'} == 0 || $in{'mode'} == 3 ? "" :
|
||||
$in{'mode'} == 1 ? $in{'userscan'}
|
||||
: $in{'userscannot'};
|
||||
$o->{'allow'} = $in{'allow'};
|
||||
$o->{'stop'} = $in{'stop'};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
require './at-lib.pl';
|
||||
&ReadParse();
|
||||
&foreign_require("init");
|
||||
$access{'stop'} || &error($text{'bootup_ecannot'});
|
||||
$init = &get_init_name();
|
||||
if ($in{'boot'}) {
|
||||
&init::enable_at_boot($init);
|
||||
|
||||
@@ -2,3 +2,4 @@ noconfig=0
|
||||
users=
|
||||
mode=0
|
||||
allow=1
|
||||
stop=1
|
||||
|
||||
@@ -140,7 +140,7 @@ if ($access{'allow'} && $config{'allow_file'}) {
|
||||
# If there is an init script that runs an atd server, show status
|
||||
&foreign_require("init");
|
||||
my $init = defined(&get_init_name) ? &get_init_name() : undef;
|
||||
if ($init) {
|
||||
if ($access{'stop'} && $init) {
|
||||
print &ui_hr();
|
||||
print &ui_buttons_start();
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ acl_this=Current Webmin user
|
||||
acl_only=Only users
|
||||
acl_except=All except users
|
||||
acl_allow=Can edit allowed At users?
|
||||
acl_stop=Can stop and start <tt>atd</tt>?
|
||||
|
||||
run_title=Running Command
|
||||
run_output=Output from scheduled command ..
|
||||
@@ -79,5 +80,8 @@ log_bootdown=Disabled scheduled commands server at boot
|
||||
|
||||
stop_err=Failed to stop server
|
||||
start_err=Failed to start server
|
||||
stop_ecannot=You are not allowed to stop the server
|
||||
start_ecannot=You are not allowed to start the server
|
||||
bootup_ecannot=You are not allowed to enable the server at boot
|
||||
|
||||
__norefs=1
|
||||
|
||||
1
at/negativeacl
Normal file
1
at/negativeacl
Normal file
@@ -0,0 +1 @@
|
||||
stop=0
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
require './at-lib.pl';
|
||||
&error_setup($text{'start_err'});
|
||||
$access{'stop'} || &error($text{'start_ecannot'});
|
||||
&foreign_require("init");
|
||||
my $init = &get_init_name();
|
||||
my ($ok, $err) = &init::start_action($init);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
require './at-lib.pl';
|
||||
&error_setup($text{'stop_err'});
|
||||
$access{'stop'} || &error($text{'stop_ecannot'});
|
||||
&foreign_require("init");
|
||||
my $init = &get_init_name();
|
||||
my ($ok, $err) = &init::stop_action($init);
|
||||
|
||||
Reference in New Issue
Block a user