Add button to restart LDAP client daemon, which is needed to apply settings

This commit is contained in:
Jamie Cameron
2015-03-21 18:01:08 -07:00
parent 4f532659b3
commit df3fa20d6f
3 changed files with 20 additions and 0 deletions

View File

@@ -50,6 +50,8 @@ if ($config{'init_name'} &&
($st = &init::action_status($config{'init_name'}))) {
# Start or stop
if (&init::status_action($config{'init_name'}) == 1) {
print &ui_buttons_row("restart.cgi", $text{'index_restart'},
$text{'index_restartdesc'});
print &ui_buttons_row("stop.cgi", $text{'index_stop'},
$text{'index_stopdesc'});
}

View File

@@ -10,6 +10,8 @@ index_stop=Stop LDAP Client Daemon
index_stopdesc=Shut down the local LDAP client daemon, which is needed to query the remote LDAP server.
index_start=Start LDAP Client Daemon
index_startdesc=Start up the local LDAP client daemon, which is needed to query the remote LDAP server. Until it is started, users and groups in LDAP will not be accessible.
index_restart=Restart LDAP Client Daemon
index_restartdesc=Apply the current configuration by restarting the local LDAP client daemon.
index_atboot=Start LDAP Client At Boot
index_atbootdesc=Changes whether the LDAP client daemon is started when the system boots up or not.
@@ -212,6 +214,7 @@ log_atboot=Enabled LDAP client daemon at boot time
log_delboot=Disabled LDAP client daemon at boot time
log_start=Started LDAP client daemon
log_stop=Stopped LDAP client daemon
log_restart=Restarted LDAP client daemon
check_title=Validating LDAP Configuration
check_base=Finding LDAP base for users ..

15
ldap-client/restart.cgi Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/local/bin/perl
# Re-start the LDAP client daemon
require './ldap-client-lib.pl';
&error_setup($text{'start_err'});
&fix_ldap_authconfig();
&foreign_require("init");
&init::stop_action($config{'init_name'});
($ok, $out) = &init::start_action($config{'init_name'});
$ok || &error($out);
&webmin_log("restart");
&redirect("");