[Web] Fix typo and missing Dovecot restart function (fixes #3466)

This commit is contained in:
andryyy 2020-04-12 19:26:32 +02:00
parent 655c9b4eba
commit aca16f68d1
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF

View File

@ -97,6 +97,21 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
fwrite($filter_handle, $script_data); fwrite($filter_handle, $script_data);
fclose($filter_handle); fclose($filter_handle);
} }
$restart_response = json_decode(docker('post', 'dovecot-mailcow', 'restart'), true);
if ($restart_response['type'] == "success") {
$_SESSION['return'][] = array(
'type' => 'success',
'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
'msg' => 'dovecot_restart_success'
);
}
else {
$_SESSION['return'][] = array(
'type' => 'warning',
'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
'msg' => 'dovecot_restart_failed'
);
}
} }
catch (Exception $e) { catch (Exception $e) {
$_SESSION['return'][] = array( $_SESSION['return'][] = array(
@ -117,8 +132,8 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
fwrite($filter_handle, $script_data); fwrite($filter_handle, $script_data);
fclose($filter_handle); fclose($filter_handle);
} }
$restart_reponse = json_decode(docker('post', 'dovecot-mailcow', 'restart'), true); $restart_response = json_decode(docker('post', 'dovecot-mailcow', 'restart'), true);
if ($restart_reponse['type'] == "success") { if ($restart_response['type'] == "success") {
$_SESSION['return'][] = array( $_SESSION['return'][] = array(
'type' => 'success', 'type' => 'success',
'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
@ -548,8 +563,8 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
ratelimit('edit', 'domain', array('rl_value' => $_data['rl_value'], 'rl_frame' => $_data['rl_frame'], 'object' => $domain)); ratelimit('edit', 'domain', array('rl_value' => $_data['rl_value'], 'rl_frame' => $_data['rl_frame'], 'object' => $domain));
} }
if (!empty($restart_sogo)) { if (!empty($restart_sogo)) {
$restart_reponse = json_decode(docker('post', 'sogo-mailcow', 'restart'), true); $restart_response = json_decode(docker('post', 'sogo-mailcow', 'restart'), true);
if ($restart_reponse['type'] == "success") { if ($restart_response['type'] == "success") {
$_SESSION['return'][] = array( $_SESSION['return'][] = array(
'type' => 'success', 'type' => 'success',
'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),