From 997990a2c4219df92d4957af2e5187ee598c82b4 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 6 Oct 2016 18:52:55 +0300 Subject: [PATCH] Update SSL info --- web/edit/web/index.php | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/web/edit/web/index.php b/web/edit/web/index.php index c7fd411d2..6f4e6b5cc 100644 --- a/web/edit/web/index.php +++ b/web/edit/web/index.php @@ -308,9 +308,20 @@ if (!empty($_POST['save'])) { unset($output); $restart_web = 'yes'; $restart_proxy = 'yes'; - $v_ssl_crt = $_POST['v_ssl_crt']; - $v_ssl_key = $_POST['v_ssl_key']; - $v_ssl_ca = $_POST['v_ssl_ca']; + + exec (VESTA_CMD."v-list-web-domain-ssl ".$user." '".$v_domain."' json", $output, $return_var); + $ssl_str = json_decode(implode('', $output), true); + unset($output); + $v_ssl_crt = $ssl_str[$v_domain]['CRT']; + $v_ssl_key = $ssl_str[$v_domain]['KEY']; + $v_ssl_ca = $ssl_str[$v_domain]['CA']; + $v_ssl_subject = $ssl_str[$v_domain]['SUBJECT']; + $v_ssl_aliases = $ssl_str[$v_domain]['ALIASES']; + $v_ssl_not_before = $ssl_str[$v_domain]['NOT_BEFORE']; + $v_ssl_not_after = $ssl_str[$v_domain]['NOT_AFTER']; + $v_ssl_signature = $ssl_str[$v_domain]['SIGNATURE']; + $v_ssl_pub_key = $ssl_str[$v_domain]['PUB_KEY']; + $v_ssl_issuer = $ssl_str[$v_domain]['ISSUER']; // Cleanup certificate tempfiles if (!empty($_POST['v_ssl_crt'])) { @@ -374,10 +385,20 @@ if (!empty($_POST['save'])) { $v_ssl = 'yes'; $restart_web = 'yes'; $restart_proxy = 'yes'; - $v_ssl_crt = $_POST['v_ssl_crt']; - $v_ssl_key = $_POST['v_ssl_key']; - $v_ssl_ca = $_POST['v_ssl_ca']; - $v_ssl_home = $_POST['v_ssl_home']; + + exec (VESTA_CMD."v-list-web-domain-ssl ".$user." '".$v_domain."' json", $output, $return_var); + $ssl_str = json_decode(implode('', $output), true); + unset($output); + $v_ssl_crt = $ssl_str[$v_domain]['CRT']; + $v_ssl_key = $ssl_str[$v_domain]['KEY']; + $v_ssl_ca = $ssl_str[$v_domain]['CA']; + $v_ssl_subject = $ssl_str[$v_domain]['SUBJECT']; + $v_ssl_aliases = $ssl_str[$v_domain]['ALIASES']; + $v_ssl_not_before = $ssl_str[$v_domain]['NOT_BEFORE']; + $v_ssl_not_after = $ssl_str[$v_domain]['NOT_AFTER']; + $v_ssl_signature = $ssl_str[$v_domain]['SIGNATURE']; + $v_ssl_pub_key = $ssl_str[$v_domain]['PUB_KEY']; + $v_ssl_issuer = $ssl_str[$v_domain]['ISSUER']; // Cleanup certificate tempfiles if (!empty($_POST['v_ssl_crt'])) {