From 75a141a6be2f4df54df432b79505b8000894e79f Mon Sep 17 00:00:00 2001 From: Guillaume Rousse <guillaume.rousse@renater.fr> Date: Thu, 29 Nov 2018 12:31:18 +0100 Subject: [PATCH] drop useless indirection --- lib/AccountManager/App.pm | 15 ++++----------- templates/web/edugain/create_accounts.tt2.html | 2 +- templates/web/edugain/home.tt2.html | 2 +- templates/web/renater/create_accounts.tt2.html | 2 +- templates/web/renater/home.tt2.html | 2 +- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/lib/AccountManager/App.pm b/lib/AccountManager/App.pm index 995a945..1cdba41 100644 --- a/lib/AccountManager/App.pm +++ b/lib/AccountManager/App.pm @@ -35,7 +35,6 @@ my %patterns = ( my %actions = ( home => 'req_home', - start => 'req_start', select_federation => 'req_select_federation', select_sp => 'req_select_sp', select_email => 'req_select_email', @@ -247,27 +246,21 @@ sub abort { ); } -sub req_start { +sub req_select_federation { my ($self, %args) = @_; my $federations = $self->{configuration}->{federations}->{list}; my @federations = split(/, */, $federations); + + # skip this step if there is only one federation, + # or if no explicit distinction is required if ( @federations == 1 || $self->{configuration}->{federations}->{merge} ) { $self->req_select_sp(); - } else { - $self->req_select_federation(); } -} - -sub req_select_federation { - my ($self, %args) = @_; - - my $federations = $self->{configuration}->{federations}->{list}; - my @federations = split(/, */, $federations); my %federations = map { $_ => $self->{configuration}->{$_}->{label} } @federations; $self->respond( diff --git a/templates/web/edugain/create_accounts.tt2.html b/templates/web/edugain/create_accounts.tt2.html index 9f582e5..082c372 100644 --- a/templates/web/edugain/create_accounts.tt2.html +++ b/templates/web/edugain/create_accounts.tt2.html @@ -91,5 +91,5 @@ </div> </div> -<p class="text-center"><a href="[% app.url %]?action=start" class="button">[% lh.maketext("Test another service") %]</a></p> +<p class="text-center"><a href="[% app.url %]?action=select_federation" class="button">[% lh.maketext("Test another service") %]</a></p> [% END %] diff --git a/templates/web/edugain/home.tt2.html b/templates/web/edugain/home.tt2.html index fb0a6c6..86a0eac 100644 --- a/templates/web/edugain/home.tt2.html +++ b/templates/web/edugain/home.tt2.html @@ -9,6 +9,6 @@ <h2>[% lh.maketext("Get started") %]</h2> <p>[% lh.maketext("To start testing your own services, start by selecting one your are administrator for.") %]</p> -<p class="text-center"><a href="[% app.url %]?action=start" class="button">[% lh.maketext("Get started") %]</a></p> +<p class="text-center"><a href="[% app.url %]?action=select_federation" class="button">[% lh.maketext("Get started") %]</a></p> [% END %] diff --git a/templates/web/renater/create_accounts.tt2.html b/templates/web/renater/create_accounts.tt2.html index 514cfe0..c8e60f1 100644 --- a/templates/web/renater/create_accounts.tt2.html +++ b/templates/web/renater/create_accounts.tt2.html @@ -95,5 +95,5 @@ </div> </div> -<p class="text-center"><a href="[% app.url %]?action=start" class="button">[% lh.maketext("Test another service") %]</a></p> +<p class="text-center"><a href="[% app.url %]?action=select_federation" class="button">[% lh.maketext("Test another service") %]</a></p> [% END %] diff --git a/templates/web/renater/home.tt2.html b/templates/web/renater/home.tt2.html index 14d2690..ede3193 100644 --- a/templates/web/renater/home.tt2.html +++ b/templates/web/renater/home.tt2.html @@ -9,6 +9,6 @@ <h2>[% lh.maketext("Get started") %]</h2> <p>[% lh.maketext("To start testing your own services, start by selecting one your are administrator for.") %]</p> -<p class="text-center"><a href="[% app.url %]?action=start" class="button">[% lh.maketext("Get started") %]</a></p> +<p class="text-center"><a href="[% app.url %]?action=select_federation" class="button">[% lh.maketext("Get started") %]</a></p> [% END %] -- GitLab