diff --git a/lib/AccountManager/WebRequest.pm b/lib/AccountManager/WebRequest.pm index ee8cbae05b349c5b82f7e419617de72ea4244010..4f65d11b922260d908177f11f3d07042faa9afdf 100644 --- a/lib/AccountManager/WebRequest.pm +++ b/lib/AccountManager/WebRequest.pm @@ -9,6 +9,7 @@ use English qw(-no_match_vars); use Template; use Log::Any::Adapter; use List::MoreUtils qw(uniq); +use HTTP::AcceptLanguage; use AccountManager::Account; use AccountManager::Account::Manager; @@ -134,18 +135,20 @@ sub respond { version => $self->{configuration}->{app}->{version}, }; + my $lang = HTTP::AcceptLanguage->new($ENV{HTTP_ACCEPT_LANGUAGE})->match(qw/en fr/) || 'en'; + ## Parse template my $tt2 = Template->new({ - INCLUDE_PATH => $self->{configuration}->{_}->{templates_dir} + INCLUDE_PATH => $self->{configuration}->{_}->{templates_dir} . "/web/$lang" }); my $template; ## nobanner is used to do AJAX to get only pieces of HTML to load in the web client if ($self->{in}->{style} && $self->{in}->{style} eq 'nobanner') { - $template = 'web/index-nobanner.tt2.html'; + $template = 'index-nobanner.tt2.html'; } else { - $template = 'web/index.tt2.html'; + $template = 'index.tt2.html'; } binmode(STDOUT, ":utf8"); diff --git a/templates/Makefile.am b/templates/Makefile.am index f96b4c4ba983bc6468f4011d4384ba1f15a23b63..7a2d9502f005021459d0a76e7be7e222ab45575f 100644 --- a/templates/Makefile.am +++ b/templates/Makefile.am @@ -1,15 +1,25 @@ nobase_templates_DATA = \ accountProfiles/valid-accounts.php.tt2 \ mail/send_authentication_token.tt2.eml \ - web/content.tt2.html \ - web/errors.tt2.html \ - web/home.tt2.html \ - web/index.tt2.html \ - web/index-nobanner.tt2.html \ - web/notices.tt2.html \ - web/select_sp.tt2.html \ - web/select_email.tt2.html \ - web/complete_challenge.tt2.html \ - web/create_accounts.tt2.html + web/en/content.tt2.html \ + web/en/errors.tt2.html \ + web/en/home.tt2.html \ + web/en/index.tt2.html \ + web/en/index-nobanner.tt2.html \ + web/en/notices.tt2.html \ + web/en/select_sp.tt2.html \ + web/en/select_email.tt2.html \ + web/en/complete_challenge.tt2.html \ + web/en/create_accounts.tt2.html \ + web/fr/content.tt2.html \ + web/fr/errors.tt2.html \ + web/fr/home.tt2.html \ + web/fr/index.tt2.html \ + web/fr/index-nobanner.tt2.html \ + web/fr/notices.tt2.html \ + web/fr/select_sp.tt2.html \ + web/fr/select_email.tt2.html \ + web/fr/complete_challenge.tt2.html \ + web/fr/create_accounts.tt2.html EXTRA_DIST = $(nobase_templates_DATA) diff --git a/templates/web/complete_challenge.tt2.html b/templates/web/en/complete_challenge.tt2.html similarity index 100% rename from templates/web/complete_challenge.tt2.html rename to templates/web/en/complete_challenge.tt2.html diff --git a/templates/web/content.tt2.html b/templates/web/en/content.tt2.html similarity index 69% rename from templates/web/content.tt2.html rename to templates/web/en/content.tt2.html index dcbe502c2b96b2c3302a50a5d8ae9b6f2d0013fa..6327b7bd55eeb40078d5dada9a1b98b8d43cdaec 100644 --- a/templates/web/content.tt2.html +++ b/templates/web/en/content.tt2.html @@ -2,35 +2,35 @@ [% IF action == 'select_sp' %] [% TRY %] - [% PROCESS 'web/select_sp.tt2.html' %] + [% PROCESS 'select_sp.tt2.html' %] [% CATCH %] An error occured [% END %] - + [% ELSIF action == 'select_email' %] [% TRY %] - [% PROCESS 'web/select_email.tt2.html' %] + [% PROCESS 'select_email.tt2.html' %] [% CATCH %] An error occured [% END %] - + [% ELSIF action == 'complete_challenge' %] [% TRY %] - [% PROCESS 'web/complete_challenge.tt2.html' %] + [% PROCESS 'complete_challenge.tt2.html' %] [% CATCH %] An error occured [% END %] [% ELSIF action == 'create_accounts' %] [% TRY %] - [% PROCESS 'web/create_accounts.tt2.html' %] + [% PROCESS 'create_accounts.tt2.html' %] [% CATCH %] An error occured [% END %] - + [% ELSIF action == 'home' %] [% TRY %] - [% PROCESS 'web/home.tt2.html' %] + [% PROCESS 'home.tt2.html' %] [% CATCH %] An error occured [% END %] diff --git a/templates/web/create_accounts.tt2.html b/templates/web/en/create_accounts.tt2.html similarity index 92% rename from templates/web/create_accounts.tt2.html rename to templates/web/en/create_accounts.tt2.html index 27602a36e6ac19627eaab0130fad5068fe9555ee..ea960d0a340104e4a89de4bdedf198b47e158994 100644 --- a/templates/web/create_accounts.tt2.html +++ b/templates/web/en/create_accounts.tt2.html @@ -55,8 +55,6 @@ [% END %] </div> -<p><strong>Please keep a record of the above user names and passwords</strong> because currently there is no mecanism to retrieve the above credentials once you close this page. If you forget the username and passwords, you can however request new test accounts.</p> - <div class="alert-box warning radius"> <p>Note that these test accounts will automatically expire in [% accounts_validity_period %] days and that they can only be used to test federated login to your eduGAIN-enabled Service Provider with entityID <strong>[% entityid %]</strong>.</p> </div> diff --git a/templates/web/errors.tt2.html b/templates/web/en/errors.tt2.html similarity index 98% rename from templates/web/errors.tt2.html rename to templates/web/en/errors.tt2.html index e138aebb75f4197e1ab7296d61c9547ada5223e8..25b6a0c4f046775e56d3d7e8eaa347faf652ed64 100644 --- a/templates/web/errors.tt2.html +++ b/templates/web/en/errors.tt2.html @@ -2,7 +2,7 @@ [% FOREACH err IN errors %] <p class="ui-state-error ui-corner-all" style="margin-top: 20px; padding: 0 .7em;"><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span> - Error: + Error: [% IF err == 'unknown_action' %] unknown action @@ -18,7 +18,7 @@ [% ELSIF err == 'accounts_creation_failed' %] failed to create your test accounts - + [% ELSIF (matches = err.match('missing_(\w+)')) %] missing parameter '[% matches.0 %]' @@ -29,6 +29,6 @@ </p> <br/> [% END %] <!-- FOREACH --> - + You can report the issue to the administrators (<a href="mailto:[% app.support_email %]>">[% app.support_email %]</a>). [% END %] diff --git a/templates/web/home.tt2.html b/templates/web/en/home.tt2.html similarity index 99% rename from templates/web/home.tt2.html rename to templates/web/en/home.tt2.html index d3daccce5c140b625cc17a1d33acb19005ebe3c3..4049e9347bbfb7f523828a91a6fb0668507f52f1 100644 --- a/templates/web/home.tt2.html +++ b/templates/web/en/home.tt2.html @@ -1,7 +1,6 @@ <script type="text/javascript"> $(function() { - $('#start_testing').on('click',function() { window.location.href='[% app.url %]?action=select_sp'; }); diff --git a/templates/web/index-nobanner.tt2.html b/templates/web/en/index-nobanner.tt2.html similarity index 53% rename from templates/web/index-nobanner.tt2.html rename to templates/web/en/index-nobanner.tt2.html index 5f3f8eabfbafc16b41d4edd666d9e67a1d874ac1..f13a0d1f4ebff4f201ea317b518a32901db50c4c 100644 --- a/templates/web/index-nobanner.tt2.html +++ b/templates/web/en/index-nobanner.tt2.html @@ -2,8 +2,8 @@ [% IF errors %] <div class="ui-widget"> -[% PROCESS 'web/errors.tt2.html' %] +[% PROCESS 'errors.tt2.html' %] </div> [% ELSE %] -[% PROCESS 'web/content.tt2.html' %] +[% PROCESS 'content.tt2.html' %] [% END %] diff --git a/templates/web/index.tt2.html b/templates/web/en/index.tt2.html similarity index 93% rename from templates/web/index.tt2.html rename to templates/web/en/index.tt2.html index b4e801cf6d201be654fbf337d0bb0432bfb5b631..19f2ee658c7c92b48039e8b5a99ef9e5b598a9f1 100644 --- a/templates/web/index.tt2.html +++ b/templates/web/en/index.tt2.html @@ -39,17 +39,17 @@ [% IF errors %] <div class="ui-widget"> - [% PROCESS 'web/errors.tt2.html' %] + [% PROCESS 'errors.tt2.html' %] </div> [% ELSE %] [% IF notifications %] <div class="ui-widget"> - [% PROCESS 'web/notices.tt2.html' %] + [% PROCESS 'notices.tt2.html' %] </b> </div> [% END %] - [% PROCESS 'web/content.tt2.html' %] + [% PROCESS 'content.tt2.html' %] [% END %] </div> @@ -62,6 +62,6 @@ <script src="foundation/js/foundation/foundation.tooltip.js"></script> <script> $(document).foundation(); - </script> + </script> </body> </html> diff --git a/templates/web/notices.tt2.html b/templates/web/en/notices.tt2.html similarity index 90% rename from templates/web/notices.tt2.html rename to templates/web/en/notices.tt2.html index c936d34867d9d1a8d980bdbd7ced6f6d5a03c3a1..c284d62be6eb6119b7e83dfe1f6036117fb9c05b 100644 --- a/templates/web/notices.tt2.html +++ b/templates/web/en/notices.tt2.html @@ -1,6 +1,6 @@ [% FOREACH notif IN notifications %] <p class="ui-state-highlight ui-corner-all" style="border: 2px solid #10427a; background: #DFF1EE;padding: 0.7em;"><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> - Notice: + Notice: [% IF notif == 'done' %] @@ -12,4 +12,4 @@ [% END %] - [% END %] <!-- FOREACH --> \ No newline at end of file + [% END %] <!-- FOREACH --> diff --git a/templates/web/select_email.tt2.html b/templates/web/en/select_email.tt2.html similarity index 100% rename from templates/web/select_email.tt2.html rename to templates/web/en/select_email.tt2.html diff --git a/templates/web/select_sp.tt2.html b/templates/web/en/select_sp.tt2.html similarity index 99% rename from templates/web/select_sp.tt2.html rename to templates/web/en/select_sp.tt2.html index feba550fd7562666896eb3b55c0944718d0ea288..6f5488aa1890140781ff1e128dda02e9c114ed93 100644 --- a/templates/web/select_sp.tt2.html +++ b/templates/web/en/select_sp.tt2.html @@ -3,7 +3,7 @@ jQuery(document).ready(function($){ var form = $("#create-account-form").show(); - + form.steps({ headerTag: "h3", bodyTag: "fieldset", @@ -61,7 +61,7 @@ jQuery(document).ready(function($){ } form.validate().settings.ignore = ":disabled,:hidden"; return form.valid(); - + }, onStepChanged: function (event, currentIndex, priorIndex) { @@ -76,7 +76,7 @@ jQuery(document).ready(function($){ alert("Submitted!"); } }); - + form.validate({ errorPlacement: function errorPlacement(error, element) { element.before(error); }, }); diff --git a/templates/web/fr/complete_challenge.tt2.html b/templates/web/fr/complete_challenge.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..39ffa612d766b77435e32adb773bd4ad545ec8ad --- /dev/null +++ b/templates/web/fr/complete_challenge.tt2.html @@ -0,0 +1,13 @@ +<h3>Complete email challenge</h3> + +<div> +An email challenge including a validation token has been emailed to you at [% email %]. Please copy and paste the validation token in the form below to proof that you are administrator of this service.</div> + +<fieldset> + <legend>Validation Token</legend> + <label for="token">Please provide the validation token here:</label> + <input name="token" value="" id="token" type="text" class="required error"/> + <input type="hidden" name="entityid" value="[% entityid %]" id="entityid"/> + <input type="hidden" name="email" value="[% email %]" id="email"/> +</fieldset> + diff --git a/templates/web/fr/content.tt2.html b/templates/web/fr/content.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..6327b7bd55eeb40078d5dada9a1b98b8d43cdaec --- /dev/null +++ b/templates/web/fr/content.tt2.html @@ -0,0 +1,41 @@ + + +[% IF action == 'select_sp' %] + [% TRY %] + [% PROCESS 'select_sp.tt2.html' %] + [% CATCH %] + An error occured + [% END %] + + [% ELSIF action == 'select_email' %] + [% TRY %] + [% PROCESS 'select_email.tt2.html' %] + [% CATCH %] + An error occured + [% END %] + +[% ELSIF action == 'complete_challenge' %] + [% TRY %] + [% PROCESS 'complete_challenge.tt2.html' %] + [% CATCH %] + An error occured + [% END %] + +[% ELSIF action == 'create_accounts' %] + [% TRY %] + [% PROCESS 'create_accounts.tt2.html' %] + [% CATCH %] + An error occured + [% END %] + + [% ELSIF action == 'home' %] + [% TRY %] + [% PROCESS 'home.tt2.html' %] + [% CATCH %] + An error occured + [% END %] + +[% ELSE %] +Error: unknown action + +[% END %] diff --git a/templates/web/fr/create_accounts.tt2.html b/templates/web/fr/create_accounts.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..ea960d0a340104e4a89de4bdedf198b47e158994 --- /dev/null +++ b/templates/web/fr/create_accounts.tt2.html @@ -0,0 +1,62 @@ +<div class="row"> + + + <div class="alert-box success radius"> + <strong>Success:</strong> Your identity as administrator of the Service Provider with entityID <strong>[% entityid %]</strong> could successfully be validated! + </div> + + <h3>The following test accounts with different profiles were created for you:</h3> + + <p>You can now use these test accounts to login at your federated service.<br/> + <strong>To do so, select the "[% idp_displayname %]" when choosing an organisation to login at.</strong></p> +</div> + +<div class="accounts_profile"> + [% FOREACH account IN accounts %] + <div class="tbl"> + <table> + <caption>Account profile: [% account.profile() %]</caption> + <tr> + <th>user name:</th><td> user[% account.id() %]</td> + </tr> + <tr> + <th>user password:</th><td>[% account.password() %]</td> + </tr> + <tr> + <td colspan="2"><strong>comment:</strong><div><p>[% account.comment() %]</p></div></td> + </tr> + <tr> + <td colspan=2 class="align-center" ><button data-reveal-id="account_details_[% account.id() %]" class="show_account_details" id="show_account_details_[% account.id() %]">show account details</button></td> + </tr> + </table> + </div> + <div class="accounts_profile reveal-modal" data-reveal id="account_details_[% account.id() %]"> <!-- old version : class="account_details"--> + <h3>List of user attributes associated</h3> + <p>Below is the list of user attributes associated to this test account. After a successfull authentication process these attributes are transmited + via the SAML protocol from [% app.name %] Identity Provider to your Service Provider.</p> + <div> + <table> + <caption>List of user attributes</caption> + [% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName', 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] -%] + <tr> + <th>[% attribute %]</th><td> [% account.$attribute %]</td> + </tr> + [% END %] + <tr> + <th>eduPersonTargetedID:</th><td><i>value dynamically generated by the SP</i></td> + </tr> + </table> + </div> + + <div class="alert-box info radius">If you need a customized test account with additional user attributes, you should contact <a href="mailto:[% app.support_email %]">[% app.support_email %]</a>.</div> + <div>(1) eduPersonAffiliation and eduPersonScoppedAffilisation attributes are assigned quite differently from federation to federation. <a href="http://tnc2010.terena.org/files/ePSA%20comparison%20v0%2006.ppt">This usage comparison of eduPersonAffiliation accross different countries</a> discusses these differences. Therefore its values should be handled with great care.</div> + <a class="close-reveal-modal">×</a> + </div> + [% END %] +</div> + +<div class="alert-box warning radius"> + <p>Note that these test accounts will automatically expire in [% accounts_validity_period %] days and that they can only be used to test federated login to your eduGAIN-enabled Service Provider with entityID <strong>[% entityid %]</strong>.</p> +</div> + +<p class="align-center"><Strong>Thank you for using the [% app.name %]</strong></p> diff --git a/templates/web/fr/errors.tt2.html b/templates/web/fr/errors.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..25b6a0c4f046775e56d3d7e8eaa347faf652ed64 --- /dev/null +++ b/templates/web/fr/errors.tt2.html @@ -0,0 +1,34 @@ +[% IF errors %] + [% FOREACH err IN errors %] + +<p class="ui-state-error ui-corner-all" style="margin-top: 20px; padding: 0 .7em;"><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span> + Error: + + [% IF err == 'unknown_action' %] + unknown action + + [% ELSIF err == 'internal' %] + internal error; administrators of the federation registry have been notified. + + [% ELSIF err == 'wrong_token' %] + the validation token you provided is incorrect or it has already been used + + [% ELSIF err == 'wrong_token_for_sp' %] + the validation token you provided cannot be used to obtain test accounts for this service provider ([% entityid %]) + + [% ELSIF err == 'accounts_creation_failed' %] + failed to create your test accounts + + [% ELSIF (matches = err.match('missing_(\w+)')) %] + missing parameter '[% matches.0 %]' + + [% ELSE %] + [% err %] + + [% END %] <!-- autorisation --> +</p> +<br/> + [% END %] <!-- FOREACH --> + + You can report the issue to the administrators (<a href="mailto:[% app.support_email %]>">[% app.support_email %]</a>). +[% END %] diff --git a/templates/web/fr/home.tt2.html b/templates/web/fr/home.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..4049e9347bbfb7f523828a91a6fb0668507f52f1 --- /dev/null +++ b/templates/web/fr/home.tt2.html @@ -0,0 +1,31 @@ +<script type="text/javascript"> + +$(function() { + $('#start_testing').on('click',function() { + window.location.href='[% app.url %]?action=select_sp'; + }); +}); + +</script> + + +<div class="row"> +<h2>[% app.name %]?</h2> +<p>[% app.name %] allows administrators of a Service +Provider (SP) registered in <a href="http://www.geant.net/service/eduGAIN/Pages/home.aspx">eduGAIN</a> to create test +accounts with different profiles to validate the behaviour and test +federated login. The test accounts can only be used to access own services. <a href="presentation.html">Learn more about this service...</a> +</p> +<h3>Start testing your eduGAIN service</h3> +<p> +To start testing your own eduGAIN service, start by selecting the +Service Provider you are administrator for. +</p> +<p class="align-center"><button id="start_testing">Go on testing the service</button></p> + +<h3>[% app.name %] basics</h3> +<p> +<br/><img alt="[% app.name %] Basics" src="images/edugain_test_idp_basics.png"/> +</p> + +</div> diff --git a/templates/web/fr/index-nobanner.tt2.html b/templates/web/fr/index-nobanner.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..f13a0d1f4ebff4f201ea317b518a32901db50c4c --- /dev/null +++ b/templates/web/fr/index-nobanner.tt2.html @@ -0,0 +1,9 @@ +<DOCTYPE! html> + +[% IF errors %] +<div class="ui-widget"> +[% PROCESS 'errors.tt2.html' %] +</div> +[% ELSE %] +[% PROCESS 'content.tt2.html' %] +[% END %] diff --git a/templates/web/fr/index.tt2.html b/templates/web/fr/index.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..4550215f61b53759e0f3c1d05763d4447ed08df2 --- /dev/null +++ b/templates/web/fr/index.tt2.html @@ -0,0 +1,67 @@ +<DOCTYPE! html> +<html lang="fr"> + + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> + <meta charset="utf-8"> + + <link rel="icon" type="image/png" href="images/favicon.png" /> + + <link rel="stylesheet" type="text/css" href="foundation/css/foundation.css"> + <link rel="stylesheet" type="text/css" href="jquery.steps.css"> + <link rel="stylesheet" type="text/css" href="jquery-ui-1.11.1/jquery-ui.min.css" /> + <link rel="stylesheet" type="text/css" href="css/style.css" /> + + <script type="text/javascript" src="jquery-1.11.1.min.js"></script> + <script type="text/javascript" src="jquery-ui-1.11.1/jquery-ui.min.js"></script> + <script type="text/javascript" src="jquery.validate.1.13.0.min.js"></script> + <script type="text/javascript" src="jquery.cookie-1.4.1.min.js"></script> + <script type="text/javascript" src="jquery.steps.1.1.0.min.js"></script> + <script type="text/javascript" src="account-manager.js"></script> + + <title>[% app.name %]</title> + + </head> + + <body> + <header> + <div class="clearfix"> + <a href="http://www.edugain.org" title="eduGAIN home page" target="_blank" class="left"><img alt="eduGAIN logo" width="200" src="images/edugain_logo.png"/></a> + <a href="http://www.geant.net" title="Geant home page" target="_blank" class="right"><img alt="GEANT logo" width="100" src="images/geant_logo_rgb_300dpi.jpg"/></a> + </div> + <div class="title"> + <h1>[% app.name %]</h1> + </div> + </header> + + <div id="content"> + + [% IF errors %] + <div class="ui-widget"> + [% PROCESS 'errors.tt2.html' %] + </div> + [% ELSE %] + [% IF notifications %] + <div class="ui-widget"> + [% PROCESS 'notices.tt2.html' %] + </b> + </div> + [% END %] + + [% PROCESS 'content.tt2.html' %] + + [% END %] + </div> + + <footer> + <span class="align-center">[% app.name %] [% app.version %] - <a href="mailto:[% app.support_email %]">contactez nous</a></span> + </footer> + + <script src="foundation/js/foundation.min.js"></script> + <script src="foundation/js/foundation/foundation.tooltip.js"></script> + <script> + $(document).foundation(); + </script> + </body> +</html> diff --git a/templates/web/fr/notices.tt2.html b/templates/web/fr/notices.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..c284d62be6eb6119b7e83dfe1f6036117fb9c05b --- /dev/null +++ b/templates/web/fr/notices.tt2.html @@ -0,0 +1,15 @@ + [% FOREACH notif IN notifications %] +<p class="ui-state-highlight ui-corner-all" style="border: 2px solid #10427a; background: #DFF1EE;padding: 0.7em;"><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> + Notice: + + [% IF notif == 'done' %] + + Operation has been performed + + [% ELSE %] + + [% notif %]<br/> + + [% END %] + + [% END %] <!-- FOREACH --> diff --git a/templates/web/fr/select_email.tt2.html b/templates/web/fr/select_email.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..846635343e340eee55512d982ff3665f1512d8f0 --- /dev/null +++ b/templates/web/fr/select_email.tt2.html @@ -0,0 +1,36 @@ +<h3>Select your email address</h3> +<div> +Before you can create test accounts at this Identity Provider, we need to ensure you are a legitimate administrator of "[% provider.displayname %]". +</div> + +<fieldset class="scrollable"> +[% IF provider.contacts.defined %] + <legend>Select your email address</legend> + <label for="entityid">The email addresses below have been extracted from your SP SAML metadata.<br/>Please select the email address where an email challenge + can be sent to validate your identity</label> + + +<div class="radio_inline"> +[% FOREACH email IN provider.contacts.sort %] +<input name="email" value="[% email %]" type="radio" class="required"/><label for="email">[% email %]</label><br/> + +<input type="hidden" name="entityid" value="[% provider.entityid %]" id="entityid"/> + +[% END %] +</div> + +[% ELSE %] +No ContactPerson elements could be found in your SP SAML metadata. Therefore we are unable to provide test accounts for your SP. Please contact your local federation +administrator to add ContactPerson information to the SAML metadata. +[% END %] + +</fieldset> + +<script type="text/javascript"> + $(function() { + $('label[for="email"]').on('click', function() { + var input = $(this).prev(); + input.val([input.attr('value')]); + }); + }); +</script> diff --git a/templates/web/fr/select_sp.tt2.html b/templates/web/fr/select_sp.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..6f5488aa1890140781ff1e128dda02e9c114ed93 --- /dev/null +++ b/templates/web/fr/select_sp.tt2.html @@ -0,0 +1,134 @@ + <script type="text/javascript"> + +jQuery(document).ready(function($){ + + var form = $("#create-account-form").show(); + + form.steps({ + headerTag: "h3", + bodyTag: "fieldset", + stepsOrientation: "vertical", + transitionEffect: "slideLeft", + //saveState: true, + onStepChanging: function (event, currentIndex, newIndex) + { + + // Trigger loading of the 'select_sp' with the selected SP entityid as parameter + // Result gets included in the next tab + if (currentIndex === 0 && newIndex === 1) + { + form.steps("remove", 1); + form.steps("insert", 1, { + title: "Select your email address", + contentMode: "async", + contentUrl: "[% app.url %]?action=select_email&style=nobanner&entityid="+ + encodeURIComponent($('#entityid').val()) + }); + } + + // Trigger loading of the 'generate_token' with the selected SP entityid as parameter + // Result gets included in the next tab + if (currentIndex === 1 && newIndex === 2) + { + form.steps("remove", 2); + form.steps("insert", 2, { + title: "Complete email challenge", + contentMode: "async", + contentUrl: "[% app.url %]?action=complete_challenge&style=nobanner&entityid="+ + encodeURIComponent($('#entityid').val())+"&email="+encodeURIComponent($("input:checked[name='email']").val()) + }); + } + + // Trigger loading of the 'validate_token' with the list of test accounts created + // Result gets included in the next tab + if (currentIndex === 2 && newIndex === 3) + { + window.location="[% app.url %]?action=create_accounts&entityid="+ + encodeURIComponent($('#entityid').val())+"&token="+encodeURIComponent($('#token').val()); + } + + // Allways allow previous action even if the current form is not valid! + if (currentIndex > newIndex) + { + return true; + } + // Needed in some cases if the user went back (clean up) + if (currentIndex < newIndex) + { + // To remove error styles + form.find(".body:eq(" + newIndex + ") label.error").remove(); + form.find(".body:eq(" + newIndex + ") .error").removeClass("error"); + } + form.validate().settings.ignore = ":disabled,:hidden"; + return form.valid(); + + }, + onStepChanged: function (event, currentIndex, priorIndex) + { + }, + onFinishing: function (event, currentIndex) + { + form.validate().settings.ignore = ":disabled"; + return form.valid(); + }, + onFinished: function (event, currentIndex) + { + alert("Submitted!"); + } + }); + + form.validate({ + errorPlacement: function errorPlacement(error, element) { element.before(error); }, + }); + +}); + +$(function() { + $( "#entityid" ).combobox(); + $( "#toggle" ).click(function() { + $( "#combobox" ).toggle(); + }); +}); + +</script> + + +<form id ="create-account-form" + action="[% env.SCRIPT_NAME %]" + method="POST"> + + <h3>Select your Service Provider</h3> +<fieldset> + <h3>Select your Service Provider</h3> +<div> +Please search and select the Service Provider that you want to test in +the list below. You must be an administrator of that Service Provider to +continue afterwards. +<br/><br/> + +<label for="entityid">Type the SP name or entityID to search for it.</label> +Note that only Service Providers are in the list which are included in the eduGAIN metadata.<br/> + + <select id="entityid" name="entityid" class="required"> + <option value="">Select your Service Provider below</option> + [% FOREACH entity IN metadata.sort('display_name') %] +<option value="[% entity.entityid %]">[% IF entity.display_name %][% entity.display_name %] [% END %]([% entity.entityid %])</option> + [% END %] + </select> + <br/> +</div> +</fieldset> + +<h3>Select your email address</h3> +<fieldset> + <div data-mode="async" data-url="/rest/service/0"></div> +</fieldset> + +<h3>Complete email challenge</h3> +<fieldset></fieldset> + +<h3>Test accounts</h3> +<fieldset></fieldset> + + +</form>