From 018955bed8e0779d9c279eca693b9ea267331bf4 Mon Sep 17 00:00:00 2001 From: Falko Timme Date: Wed, 12 Feb 2014 16:34:01 +0100 Subject: [PATCH] - Implemented FS#3308 - PATH placeholder in directive snippets (placeholder is named {DOCROOT}, like for nginx). --- interface/web/sites/templates/web_domain_advanced.htm | 2 +- server/plugins-available/apache2_plugin.inc.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/web/sites/templates/web_domain_advanced.htm b/interface/web/sites/templates/web_domain_advanced.htm index 3a634e13d..c938c2d2a 100644 --- a/interface/web/sites/templates/web_domain_advanced.htm +++ b/interface/web/sites/templates/web_domain_advanced.htm @@ -88,7 +88,7 @@
-  {tmpl_var name="available_apache_directive_snippets_txt"}

 {tmpl_var name="apache_directive_snippets_txt"} +  {tmpl_var name="available_apache_directive_snippets_txt"}

 {tmpl_var name="apache_directive_snippets_txt"}
----
 {tmpl_var name='variables_txt'}: {DOCROOT}
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index 654c87a6d..aec93b9bf 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -892,6 +892,8 @@ class apache2_plugin { // Make sure we only have Unix linebreaks $vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']); $vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']); + $trans = array('{DOCROOT}' => $vhost_data['web_document_root_www']); + $vhost_data['apache_directives'] = strtr($vhost_data['apache_directives'], $trans); // Check if a SSL cert exists $ssl_dir = $data['new']['document_root'].'/ssl'; -- GitLab