*Add support for aliases

This commit is contained in:
Derrick Hammer 2016-09-25 03:00:13 -04:00
commit c85967f894
2 changed files with 10 additions and 4 deletions

View file

@ -149,9 +149,11 @@ if (!empty($_POST['ok'])) {
// Add Lets Encrypt support
if ((!empty($_POST['v_letsencrypt'])) && (empty($_SESSION['error_msg']))) {
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var);
check_return_code($return_var,$output);
unset($output);
exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '".$data['ALIAS']."' 'no'", $output, $return_var);
check_return_code($return_var,$output);
unset($output);
}
else {
// Add SSL certificates only if Lets Encrypt is off

View file

@ -270,7 +270,9 @@ if (!empty($_POST['save'])) {
else {
// Delete SSL certificate
if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
exec (VESTA_CMD."v-delete-web-domain-ssl ".$v_username." ".$v_domain." 'no'", $output, $return_var);
exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '".$data['ALIAS']."' 'no'", $output, $return_var);
check_return_code($return_var,$output);
unset($output);
$v_ssl = 'no';
@ -279,6 +281,8 @@ if (!empty($_POST['save'])) {
}
}
if (( $v_letsencrypt == 'no' || empty( $v_letsencrypt)) && (!empty($_POST['v_letsencrypt'])) && empty($_SESSION['error_msg'])) {
exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var);
check_return_code($return_var,$output);
unset($output);