@@ -1463,6 +1463,7 @@ function delete($event_name,$data) {
14631463
14641464 //* Remove the mounts
14651465 $ log_folder = 'log ' ;
1466+ $ web_folder = '' ;
14661467 if ($ data ['old ' ]['type ' ] == 'vhostsubdomain ' ) {
14671468 $ tmp = $ app ->db ->queryOneRecord ('SELECT `domain`,`document_root` FROM web_domain WHERE domain_id = ' .intval ($ data ['old ' ]['parent_domain_id ' ]));
14681469 $ subdomain_host = preg_replace ('/^(.*)\. ' . preg_quote ($ tmp ['domain ' ], '/ ' ) . '$/ ' , '$1 ' , $ data ['old ' ]['domain ' ]);
@@ -1516,9 +1517,12 @@ function delete($event_name,$data) {
15161517 $ app ->system ->unlink ($ vhost_file );
15171518 $ app ->log ('Removing vhost file: ' .$ vhost_file ,LOGLEVEL_DEBUG );
15181519
1519- if ($ data ['old ' ]['type ' ] == 'vhost ' ) {
1520+ if ($ data ['old ' ]['type ' ] == 'vhost ' || $ data [ ' old ' ][ ' type ' ] == ' vhostsubdomain ' ) {
15201521 $ docroot = escapeshellcmd ($ data ['old ' ]['document_root ' ]);
1521- if ($ docroot != '' && !stristr ($ docroot ,'.. ' )) exec ('rm -rf ' .$ docroot );
1522+ if ($ docroot != '' && !stristr ($ docroot ,'.. ' )) {
1523+ if ($ data ['old ' ]['type ' ] == 'vhost ' ) exec ('rm -rf ' .$ docroot );
1524+ elseif (!stristr ($ data ['old ' ]['web_folder ' ], '.. ' )) exec ('rm -rf ' .$ docroot .'/ ' .$ web_folder ;
1525+ }
15221526
15231527 //remove the php fastgi starter script if available
15241528 if ($ data ['old ' ]['php ' ] == 'fast-cgi ' ) {
@@ -1579,8 +1583,6 @@ function delete($event_name,$data) {
15791583 }
15801584 }
15811585 // end removing symlinks
1582- } else {
1583- // vhost subdomain
15841586 }
15851587
15861588 // Delete the log file directory
0 commit comments