Skip to content

Commit 6a2e36e

Browse files
author
vogelor
committed
It is now possible to have customized html-pages in /usr/local/ispconfig/server/conf-custom (with or without language-informations)
1 parent 1e74ea5 commit 6a2e36e

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)