vogelor
2008-12-09 6a2e36ec27a4c06741e72fd1f9275d3b767f390c
It is now possible to have customized html-pages in /usr/local/ispconfig/server/conf-custom (with or without language-informations)
1 files modified
34 ■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 34 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php
@@ -300,14 +300,34 @@
        
        if($this->action == 'insert' && $data["new"]["type"] == 'vhost') {
            // Copy the error pages
      if($data["new"]["errordocs"]){
              $error_page_path = escapeshellcmd($data["new"]["document_root"])."/web/error/";
              exec("cp /usr/local/ispconfig/server/conf/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
              exec("chmod -R +r ".$error_page_path);
      }
            if($data["new"]["errordocs"]){
                $error_page_path = escapeshellcmd($data["new"]["document_root"])."/web/error/";
                if (file_exists("/usr/local/ispconfig/server/conf-custom/error/".substr(escapeshellcmd($conf["language"]),0,2))){
                    exec("cp /usr/local/ispconfig/server/conf-custom/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
                }
                else {
                    if (file_exists("/usr/local/ispconfig/server/conf-custom/error/fileNotFound.html")){
                        exec("cp /usr/local/ispconfig/server/conf-custom/error/*.html ".$error_page_path);
                    }
                    else {
                        exec("cp /usr/local/ispconfig/server/conf/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
                    }
                }
                exec("chmod -R +r ".$error_page_path);
            }
            // copy the standard index page
            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");
            if (file_exists("/usr/local/ispconfig/server/conf-custom/index/standard_index.html_".substr(escapeshellcmd($conf["language"]),0,2))){
                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");
            }
            else {
                if (file_exists("/usr/local/ispconfig/server/conf-custom/index/standard_index.html")){
                    exec("cp /usr/local/ispconfig/server/conf-custom/index/standard_index.html ".escapeshellcmd($data["new"]["document_root"])."/web/index.html");
                }
                else {
                    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");
                }
            }
            exec("chmod +r ".escapeshellcmd($data["new"]["document_root"])."/web/index.html");
        }