Skip to content

Commit c85967f

Browse files
committed
*Add support for aliases
1 parent 4daa17f commit c85967f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

web/add/web/index.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@
149149
// Add Lets Encrypt support
150150

151151
if ((!empty($_POST['v_letsencrypt'])) && (empty($_SESSION['error_msg']))) {
152-
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var);
153-
check_return_code($return_var,$output);
154-
unset($output);
152+
exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var);
153+
$data = json_decode(implode('', $output), true);
154+
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '".$data['ALIAS']."' 'no'", $output, $return_var);
155+
check_return_code($return_var,$output);
156+
unset($output);
155157
}
156158
else {
157159
// Add SSL certificates only if Lets Encrypt is off

web/edit/web/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@
270270
else {
271271
// Delete SSL certificate
272272
if (( $v_ssl == 'yes' ) && (empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
273-
exec (VESTA_CMD."v-delete-web-domain-ssl ".$v_username." ".$v_domain." 'no'", $output, $return_var);
273+
exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var);
274+
$data = json_decode(implode('', $output), true);
275+
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '".$data['ALIAS']."' 'no'", $output, $return_var);
274276
check_return_code($return_var,$output);
275277
unset($output);
276278
$v_ssl = 'no';
@@ -279,6 +281,8 @@
279281
}
280282
}
281283
if (( $v_letsencrypt == 'no' || empty( $v_letsencrypt)) && (!empty($_POST['v_letsencrypt'])) && empty($_SESSION['error_msg'])) {
284+
exec (VESTA_CMD."v-list-web-domain ".$user." ".$v_domain." json", $output, $return_var);
285+
$data = json_decode(implode('', $output), true);
282286
exec (VESTA_CMD."v-add-letsencrypt-domain ".$user." ".$v_domain." '' 'no'", $output, $return_var);
283287
check_return_code($return_var,$output);
284288
unset($output);

0 commit comments

Comments
 (0)