\n";
@@ -107,7 +104,6 @@ if ($ty == 1 && $access{'bootup'} == 1) {
elsif (!$config{'expert'} || $access{'bootup'} == 2) {
# Just tell the user if this action is started at boot time
local $boot = 0;
- print "
\n";
+print &ui_buttons_end();
&ui_print_footer("/", $text{'index'});
diff --git a/init/init-lib.pl b/init/init-lib.pl
index 0ef8ca845..ef7680080 100755
--- a/init/init-lib.pl
+++ b/init/init-lib.pl
@@ -14,6 +14,9 @@
do '../web-lib.pl';
&init_config();
do '../ui-lib.pl';
+@action_buttons = ( 'start', 'restart', 'condrestart', 'reload', 'status',
+ 'stop' );
+%access = &get_module_acl();
# Work out init mode
if ($config{'hostconfig'}) {
diff --git a/init/lang/en b/init/lang/en
index 441c11c2b..49a5bf147 100644
--- a/init/lang/en
+++ b/init/lang/en
@@ -18,9 +18,9 @@ index_provides=Provides
index_setting=Setting
index_script_mac=The script $1 listed below will be run at bootup time. However, it is suggested that you add your own commands to have daemons or servers started upon system boot to the startup directory.
index_editconfig=Edit the $1 file manually
-index_stop=Stop Selected
-index_start=Start Selected
-index_restart=Restart Selected
+index_stop=Stop
+index_start=Start
+index_restart=Restart
index_rlchange=Change to runlevel:
index_rlchangedesc=Click this button to switch your system from the current runlevel to the selected one. This will cause all the actions in the current level to be stopped, and then all the actions in the new runlevel to be started.
index_addboot=Start On Boot
diff --git a/init/mass_rcs.cgi b/init/mass_rcs.cgi
index faef89d37..6733c8be4 100755
--- a/init/mass_rcs.cgi
+++ b/init/mass_rcs.cgi
@@ -2,7 +2,6 @@
# Start or stop a bunch of RC scripts
require './init-lib.pl';
-%access = &get_module_acl();
&ReadParse();
@sel = split(/\0/, $in{'d'});
@sel || &error($text{'mass_enone'});
diff --git a/init/mass_start_stop.cgi b/init/mass_start_stop.cgi
index aebed29e0..345d0cc72 100755
--- a/init/mass_start_stop.cgi
+++ b/init/mass_start_stop.cgi
@@ -3,7 +3,6 @@
# Start or stop multiple actions at once
require './init-lib.pl';
-%access = &get_module_acl();
&ReadParse();
@sel = split(/\0/, $in{'idx'});
@sel || &error($text{'mass_enone2'});
diff --git a/init/modifyhostconfig.cgi b/init/modifyhostconfig.cgi
index 85eaf30e5..67c20e1ae 100755
--- a/init/modifyhostconfig.cgi
+++ b/init/modifyhostconfig.cgi
@@ -6,7 +6,6 @@
# for OSX/Darwin
require './init-lib.pl';
-%access = &get_module_acl();
$access{'bootup'} == 1 || &error("You are not allowed to edit the bootup script");
&ReadParse();
diff --git a/init/reboot.cgi b/init/reboot.cgi
index 296aff54c..5c7cc3a8a 100755
--- a/init/reboot.cgi
+++ b/init/reboot.cgi
@@ -4,7 +4,6 @@
require './init-lib.pl';
&ReadParse();
-%access = &get_module_acl();
$access{'reboot'} || &error($text{'reboot_ecannot'});
&ui_print_header(undef, $text{'reboot_title'}, "");
print "
\n";
diff --git a/init/save_action.cgi b/init/save_action.cgi
index a7f388499..d903d21cb 100755
--- a/init/save_action.cgi
+++ b/init/save_action.cgi
@@ -4,10 +4,29 @@
require './init-lib.pl';
&error_setup($text{'save_err'});
-%access = &get_module_acl();
-$access{'bootup'} == 1 || &error($text{'save_ecannot'});
&ReadParseMime();
+# Redirect to other CGIs for delete / start / stop
+if ($in{'delete'} && $in{'old'}) {
+ &redirect("delete_action.cgi?type=".&urlize($in{'type'}).
+ "&action=".&urlize($in{'old'}).
+ "&runlevel=".&urlize($in{'runlevel'}).
+ "&startstop=".&urlize($in{'startstop'}).
+ "&number=".&urlize($in{'number'}));
+ }
+elsif ($in{'old'}) {
+ foreach $a (@action_buttons) {
+ if ($in{$a}) {
+ &redirect("start_stop.cgi?file=".&urlize($in{'file'}).
+ "&name=".&urlize($in{'old'})."&$a=1".
+ "&back=".&urlize($in{'back'}));
+ exit;
+ }
+ }
+ }
+
+$access{'bootup'} == 1 || &error($text{'save_ecannot'});
+
# Check inputs
$in{'extra'} || $in{name} =~ /^[A-z0-9\_\-\.]+$/ ||
&error($text{'save_ename'});
diff --git a/init/save_hostconfig_action.cgi b/init/save_hostconfig_action.cgi
index f35b1e04a..96e91bf53 100755
--- a/init/save_hostconfig_action.cgi
+++ b/init/save_hostconfig_action.cgi
@@ -8,7 +8,6 @@
# module for Darwin and OS X.
require './init-lib.pl';
-%access = &get_module_acl();
$access{'bootup'} == 1 || &error("You are not allowed to edit the bootup script");
&ReadParse();
diff --git a/init/save_local.cgi b/init/save_local.cgi
index 4bc2b594e..ffd7818b2 100755
--- a/init/save_local.cgi
+++ b/init/save_local.cgi
@@ -3,7 +3,6 @@
# Save the local startup script
require './init-lib.pl';
-%access = &get_module_acl();
$access{'bootup'} == 1 || &error("You are not allowed to edit the bootup script");
&ReadParse();
$in{'local'} =~ s/\r//g;
diff --git a/init/save_rc.cgi b/init/save_rc.cgi
index 888782d68..013e4572b 100755
--- a/init/save_rc.cgi
+++ b/init/save_rc.cgi
@@ -3,7 +3,6 @@
require './init-lib.pl';
&ReadParse();
-%access = &get_module_acl();
$access{'bootup'} || &error($text{'edit_ecannot'});
&foreign_require("proc", "proc-lib.pl");
diff --git a/init/save_services.cgi b/init/save_services.cgi
index 47f6e8d52..3e35c7b8c 100755
--- a/init/save_services.cgi
+++ b/init/save_services.cgi
@@ -2,7 +2,6 @@
# Start or stop a bunch of win32 services
require './init-lib.pl';
-%access = &get_module_acl();
&ReadParse();
@sel = split(/\0/, $in{'d'});
@sel || &error($text{'mass_enone2'});
diff --git a/init/save_startscript.cgi b/init/save_startscript.cgi
index d5458929b..e6c916d66 100755
--- a/init/save_startscript.cgi
+++ b/init/save_startscript.cgi
@@ -19,7 +19,6 @@
require './init-lib.pl';
require './hostconfig-lib.pl';
use File::Basename;
-%access = &get_module_acl();
$access{'bootup'} == 1 || &error("You are not allowed to edit the bootup script");
&ReadParse();
diff --git a/init/shutdown.cgi b/init/shutdown.cgi
index b8f10ae08..8dbd4bc7a 100755
--- a/init/shutdown.cgi
+++ b/init/shutdown.cgi
@@ -4,7 +4,6 @@
require './init-lib.pl';
&ReadParse();
-%access = &get_module_acl();
$access{'shutdown'} || &error($text{'shutdown_ecannot'});
&ui_print_header(undef, $text{'shutdown_title'}, "");
print "