|
76 | 76 | unset($output); |
77 | 77 |
|
78 | 78 | // List proxy templates |
79 | | -exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var); |
80 | | -$proxy_templates = json_decode(implode('', $output), true); |
81 | | -unset($output); |
| 79 | +if (!empty($_SESSION['PROXY_SYSTEM'])) { |
| 80 | + exec (VESTA_CMD."v-list-web-templates-proxy json", $output, $return_var); |
| 81 | + $proxy_templates = json_decode(implode('', $output), true); |
| 82 | + unset($output); |
| 83 | +} |
82 | 84 |
|
83 | 85 | // List web stat engines |
84 | 86 | exec (VESTA_CMD."v-list-web-stats json", $output, $return_var); |
|
189 | 191 | } |
190 | 192 |
|
191 | 193 | // Delete proxy support |
192 | | - if ((!empty($v_proxy)) && (empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { |
| 194 | + if ((!empty($_SESSION['PROXY_SYSTEM'])) && (!empty($v_proxy)) && (empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { |
193 | 195 | exec (VESTA_CMD."v-delete-web-domain-proxy ".$v_username." ".$v_domain." 'no'", $output, $return_var); |
194 | 196 | check_return_code($return_var,$output); |
195 | 197 | unset($output); |
|
198 | 200 | } |
199 | 201 |
|
200 | 202 | // Change proxy template / Update extention list |
201 | | - if ((!empty($v_proxy)) && (!empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { |
| 203 | + if ((!empty($_SESSION['PROXY_SYSTEM'])) && (!empty($v_proxy)) && (!empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { |
202 | 204 | $ext = preg_replace("/\n/", " ", $_POST['v_proxy_ext']); |
203 | 205 | $ext = preg_replace("/,/", " ", $ext); |
204 | 206 | $ext = preg_replace('/\s+/', ' ',$ext); |
205 | 207 | $ext = trim($ext); |
206 | 208 | $ext = str_replace(' ', ", ", $ext); |
207 | | - if (( $v_proxy_template != $_POST['v_proxy_template']) || ($v_proxy_ext != $ext)) { |
| 209 | + if (( $v_proxy_template != $_POST['v_proxy_template']) || ($v_proxy_ext != $ext)) { |
208 | 210 | $ext = str_replace(', ', ",", $ext); |
209 | 211 | if (!empty($_POST['v_proxy_template'])) $v_proxy_template = $_POST['v_proxy_template']; |
210 | 212 | exec (VESTA_CMD."v-change-web-domain-proxy-tpl ".$v_username." ".$v_domain." ".escapeshellarg($v_proxy_template)." ".escapeshellarg($ext)." 'no'", $output, $return_var); |
|
216 | 218 | } |
217 | 219 |
|
218 | 220 | // Add proxy support |
219 | | - if ((empty($v_proxy)) && (!empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { |
| 221 | + if ((!empty($_SESSION['PROXY_SYSTEM'])) && (empty($v_proxy)) && (!empty($_POST['v_proxy'])) && (empty($_SESSION['error_msg']))) { |
220 | 222 | $v_proxy_template = $_POST['v_proxy_template']; |
221 | 223 | if (!empty($_POST['v_proxy_ext'])) { |
222 | 224 | $ext = preg_replace("/\n/", " ", $_POST['v_proxy_ext']); |
|
280 | 282 | $v_ssl_crt = $_POST['v_ssl_crt']; |
281 | 283 | $v_ssl_key = $_POST['v_ssl_key']; |
282 | 284 | $v_ssl_ca = $_POST['v_ssl_ca']; |
283 | | - |
| 285 | + |
284 | 286 | // Cleanup certificate tempfiles |
285 | 287 | if (!empty($_POST['v_ssl_crt'])) { |
286 | 288 | unlink($tmpdir."/".$_POST['v_domain'].".crt"); |
|
347 | 349 | $v_ssl_key = $_POST['v_ssl_key']; |
348 | 350 | $v_ssl_ca = $_POST['v_ssl_ca']; |
349 | 351 | $v_ssl_home = $_POST['v_ssl_home']; |
350 | | - |
| 352 | + |
351 | 353 | // Cleanup certificate tempfiles |
352 | 354 | if (!empty($_POST['v_ssl_crt'])) { |
353 | 355 | unlink($tmpdir."/".$_POST['v_domain'].".crt"); |
|
584 | 586 | } |
585 | 587 |
|
586 | 588 | // Restart proxy server |
587 | | - if (!empty($restart_proxy) && (empty($_SESSION['error_msg']))) { |
| 589 | + if ((!empty($_SESSION['PROXY_SYSTEM'])) && !empty($restart_proxy) && (empty($_SESSION['error_msg']))) { |
588 | 590 | exec (VESTA_CMD."v-restart-proxy", $output, $return_var); |
589 | 591 | check_return_code($return_var,$output); |
590 | 592 | unset($output); |
|
0 commit comments