@@ -300,14 +300,34 @@ function update($event_name,$data) {
300300
301301 if ($ this ->action == 'insert ' && $ data ["new " ]["type " ] == 'vhost ' ) {
302302 // Copy the error pages
303- if ($ data ["new " ]["errordocs " ]){
304- $ error_page_path = escapeshellcmd ($ data ["new " ]["document_root " ])."/web/error/ " ;
305- exec ("cp /usr/local/ispconfig/server/conf/error/ " .substr (escapeshellcmd ($ conf ["language " ]),0 ,2 )."/* " .$ error_page_path );
306- exec ("chmod -R +r " .$ error_page_path );
307- }
308-
303+ if ($ data ["new " ]["errordocs " ]){
304+ $ error_page_path = escapeshellcmd ($ data ["new " ]["document_root " ])."/web/error/ " ;
305+ if (file_exists ("/usr/local/ispconfig/server/conf-custom/error/ " .substr (escapeshellcmd ($ conf ["language " ]),0 ,2 ))){
306+ exec ("cp /usr/local/ispconfig/server/conf-custom/error/ " .substr (escapeshellcmd ($ conf ["language " ]),0 ,2 )."/* " .$ error_page_path );
307+ }
308+ else {
309+ if (file_exists ("/usr/local/ispconfig/server/conf-custom/error/fileNotFound.html " )){
310+ exec ("cp /usr/local/ispconfig/server/conf-custom/error/*.html " .$ error_page_path );
311+ }
312+ else {
313+ exec ("cp /usr/local/ispconfig/server/conf/error/ " .substr (escapeshellcmd ($ conf ["language " ]),0 ,2 )."/* " .$ error_page_path );
314+ }
315+ }
316+ exec ("chmod -R +r " .$ error_page_path );
317+ }
318+
309319 // copy the standard index page
310- exec ("cp /usr/local/ispconfig/server/conf/index/standard_index.html_ " .substr (escapeshellcmd ($ conf ["language " ]),0 ,2 )." " .escapeshellcmd ($ data ["new " ]["document_root " ])."/web/index.html " );
320+ if (file_exists ("/usr/local/ispconfig/server/conf-custom/index/standard_index.html_ " .substr (escapeshellcmd ($ conf ["language " ]),0 ,2 ))){
321+ exec ("cp /usr/local/ispconfig/server/conf-custom/index/standard_index.html_ " .substr (escapeshellcmd ($ conf ["language " ]),0 ,2 )." " .escapeshellcmd ($ data ["new " ]["document_root " ])."/web/index.html " );
322+ }
323+ else {
324+ if (file_exists ("/usr/local/ispconfig/server/conf-custom/index/standard_index.html " )){
325+ exec ("cp /usr/local/ispconfig/server/conf-custom/index/standard_index.html " .escapeshellcmd ($ data ["new " ]["document_root " ])."/web/index.html " );
326+ }
327+ else {
328+ exec ("cp /usr/local/ispconfig/server/conf/index/standard_index.html_ " .substr (escapeshellcmd ($ conf ["language " ]),0 ,2 )." " .escapeshellcmd ($ data ["new " ]["document_root " ])."/web/index.html " );
329+ }
330+ }
311331 exec ("chmod +r " .escapeshellcmd ($ data ["new " ]["document_root " ])."/web/index.html " );
312332 }
313333
0 commit comments