|
83 | 83 | check_return_code($return_var,$output); |
84 | 84 | unset($output); |
85 | 85 | } |
86 | | - |
87 | | - // Flush field values on success |
88 | | - if (empty($_SESSION['error_msg'])) { |
89 | | - $_SESSION['ok_msg'] = sprintf(_('MAIL_DOMAIN_CREATED_OK'),htmlentities($_POST['v_domain']),htmlentities($_POST['v_domain'])); |
90 | | - unset($v_domain); |
91 | | - } |
92 | 86 |
|
93 | 87 | if (!empty($_SESSION['IMAP_SYSTEM']) && !empty($_SESSION['WEBMAIL_SYSTEM'])){ |
94 | | - if(!empty($_POST['v_webmail'])){ |
| 88 | + if (empty($_SESSION['error_msg'])) { |
| 89 | + if (!empty($_POST['v_webmail'])) { |
95 | 90 | $v_webmail = escapeshellarg($_POST['v_webmail']); |
96 | | - exec (HESTIA_CMD."v-add-sys-webmail ".$user." ".$v_domain." ".$v_webmail, $output, $return_var); |
| 91 | + exec (HESTIA_CMD."v-add-sys-webmail ".$user." ".$v_domain." ".$v_webmail." yes", $output, $return_var); |
97 | 92 | check_return_code($return_var,$output); |
98 | 93 | unset($output); |
99 | 94 | } |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | + if (empty($_POST['v_webmail'])) { |
| 99 | + if (empty($_SESSION['error_msg'])) { |
| 100 | + exec (HESTIA_CMD."v-delete-sys-webmail ".$user." ".$v_domain." yes", $output, $return_var); |
| 101 | + check_return_code($return_var,$output); |
| 102 | + unset($output); |
| 103 | + } |
| 104 | + } |
| 105 | + |
| 106 | + // Flush field values on success |
| 107 | + if (empty($_SESSION['error_msg'])) { |
| 108 | + $_SESSION['ok_msg'] = sprintf(_('MAIL_DOMAIN_CREATED_OK'),htmlentities($_POST['v_domain']),htmlentities($_POST['v_domain'])); |
| 109 | + unset($v_domain, $v_webmail); |
100 | 110 | } |
101 | 111 | } |
102 | 112 |
|
|
0 commit comments