File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 ' ;
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 );
You can’t perform that action at this time.
0 commit comments