From df3fa20d6f9161305972a6dffb9834f7c42d86f8 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sat, 21 Mar 2015 18:01:08 -0700 Subject: [PATCH] Add button to restart LDAP client daemon, which is needed to apply settings --- ldap-client/index.cgi | 2 ++ ldap-client/lang/en | 3 +++ ldap-client/restart.cgi | 15 +++++++++++++++ 3 files changed, 20 insertions(+) create mode 100755 ldap-client/restart.cgi diff --git a/ldap-client/index.cgi b/ldap-client/index.cgi index 1f1dfb749..046a2ba10 100755 --- a/ldap-client/index.cgi +++ b/ldap-client/index.cgi @@ -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'}); } diff --git a/ldap-client/lang/en b/ldap-client/lang/en index a75d4bffa..455ed2fdc 100644 --- a/ldap-client/lang/en +++ b/ldap-client/lang/en @@ -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 .. diff --git a/ldap-client/restart.cgi b/ldap-client/restart.cgi new file mode 100755 index 000000000..cbc69b258 --- /dev/null +++ b/ldap-client/restart.cgi @@ -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(""); +