From 41a00f013af1c379047338b4394cad005b5ffef5 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Mon, 6 Nov 2017 14:13:46 +0100
Subject: [PATCH] fix templates file path root

---
 lib/IdPAccountManager/Tools.pm        |  2 +-
 lib/IdPAccountManager/WebRequest.pm   |  8 ++++----
 templates/web/content.tt2.html        | 12 ++++++------
 templates/web/index-nobanner.tt2.html |  4 ++--
 templates/web/index.tt2.html          | 10 +++++-----
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/lib/IdPAccountManager/Tools.pm b/lib/IdPAccountManager/Tools.pm
index 03bcbde..b069192 100644
--- a/lib/IdPAccountManager/Tools.pm
+++ b/lib/IdPAccountManager/Tools.pm
@@ -89,7 +89,7 @@ sub update_ssp_authsources {
 
     #chdir $Conf::global{root_manager_dir};
 
-    my $template_file = 'templates/accountProfiles/valid-accounts.php.tt2';
+    my $template_file = 'accountProfiles/valid-accounts.php.tt2';
     my $output_file   = 'conf/valid-accounts.php';
 
     #printf "Trace : in=%s, out=%s\n", $template_file, $output_file;
diff --git a/lib/IdPAccountManager/WebRequest.pm b/lib/IdPAccountManager/WebRequest.pm
index c6f3041..02e2453 100755
--- a/lib/IdPAccountManager/WebRequest.pm
+++ b/lib/IdPAccountManager/WebRequest.pm
@@ -176,9 +176,9 @@ sub respond {
 
     ## nobanner is used to do AJAX to get only pieces of HTML to load in the web client
     if ($self->{in}->{style} eq 'nobanner') {
-        $template = 'templates/web/index-nobanner.tt2.html';
+        $template = 'web/index-nobanner.tt2.html';
     } else {
-        $template = 'templates/web/index.tt2.html';
+        $template = 'web/index.tt2.html';
     }
 
     unless ($tt2->process($template, $self->{out}, \*STDOUT)) {
@@ -201,7 +201,7 @@ sub respond {
     if (@errors_admin) {
         $self->{out}->{subject} = 'Error notification - web interface';
         IdPAccountManager::Tools::mail_notice(
-            template            => 'templates/mail/notification_generic_error.tt2.eml',
+            template            => 'mail/notification_generic_error.tt2.eml',
             data                => $self->{out},
             logger              => $self->{logger},
             conf                => $self->{configuration},
@@ -472,7 +472,7 @@ sub req_generate_token {
 
     ## Send the challenge email with the token
     IdPAccountManager::Tools::mail_notice(
-        template => 'templates/mail/send_authentication_token.tt2.eml',
+        template => 'mail/send_authentication_token.tt2.eml',
         to       => $self->{in}->{email_address},
         data     => $self->{out},
         logger   => $self->{logger}
diff --git a/templates/web/content.tt2.html b/templates/web/content.tt2.html
index 1ba1331..db63e03 100644
--- a/templates/web/content.tt2.html
+++ b/templates/web/content.tt2.html
@@ -2,42 +2,42 @@
 
 [% IF action == 'select_sp' %]
  [% TRY %]
-  [% PROCESS 'templates/web/select_sp.tt2.html' %]
+  [% PROCESS 'web/select_sp.tt2.html' %]
  [% CATCH %]
   An error occured
  [% END %]
 
 [% ELSIF action == 'account_wizard' %]
  [% TRY %]
-  [% PROCESS 'templates/web/account_wizard.tt2.html' %]
+  [% PROCESS 'web/account_wizard.tt2.html' %]
  [% CATCH %]
   An error occured
  [% END %]
  
  [% ELSIF action == 'select_sp' %]
  [% TRY %]
-  [% PROCESS 'templates/web/select_sp.tt2.html' %]
+  [% PROCESS 'web/select_sp.tt2.html' %]
  [% CATCH %]
   An error occured
  [% END %]
  
 [% ELSIF action == 'generate_token' %]
  [% TRY %]
-  [% PROCESS 'templates/web/generate_token.tt2.html' %]
+  [% PROCESS 'web/generate_token.tt2.html' %]
  [% CATCH %]
   An error occured
  [% END %]
 
 [% ELSIF action == 'validate_token' %]
  [% TRY %]
-  [% PROCESS 'templates/web/validate_token.tt2.html' %]
+  [% PROCESS 'web/validate_token.tt2.html' %]
  [% CATCH %]
   An error occured
  [% END %]
  
  [% ELSIF action == 'home' %]
  [% TRY %]
-  [% PROCESS 'templates/web/home.tt2.html' %]
+  [% PROCESS 'web/home.tt2.html' %]
  [% CATCH %]
   An error occured
  [% END %]
diff --git a/templates/web/index-nobanner.tt2.html b/templates/web/index-nobanner.tt2.html
index 76fc3ee..5d42fb6 100644
--- a/templates/web/index-nobanner.tt2.html
+++ b/templates/web/index-nobanner.tt2.html
@@ -6,8 +6,8 @@ html1/DTD/xhtml1-transitional.dtd">
 
 [% IF errors %]
 <div class="ui-widget">
-[% PROCESS 'templates/web/errors.tt2.html' %]
+[% PROCESS 'web/errors.tt2.html' %]
 </div>
 [% ELSE %]
-[% PROCESS 'templates/web/content.tt2.html' %]
+[% PROCESS 'web/content.tt2.html' %]
 [% END %]
diff --git a/templates/web/index.tt2.html b/templates/web/index.tt2.html
index 0ca7208..a6752ff 100644
--- a/templates/web/index.tt2.html
+++ b/templates/web/index.tt2.html
@@ -185,7 +185,7 @@ jQuery(function($){
 </SCRIPT>
 
 
-<title> [% PROCESS 'templates/web/title.tt2.html' %] </title>
+<title> [% PROCESS 'web/title.tt2.html' %] </title>
 
 </head>
 
@@ -197,7 +197,7 @@ jQuery(function($){
 		<li class="logo align-right"><a href="http://www.geant.net" title="Geant home page" target="_blank"><img alt="GEANT logo" width="100" src="/resources/images/geant_logo_rgb_300dpi.jpg"/></a></li>
 	</ul>
 	<div class="title">
-		<span class=""><h1>[% PROCESS 'templates/web/title.tt2.html' %]</h1></span>
+		<span class=""><h1>[% PROCESS 'web/title.tt2.html' %]</h1></span>
 	</div>
 </header>
 
@@ -214,18 +214,18 @@ jQuery(function($){
 
 [% IF errors %]
 <div class="ui-widget">
-[% PROCESS 'templates/web/errors.tt2.html' %]
+[% PROCESS 'web/errors.tt2.html' %]
 </div>
 [% ELSE %]
 
 
 [% IF notifications %]
 <div class="ui-widget">
-[% PROCESS 'templates/web/notices.tt2.html' %]
+[% PROCESS 'web/notices.tt2.html' %]
 </b></div>
 [% END %] <!-- notifications -->
 
-[% PROCESS 'templates/web/content.tt2.html' %]
+[% PROCESS 'web/content.tt2.html' %]
 
 [% END %] <!-- IF errors -->
 
-- 
GitLab