From 672af13fb41dd737412f33e6143b3f8c76754087 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse <guillaume.rousse@renater.fr> Date: Tue, 13 Feb 2018 18:45:42 +0100 Subject: [PATCH] enforce consistent name for each steps --- lib/AccountManager/WebRequest.pm | 31 ++++++++------------------- templates/web/account_wizard.tt2.html | 16 +++++++------- templates/web/content.tt2.html | 13 +++-------- templates/web/generate_token.tt2.html | 2 +- templates/web/home.tt2.html | 2 +- templates/web/index.tt2.html | 4 ++-- templates/web/select_sp.tt2.html | 2 +- 7 files changed, 25 insertions(+), 45 deletions(-) diff --git a/lib/AccountManager/WebRequest.pm b/lib/AccountManager/WebRequest.pm index 35c4e8c..1a140db 100644 --- a/lib/AccountManager/WebRequest.pm +++ b/lib/AccountManager/WebRequest.pm @@ -30,11 +30,11 @@ my %format = ( ); my %actions = ( - select_sp => 'req_select_sp', - account_wizard => 'req_account_wizard', - generate_token => 'req_generate_token', - validate_token => 'req_validate_token', - home => 'req_home', + home => 'req_home', + select_sp => 'req_select_sp', + select_email => 'req_select_email', + complete_challenge => 'req_complete_challenge', + create_accounts => 'req_create_accounts', ); ## New web request @@ -176,8 +176,7 @@ sub respond { } -## Return the list of known SPs first -sub req_account_wizard { +sub req_select_sp { my ($self) = @_; my $metadata; @@ -195,14 +194,10 @@ sub req_account_wizard { $self->{out}->{metadata} = $metadata->parse(type => 'sp'); - $self->{out}->{subtitle} = 'Select your Service Provider'; - $self->respond(); } -## Select a Service Provider and return metadata sctucture for the SP -## Sample URL : https://dev-edugain.renater.fr/accountmanager?action=select_sp&entityid=http%3A%2F%2Fsp.lat.csc.fi -sub req_select_sp { +sub req_select_email { my ($self) = @_; unless ($self->{in}->{entityid}) { @@ -273,14 +268,11 @@ sub req_select_sp { } $self->{out}->{provider} = $provider; - $self->{out}->{subtitle} = 'Select your Service Provider'; $self->respond(); } -## Generate an authentication token to validate an email address -## Sample call : dev-edugain.renater.fr/accountmanager?action=generate_token&style=nobanner&entityid=https%3A%2F%2Fsourcesup.cru.fr%2Fshibboleth&email=support%40renater.fr -sub req_generate_token { +sub req_complete_challenge { my ($self) = @_; unless ($self->{in}->{entityid}) { @@ -371,7 +363,6 @@ sub req_generate_token { $self->{out}->{email} = $self->{in}->{email}; $self->{out}->{entityid} = $self->{in}->{entityid}; - $self->{out}->{subtitle} = 'Generate an authentication token'; my $sender = $self->{configuration}->{_}->{notice_from}; my $recipient = $self->{in}->{email}; @@ -422,10 +413,7 @@ sub req_generate_token { $self->respond(); } -## Validate an authentication token -## Test accounts get created -## Sample call : dev-edugain.renater.fr/accountmanager?action=validate_token&style=nobanner&entityid=https%3A%2F%2Fsourcesup.cru.fr%2Fshibboleth&token=c1cfecb51ea40d39a695 -sub req_validate_token { +sub req_create_accounts { my ($self) = @_; unless ($self->{in}->{entityid}) { @@ -538,7 +526,6 @@ sub req_validate_token { $self->{out}->{entityid} = $self->{in}->{entityid}; $self->{out}->{accounts} = \@accounts; - $self->{out}->{subtitle} = 'Complete Email Challenge'; $self->respond(); } diff --git a/templates/web/account_wizard.tt2.html b/templates/web/account_wizard.tt2.html index 849884e..fc5e2fc 100644 --- a/templates/web/account_wizard.tt2.html +++ b/templates/web/account_wizard.tt2.html @@ -19,9 +19,9 @@ jQuery(document).ready(function($){ { form.steps("remove", 1); form.steps("insert", 1, { - title: "Send email challenge", + title: "Select your email address", contentMode: "async", - contentUrl: "[% conf.app_url %]?action=select_sp&style=nobanner&entityid="+ + contentUrl: "[% conf.app_url %]?action=select_email&style=nobanner&entityid="+ encodeURIComponent($('#entityid').val()) }); } @@ -32,9 +32,9 @@ jQuery(document).ready(function($){ { form.steps("remove", 2); form.steps("insert", 2, { - title: "Complete Email Challenge", + title: "Complete email challenge", contentMode: "async", - contentUrl: "[% conf.app_url %]?action=generate_token&style=nobanner&entityid="+ + contentUrl: "[% conf.app_url %]?action=complete_challenge&style=nobanner&entityid="+ encodeURIComponent($('#entityid').val())+"&email="+encodeURIComponent($("input:checked[name='email']").val()) }); } @@ -43,7 +43,7 @@ jQuery(document).ready(function($){ // Result gets included in the next tab if (currentIndex === 2 && newIndex === 3) { - window.location="[% conf.app_url %]?action=validate_token&entityid="+ + window.location="[% conf.app_url %]?action=create_accounts&entityid="+ encodeURIComponent($('#entityid').val())+"&token="+encodeURIComponent($('#token').val()); } @@ -119,15 +119,15 @@ Note that only Service Providers are in the list which are included in the eduGA </div> </fieldset> -<h3>Send email challenge</h3> +<h3>Select your email address</h3> <fieldset> <div data-mode="async" data-url="/rest/service/0"></div> </fieldset> -<h3>Complete Email Challenge</h3> +<h3>Complete email challenge</h3> <fieldset></fieldset> -<h3>Test Accounts</h3> +<h3>Test accounts</h3> <fieldset></fieldset> diff --git a/templates/web/content.tt2.html b/templates/web/content.tt2.html index db63e03..a1fe268 100644 --- a/templates/web/content.tt2.html +++ b/templates/web/content.tt2.html @@ -1,34 +1,27 @@ [% IF action == 'select_sp' %] - [% TRY %] - [% PROCESS 'web/select_sp.tt2.html' %] - [% CATCH %] - An error occured - [% END %] - -[% ELSIF action == 'account_wizard' %] [% TRY %] [% PROCESS 'web/account_wizard.tt2.html' %] [% CATCH %] An error occured [% END %] - [% ELSIF action == 'select_sp' %] + [% ELSIF action == 'select_email' %] [% TRY %] [% PROCESS 'web/select_sp.tt2.html' %] [% CATCH %] An error occured [% END %] -[% ELSIF action == 'generate_token' %] +[% ELSIF action == 'complete_challenge' %] [% TRY %] [% PROCESS 'web/generate_token.tt2.html' %] [% CATCH %] An error occured [% END %] -[% ELSIF action == 'validate_token' %] +[% ELSIF action == 'create_accounts' %] [% TRY %] [% PROCESS 'web/validate_token.tt2.html' %] [% CATCH %] diff --git a/templates/web/generate_token.tt2.html b/templates/web/generate_token.tt2.html index efad31b..39ffa61 100644 --- a/templates/web/generate_token.tt2.html +++ b/templates/web/generate_token.tt2.html @@ -1,4 +1,4 @@ -<h3>Complete Email Challenge</h3> +<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> diff --git a/templates/web/home.tt2.html b/templates/web/home.tt2.html index 1e4597e..e3ada94 100644 --- a/templates/web/home.tt2.html +++ b/templates/web/home.tt2.html @@ -3,7 +3,7 @@ $(function() { $('#start_testing').on('click',function() { - window.location.href='[% conf.app_url %]?action=account_wizard'; + window.location.href='[% conf.app_url %]?action=select_sp'; }); }); diff --git a/templates/web/index.tt2.html b/templates/web/index.tt2.html index 53fce36..ef63f31 100644 --- a/templates/web/index.tt2.html +++ b/templates/web/index.tt2.html @@ -181,7 +181,7 @@ jQuery(function($){ //--> </script> - <title>[% IF subtitle %][% title %] - [% subtitle %][% ELSE %][% title %][% END %]</title> + <title>[% title %]</title> </head> @@ -193,7 +193,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="images/geant_logo_rgb_300dpi.jpg"/></a></li> </ul> <div class="title"> - <span class=""><h1>[% IF subtitle %][% title %] - [% subtitle %][% ELSE %][% title %][% END %]</h1></span> + <span class=""><h1>[% title %]</h1></span> </div> </header> diff --git a/templates/web/select_sp.tt2.html b/templates/web/select_sp.tt2.html index 82691b2..8466353 100644 --- a/templates/web/select_sp.tt2.html +++ b/templates/web/select_sp.tt2.html @@ -1,4 +1,4 @@ -<h3>Send email challenge</h3> +<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> -- GitLab