|
757 | 757 | unset($_POST['v-custom-doc-domain'], $_POST['v-custom-doc-folder']); |
758 | 758 | } |
759 | 759 |
|
760 | | - if ( !empty($_POST['v-custom-doc-domain']) && !empty($_POST['v_custom_doc_root_check']) && $v_custom_doc_root_prepath.$v_custom_doc_domain.'/public_html'.$v_custom_doc_folder != $v_custom_doc_root || ($_POST['v-custom-doc-domain'] == $v_domain && !empty($_POST['v-custom-doc-folder']))){ |
761 | | - |
762 | | - $v_custom_doc_domain = escapeshellarg($_POST['v-custom-doc-domain']); |
763 | | - $v_custom_doc_folder = escapeshellarg($_POST['v-custom-doc-folder']); |
764 | | - |
765 | | - exec(HESTIA_CMD."v-change-web-domain-docroot ".$v_username." ".escapeshellarg($v_domain)." ".$v_custom_doc_domain." ".$v_custom_doc_folder, $output, $return_var); |
766 | | - check_return_code($return_var,$output); |
767 | | - unset($output); |
768 | | - $v_custom_doc_root = 1; |
769 | | - |
| 760 | + if ( !empty($_POST['v-custom-doc-domain']) && !empty($_POST['v_custom_doc_root_check']) && $v_custom_doc_root_prepath.$v_custom_doc_domain.'/public_html'.$v_custom_doc_folder != $v_custom_doc_root){ |
| 761 | + if($_POST['v-custom-doc-domain'] == $v_domain && empty($_POST['v-custom-doc-folder'])){ |
| 762 | + exec(HESTIA_CMD."v-change-web-domain-docroot ".$v_username." ".escapeshellarg($v_domain)." default", $output, $return_var); |
| 763 | + check_return_code($return_var,$output); |
| 764 | + unset($output); |
| 765 | + }else{ |
| 766 | + $v_custom_doc_domain = escapeshellarg($_POST['v-custom-doc-domain']); |
| 767 | + $v_custom_doc_folder = escapeshellarg($_POST['v-custom-doc-folder']); |
770 | 768 |
|
771 | | - } |
772 | | - |
| 769 | + exec(HESTIA_CMD."v-change-web-domain-docroot ".$v_username." ".escapeshellarg($v_domain)." ".$v_custom_doc_domain." ".$v_custom_doc_folder, $output, $return_var); |
| 770 | + check_return_code($return_var,$output); |
| 771 | + unset($output); |
| 772 | + $v_custom_doc_root = 1; |
| 773 | + } |
| 774 | + }else{ |
| 775 | + unset($v_custom_doc_root); |
| 776 | + } |
773 | 777 |
|
774 | 778 | // Restart web server |
775 | 779 | if (!empty($restart_web) && (empty($_SESSION['error_msg']))) { |
|
0 commit comments