From 56f8ed4b8588d16f8e60d40ef0229edf73288857 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Wed, 25 Jul 2018 12:22:39 +0200
Subject: [PATCH] pass the validity duration to the template

---
 lib/AccountManager/App.pm                      | 1 +
 templates/renater/web/create_accounts.tt2.html | 2 +-
 templates/web/create_accounts.tt2.html         | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/AccountManager/App.pm b/lib/AccountManager/App.pm
index 3440f93..4d40f59 100644
--- a/lib/AccountManager/App.pm
+++ b/lib/AccountManager/App.pm
@@ -791,6 +791,7 @@ sub req_create_accounts {
             entityid => $self->{in}->{entityid},
             key      => $key,
             token    => $download_token->token(),
+            days     => $validity_period,
         }
     );
 }
diff --git a/templates/renater/web/create_accounts.tt2.html b/templates/renater/web/create_accounts.tt2.html
index 06a8e5b..78cda71 100644
--- a/templates/renater/web/create_accounts.tt2.html
+++ b/templates/renater/web/create_accounts.tt2.html
@@ -81,7 +81,7 @@
 
 <div class="row">
     <div class="callout warning">
-        <p>[% lh.maketext("Note that these test accounts will automatically expire in [_1] days and that they can only be used to test federated login to your eduGAIN-enabled Service Provider with entityID <strong>[_2]</strong>.", accounts_validity_period, entityid) %]</p>
+        <p>[% lh.maketext("Note that these test accounts will automatically expire in [_1] days and that they can only be used to test federated login to your eduGAIN-enabled Service Provider with entityID <strong>[_2]</strong>.", days, entityid) %]</p>
     </div>
 </div>
 
diff --git a/templates/web/create_accounts.tt2.html b/templates/web/create_accounts.tt2.html
index c99962c..d2e296d 100644
--- a/templates/web/create_accounts.tt2.html
+++ b/templates/web/create_accounts.tt2.html
@@ -81,7 +81,7 @@
 
 <div class="row">
     <div class="callout warning">
-        <p>[% lh.maketext("Note that these test accounts will automatically expire in [_1] days and that they can only be used to test federated login to your eduGAIN-enabled Service Provider with entityID <strong>[_2]</strong>.", accounts_validity_period, entityid) %]</p>
+        <p>[% lh.maketext("Note that these test accounts will automatically expire in [_1] days and that they can only be used to test federated login to your eduGAIN-enabled Service Provider with entityID <strong>[_2]</strong>.", days, entityid) %]</p>
     </div>
 </div>
 
-- 
GitLab