From 9cbf2fafee3f4623b75d1a6b70458ab097e64924 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 8 Jun 2012 12:09:39 -0300 Subject: fix dynamic scope variables, function access --- templates/vhosts/default.erb | 10 +++++----- templates/vhosts/gitweb/partial.erb | 2 +- templates/vhosts/itk_plus.erb | 6 +++--- templates/vhosts/itk_plus/partial.erb | 2 +- templates/vhosts/partials/header_default.erb | 12 ++++++------ templates/vhosts/passenger/partial.erb | 2 +- templates/vhosts/perl/partial.erb | 6 +++--- templates/vhosts/php/partial.erb | 8 ++++---- templates/vhosts/php_drupal/partial.erb | 6 +++--- templates/vhosts/php_gallery2/partial.erb | 8 ++++---- templates/vhosts/php_joomla/partial.erb | 8 ++++---- templates/vhosts/php_mediawiki/partial.erb | 4 ++-- templates/vhosts/php_silverstripe/partial.erb | 8 ++++---- templates/vhosts/php_typo3/partial.erb | 4 ++-- templates/vhosts/proxy/partial.erb | 4 ++-- templates/vhosts/redirect/partial.erb | 2 +- templates/vhosts/static/partial.erb | 6 +++--- templates/vhosts/webdav/partial.erb | 2 +- 18 files changed, 50 insertions(+), 50 deletions(-) (limited to 'templates') diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb index 9342d06..62edf69 100644 --- a/templates/vhosts/default.erb +++ b/templates/vhosts/default.erb @@ -10,9 +10,9 @@ vhost_parts.each do |vhost_part| -%> > -<%= scope.function_template('apache/vhosts/partials/header_default.erb') %> +<%= scope.function_template(['apache/vhosts/partials/header_default.erb']) %> -<%= scope.function_template('apache/vhosts/partials/logs.erb') %> +<%= scope.function_template(['apache/vhosts/partials/logs.erb']) %> <% if run_mode.to_s =~ /(proxy\-|static\-)?itk/ -%> @@ -33,13 +33,13 @@ vhost_parts.each do |vhost_part| RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L] <% else -%> -<%= scope.function_template(template_partial) %> +<%= scope.function_template([template_partial]) %> <% end -%> <%- unless template_partial == 'apache/vhosts/itk_plus/partial.erb' -%> -<%= scope.function_template('apache/vhosts/partials/mod_security.erb') %> +<%= scope.function_template(['apache/vhosts/partials/mod_security.erb']) %> <% end -%> <% unless additional_options.to_s == 'absent' -%> <%= additional_options %> <% end -%> -<% end -%> \ No newline at end of file +<% end -%> diff --git a/templates/vhosts/gitweb/partial.erb b/templates/vhosts/gitweb/partial.erb index 8bfe6ce..7238ebe 100644 --- a/templates/vhosts/gitweb/partial.erb +++ b/templates/vhosts/gitweb/partial.erb @@ -14,6 +14,6 @@ RewriteEngine on RewriteRule ^[a-zA-Z0-9_-]+.git/?(\?.)?$ /gitweb.cgi%{REQUESTURI} [L,PT] -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> <% end -%> diff --git a/templates/vhosts/itk_plus.erb b/templates/vhosts/itk_plus.erb index 2890ecf..b7cb180 100644 --- a/templates/vhosts/itk_plus.erb +++ b/templates/vhosts/itk_plus.erb @@ -1,10 +1,10 @@ -<%= scope.function_template('apache/vhost/default.erb') %> +<%= scope.function_template(['apache/vhost/default.erb']) %> <% scope.unsetvar('template_partial') scope.setvar('template_partial','apache/vhosts/itk_plus/partial.erb') -%> -<%= scope.function_template('apache/vhost/default.erb') %> - \ No newline at end of file +<%= scope.function_template(['apache/vhost/default.erb']) %> + diff --git a/templates/vhosts/itk_plus/partial.erb b/templates/vhosts/itk_plus/partial.erb index e37e418..5b05dd8 100644 --- a/templates/vhosts/itk_plus/partial.erb +++ b/templates/vhosts/itk_plus/partial.erb @@ -25,7 +25,7 @@ Options <% unless options.to_s == 'absent' then -%><%= options %><% end -%><% if do_includes.to_s == 'true' and not options.include?('+Includes') then -%> +Includes<% end -%> <% end -%> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> <% end -%> diff --git a/templates/vhosts/partials/header_default.erb b/templates/vhosts/partials/header_default.erb index a9a87bc..d6d8c86 100644 --- a/templates/vhosts/partials/header_default.erb +++ b/templates/vhosts/partials/header_default.erb @@ -3,18 +3,18 @@ Include include.d/ssl_defaults.inc <% end -%> ServerName <%= servername %> -<% unless serveralias.to_s.empty? || (serveralias.to_s == 'absent') -%> +<% unless serveralias.empty? || (serveralias == 'absent') -%> ServerAlias <%= serveralias %> <% end -%> -<% unless server_admin.to_s.empty? || (server_admin.to_s == 'absent') -%> +<% unless server_admin.empty? || (server_admin == 'absent') -%> ServerAdmin <%= server_admin %> <% end -%> -<% unless documentroot.to_s == 'really_absent' -%> +<% unless documentroot == 'really_absent' -%> DocumentRoot <%= documentroot %>/ <% end -%> -<% if default_charset.to_s != 'absent' then -%> +<% if default_charset != 'absent' then -%> AddDefaultCharset <%= default_charset %> <% end -%> -<% if has_variable?('passing_extension') && !passing_extension.to_s.empty? -%> +<% if passing_extension != 'absent' -%> DirectoryIndex index.htm index.html index.<%= passing_extension %> -<% end -%> \ No newline at end of file +<% end -%> diff --git a/templates/vhosts/passenger/partial.erb b/templates/vhosts/passenger/partial.erb index abbec79..490649e 100644 --- a/templates/vhosts/passenger/partial.erb +++ b/templates/vhosts/passenger/partial.erb @@ -3,5 +3,5 @@ AllowOverride <%= allow_override %> Options <%- unless options.to_s == 'absent' -%><%= options %><%- end -%><%- unless !options.to_s.include?('MultiViews') -%>-MultiViews<%- end -%> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> diff --git a/templates/vhosts/perl/partial.erb b/templates/vhosts/perl/partial.erb index f75bf3f..a8c30c3 100644 --- a/templates/vhosts/perl/partial.erb +++ b/templates/vhosts/perl/partial.erb @@ -1,7 +1,7 @@ /"> -<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %> +<%= scope.function_template(['apache/vhosts/partials/std_override_options.erb']) %> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> <% unless htpasswd_file.to_s == 'absent' -%> @@ -12,4 +12,4 @@ require valid-user <% end -%> - ScriptAlias /cgi-bin/ <%= cgi_binpath %>/ \ No newline at end of file + ScriptAlias /cgi-bin/ <%= cgi_binpath %>/ diff --git a/templates/vhosts/php/partial.erb b/templates/vhosts/php/partial.erb index dae201a..f8e5c53 100644 --- a/templates/vhosts/php/partial.erb +++ b/templates/vhosts/php/partial.erb @@ -1,7 +1,7 @@ /"> -<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %> +<%= scope.function_template(['apache/vhosts/partials/std_override_options.erb']) %> -<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %> +<%= scope.function_template(['apache/vhosts/partials/php_settings.erb']) %> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> - \ No newline at end of file +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> + diff --git a/templates/vhosts/php_drupal/partial.erb b/templates/vhosts/php_drupal/partial.erb index 07e0d94..3c420b1 100644 --- a/templates/vhosts/php_drupal/partial.erb +++ b/templates/vhosts/php_drupal/partial.erb @@ -1,10 +1,10 @@ /"> -<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %> +<%= scope.function_template(['apache/vhosts/partials/std_override_options.erb']) %> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> -<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %> +<%= scope.function_template(['apache/vhosts/partials/php_settings.erb']) %> # Protect files and directories from prying eyes. diff --git a/templates/vhosts/php_gallery2/partial.erb b/templates/vhosts/php_gallery2/partial.erb index 05cc9f4..448f720 100644 --- a/templates/vhosts/php_gallery2/partial.erb +++ b/templates/vhosts/php_gallery2/partial.erb @@ -1,9 +1,9 @@ /"> -<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %> +<%= scope.function_template(['apache/vhosts/partials/std_override_options.erb']) %> -<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %> +<%= scope.function_template(['apache/vhosts/partials/php_settings.erb']) %> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> <% if vhost_part != :ssl -%> # Always rewrite login's @@ -13,4 +13,4 @@ RewriteCond %{QUERY_STRING} subView=core\.UserLogin RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R,L] <% end -%> - \ No newline at end of file + diff --git a/templates/vhosts/php_joomla/partial.erb b/templates/vhosts/php_joomla/partial.erb index fa095ff..526352a 100644 --- a/templates/vhosts/php_joomla/partial.erb +++ b/templates/vhosts/php_joomla/partial.erb @@ -1,9 +1,9 @@ /"> -<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %> +<%= scope.function_template(['apache/vhosts/partials/std_override_options.erb']) %> -<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %> +<%= scope.function_template(['apache/vhosts/partials/php_settings.erb']) %> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> Include include.d/joomla.inc @@ -16,4 +16,4 @@ RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} (.*/administrator/.*) RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R] - \ No newline at end of file + diff --git a/templates/vhosts/php_mediawiki/partial.erb b/templates/vhosts/php_mediawiki/partial.erb index 38f9663..cf30f5f 100644 --- a/templates/vhosts/php_mediawiki/partial.erb +++ b/templates/vhosts/php_mediawiki/partial.erb @@ -4,7 +4,7 @@ RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d RewriteRule ^/?index.php/(.*)$ /index.php?title=$1 [PT,L,QSA] <% end -%> -<%= scope.function_template('apache/vhosts/php/partial.erb') %> +<%= scope.function_template(['apache/vhosts/php/partial.erb']) %> /typo3/"> RewriteEngine on @@ -13,4 +13,4 @@ RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} (.*/typo3/.*) RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R] - \ No newline at end of file + diff --git a/templates/vhosts/php_silverstripe/partial.erb b/templates/vhosts/php_silverstripe/partial.erb index a398829..89a6052 100644 --- a/templates/vhosts/php_silverstripe/partial.erb +++ b/templates/vhosts/php_silverstripe/partial.erb @@ -6,11 +6,11 @@ <% end -%> /"> -<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %> +<%= scope.function_template(['apache/vhosts/partials/std_override_options.erb']) %> -<%= scope.function_template('apache/vhosts/partials/php_settings.erb') %> +<%= scope.function_template(['apache/vhosts/partials/php_settings.erb']) %> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> Include include.d/silverstripe.inc - \ No newline at end of file + diff --git a/templates/vhosts/php_typo3/partial.erb b/templates/vhosts/php_typo3/partial.erb index 776fff2..5c06570 100644 --- a/templates/vhosts/php_typo3/partial.erb +++ b/templates/vhosts/php_typo3/partial.erb @@ -1,4 +1,4 @@ -<%= scope.function_template('apache/vhosts/php/partial.erb') %> +<%= scope.function_template(['apache/vhosts/php/partial.erb']) %> /typo3/"> RewriteEngine on @@ -7,4 +7,4 @@ RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} (.*/typo3/.*) RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R] - \ No newline at end of file + diff --git a/templates/vhosts/proxy/partial.erb b/templates/vhosts/proxy/partial.erb index f0d4c9d..bbf3c64 100644 --- a/templates/vhosts/proxy/partial.erb +++ b/templates/vhosts/proxy/partial.erb @@ -1,8 +1,8 @@ Order deny,allow Allow from all -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> ProxyRequests Off ProxyPass / <%= options %>/ - ProxyPassReverse / <%= options %>/ \ No newline at end of file + ProxyPassReverse / <%= options %>/ diff --git a/templates/vhosts/redirect/partial.erb b/templates/vhosts/redirect/partial.erb index bd012c8..3b7af7a 100644 --- a/templates/vhosts/redirect/partial.erb +++ b/templates/vhosts/redirect/partial.erb @@ -1 +1 @@ - Redirect permanent / https://<%= options %> \ No newline at end of file + Redirect permanent / https://<%= options %> diff --git a/templates/vhosts/static/partial.erb b/templates/vhosts/static/partial.erb index 78dc925..f2cc46b 100644 --- a/templates/vhosts/static/partial.erb +++ b/templates/vhosts/static/partial.erb @@ -1,5 +1,5 @@ /"> -<%= scope.function_template('apache/vhosts/partials/std_override_options.erb') %> +<%= scope.function_template(['apache/vhosts/partials/std_override_options.erb']) %> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> - \ No newline at end of file +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> + diff --git a/templates/vhosts/webdav/partial.erb b/templates/vhosts/webdav/partial.erb index 2f78d7b..d89da50 100644 --- a/templates/vhosts/webdav/partial.erb +++ b/templates/vhosts/webdav/partial.erb @@ -9,7 +9,7 @@ Options Indexes <%- end -%> -<%= scope.function_template('apache/vhosts/partials/authentication.erb') %> +<%= scope.function_template(['apache/vhosts/partials/authentication.erb']) %> <%- if ldap_auth.to_s == 'true' then -%> Include include.d/ldap_auth.inc <%- unless ldap_user.to_s == 'any' -%> -- cgit v1.2.3