diff --git a/templates/Makefile.am b/templates/Makefile.am index ebeefc076a1447f1bcd78e972c911fb22d6ca727..f96b4c4ba983bc6468f4011d4384ba1f15a23b63 100644 --- a/templates/Makefile.am +++ b/templates/Makefile.am @@ -1,15 +1,15 @@ nobase_templates_DATA = \ accountProfiles/valid-accounts.php.tt2 \ mail/send_authentication_token.tt2.eml \ - web/account_wizard.tt2.html \ web/content.tt2.html \ web/errors.tt2.html \ - web/generate_token.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/validate_token.tt2.html + web/select_email.tt2.html \ + web/complete_challenge.tt2.html \ + web/create_accounts.tt2.html EXTRA_DIST = $(nobase_templates_DATA) diff --git a/templates/web/account_wizard.tt2.html b/templates/web/account_wizard.tt2.html deleted file mode 100644 index fc5e2fcec185a8ee4efe5c454c7ef082fd600a3d..0000000000000000000000000000000000000000 --- a/templates/web/account_wizard.tt2.html +++ /dev/null @@ -1,134 +0,0 @@ - <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: "[% conf.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: "[% conf.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="[% conf.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> diff --git a/templates/web/generate_token.tt2.html b/templates/web/complete_challenge.tt2.html similarity index 100% rename from templates/web/generate_token.tt2.html rename to templates/web/complete_challenge.tt2.html diff --git a/templates/web/content.tt2.html b/templates/web/content.tt2.html index a1fe2682b86380c5c115db97c4aff31fcb683e3a..dcbe502c2b96b2c3302a50a5d8ae9b6f2d0013fa 100644 --- a/templates/web/content.tt2.html +++ b/templates/web/content.tt2.html @@ -2,28 +2,28 @@ [% IF action == 'select_sp' %] [% TRY %] - [% PROCESS 'web/account_wizard.tt2.html' %] + [% PROCESS 'web/select_sp.tt2.html' %] [% CATCH %] An error occured [% END %] [% ELSIF action == 'select_email' %] [% TRY %] - [% PROCESS 'web/select_sp.tt2.html' %] + [% PROCESS 'web/select_email.tt2.html' %] [% CATCH %] An error occured [% END %] [% ELSIF action == 'complete_challenge' %] [% TRY %] - [% PROCESS 'web/generate_token.tt2.html' %] + [% PROCESS 'web/complete_challenge.tt2.html' %] [% CATCH %] An error occured [% END %] [% ELSIF action == 'create_accounts' %] [% TRY %] - [% PROCESS 'web/validate_token.tt2.html' %] + [% PROCESS 'web/create_accounts.tt2.html' %] [% CATCH %] An error occured [% END %] diff --git a/templates/web/validate_token.tt2.html b/templates/web/create_accounts.tt2.html similarity index 100% rename from templates/web/validate_token.tt2.html rename to templates/web/create_accounts.tt2.html diff --git a/templates/web/select_email.tt2.html b/templates/web/select_email.tt2.html new file mode 100644 index 0000000000000000000000000000000000000000..846635343e340eee55512d982ff3665f1512d8f0 --- /dev/null +++ b/templates/web/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/select_sp.tt2.html b/templates/web/select_sp.tt2.html index 846635343e340eee55512d982ff3665f1512d8f0..fc5e2fcec185a8ee4efe5c454c7ef082fd600a3d 100644 --- a/templates/web/select_sp.tt2.html +++ b/templates/web/select_sp.tt2.html @@ -1,36 +1,134 @@ -<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> + <script type="text/javascript"> -<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> +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) + { -<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/> + // 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: "[% conf.app_url %]?action=select_email&style=nobanner&entityid="+ + encodeURIComponent($('#entityid').val()) + }); + } -<input type="hidden" name="entityid" value="[% provider.entityid %]" id="entityid"/> + // 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: "[% conf.app_url %]?action=complete_challenge&style=nobanner&entityid="+ + encodeURIComponent($('#entityid').val())+"&email="+encodeURIComponent($("input:checked[name='email']").val()) + }); + } -[% END %] -</div> + // 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="[% conf.app_url %]?action=create_accounts&entityid="+ + encodeURIComponent($('#entityid').val())+"&token="+encodeURIComponent($('#token').val()); + } -[% 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 %] + // 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); }, + }); -</fieldset> +}); -<script type="text/javascript"> - $(function() { - $('label[for="email"]').on('click', function() { - var input = $(this).prev(); - input.val([input.attr('value')]); - }); +$(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>