@@ -824,31 +824,32 @@ function update($event_name, $data) {
824824 exec ('chmod -R a+r ' .$ error_page_path );
825825 }
826826
827- if (file_exists ($ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html_ ' .substr (escapeshellcmd ($ conf ['language ' ]), 0 , 2 ))) {
828- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html_ ' .substr (escapeshellcmd ($ conf ['language ' ]), 0 , 2 ).' ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' );
827+ //* Copy the web skeleton files only when there is no index.ph or index.html file yet
828+ if (!file_exists ($ data ['new ' ]['document_root ' ].'/ ' .$ web_folder .'/index.html ' ) && !file_exists ($ data ['new ' ]['document_root ' ].'/ ' .$ web_folder .'/index.php ' )) {
829+ if (file_exists ($ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html_ ' .substr (escapeshellcmd ($ conf ['language ' ]), 0 , 2 ))) {
830+ if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html_ ' .substr (escapeshellcmd ($ conf ['language ' ]), 0 , 2 ).' ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' );
829831
830- if (is_file ($ conf ['rootpath ' ] . '/conf-custom/index/favicon.ico ' )) {
831- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/favicon.ico ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/favicon.ico ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
832- }
833- if (is_file ($ conf ['rootpath ' ] . '/conf-custom/index/robots.txt ' )) {
834- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/robots.txt ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/robots.txt ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
835- }
836- if (is_file ($ conf ['rootpath ' ] . '/conf-custom/index/.htaccess ' )) {
837- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/.htaccess ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/.htaccess ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
838- }
839- } else {
840- if (file_exists ($ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html ' )) {
841- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' );
842- } else {
843- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/standard_index.html_ ' .substr (escapeshellcmd ($ conf ['language ' ]), 0 , 2 ).' ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' );
844- if (is_file ($ conf ['rootpath ' ] . '/conf/index/favicon.ico ' )){
845- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/favicon.ico ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/favicon.ico ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
832+ if (is_file ($ conf ['rootpath ' ] . '/conf-custom/index/favicon.ico ' )) {
833+ if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/favicon.ico ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/favicon.ico ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
846834 }
847- if (is_file ($ conf ['rootpath ' ] . '/conf/index/robots.txt ' )){
848- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/robots.txt ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/robots.txt ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
835+ if (is_file ($ conf ['rootpath ' ] . '/conf-custom /index/robots.txt ' )) {
836+ if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/robots.txt ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom /index/robots.txt ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
849837 }
850- if (is_file ($ conf ['rootpath ' ] . '/conf/index/.htaccess ' )){
851- if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/.htaccess ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/.htaccess ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
838+ //if(is_file($conf['rootpath'] . '/conf-custom/index/.htaccess')) {
839+ // exec('cp ' . $conf['rootpath'] . '/conf-custom/index/.htaccess '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/');
840+ //}
841+ } else {
842+ if (file_exists ($ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html ' )) {
843+ if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' );
844+ } else {
845+ if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/standard_index.html_ ' .substr (escapeshellcmd ($ conf ['language ' ]), 0 , 2 ).' ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' );
846+ if (is_file ($ conf ['rootpath ' ] . '/conf/index/favicon.ico ' )){
847+ if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/favicon.ico ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/favicon.ico ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
848+ }
849+ if (is_file ($ conf ['rootpath ' ] . '/conf/index/robots.txt ' )){
850+ if (!file_exists (escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/robots.txt ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/robots.txt ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
851+ }
852+ //if(is_file($conf['rootpath'] . '/conf/index/.htaccess')) exec('cp ' . $conf['rootpath'] . '/conf/index/.htaccess '.escapeshellcmd($data['new']['document_root']).'/' . $web_folder . '/');
852853 }
853854 }
854855 }
0 commit comments