@@ -650,6 +650,7 @@ function update($event_name, $data) {
650650
651651 if (!is_dir ($ data ['new ' ]['document_root ' ].'/ ' . $ web_folder )) $ app ->system ->mkdirpath ($ data ['new ' ]['document_root ' ].'/ ' . $ web_folder );
652652 if (!is_dir ($ data ['new ' ]['document_root ' ].'/ ' . $ web_folder . '/error ' ) and $ data ['new ' ]['errordocs ' ]) $ app ->system ->mkdirpath ($ data ['new ' ]['document_root ' ].'/ ' . $ web_folder . '/error ' );
653+ if (!is_dir ($ data ['new ' ]['document_root ' ].'/ ' . $ web_folder . '/stats ' )) $ app ->system ->mkdirpath ($ data ['new ' ]['document_root ' ].'/ ' . $ web_folder . '/stats ' );
653654 //if(!is_dir($data['new']['document_root'].'/'.$log_folder)) exec('mkdir -p '.$data['new']['document_root'].'/'.$log_folder);
654655 if (!is_dir ($ data ['new ' ]['document_root ' ].'/ssl ' )) $ app ->system ->mkdirpath ($ data ['new ' ]['document_root ' ].'/ssl ' );
655656 if (!is_dir ($ data ['new ' ]['document_root ' ].'/cgi-bin ' )) $ app ->system ->mkdirpath ($ data ['new ' ]['document_root ' ].'/cgi-bin ' );
@@ -771,27 +772,31 @@ function update($event_name, $data) {
771772 }
772773
773774 if (file_exists ($ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html_ ' .substr (escapeshellcmd ($ conf ['language ' ]), 0 , 2 ))) {
774- 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 ' );
775+ 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 ' );
775776
776777 if (is_file ($ conf ['rootpath ' ] . '/conf-custom/index/favicon.ico ' )) {
777- exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/favicon.ico ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
778+ 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 . '/ ' );
778779 }
779780 if (is_file ($ conf ['rootpath ' ] . '/conf-custom/index/robots.txt ' )) {
780- exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/robots.txt ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
781+ 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 . '/ ' );
781782 }
782783 if (is_file ($ conf ['rootpath ' ] . '/conf-custom/index/.htaccess ' )) {
783- exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/.htaccess ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
784+ 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 . '/ ' );
784785 }
785- }
786- else {
786+ } else {
787787 if (file_exists ($ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html ' )) {
788- exec ('cp ' . $ conf ['rootpath ' ] . '/conf-custom/index/standard_index.html ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' );
789- }
790- else {
791- exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/standard_index.html_ ' .substr (escapeshellcmd ($ conf ['language ' ]), 0 , 2 ).' ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/index.html ' );
792- if (is_file ($ conf ['rootpath ' ] . '/conf/index/favicon.ico ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/favicon.ico ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
793- if (is_file ($ conf ['rootpath ' ] . '/conf/index/robots.txt ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/robots.txt ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
794- if (is_file ($ conf ['rootpath ' ] . '/conf/index/.htaccess ' )) exec ('cp ' . $ conf ['rootpath ' ] . '/conf/index/.htaccess ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
788+ 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 ' );
789+ } else {
790+ 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 ' );
791+ if (is_file ($ conf ['rootpath ' ] . '/conf/index/favicon.ico ' )){
792+ 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 . '/ ' );
793+ }
794+ if (is_file ($ conf ['rootpath ' ] . '/conf/index/robots.txt ' )){
795+ 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 . '/ ' );
796+ }
797+ if (is_file ($ conf ['rootpath ' ] . '/conf/index/.htaccess ' )){
798+ 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 . '/ ' );
799+ }
795800 }
796801 }
797802 exec ('chmod -R a+r ' .escapeshellcmd ($ data ['new ' ]['document_root ' ]).'/ ' . $ web_folder . '/ ' );
0 commit comments