diff --git a/lib/AccountManager/App.pm b/lib/AccountManager/App.pm index 182e1108343be8bfc5685f8b7c5fd8478755a0b3..9bf24e63421403c5ed78792a169ba9e0e9457198 100644 --- a/lib/AccountManager/App.pm +++ b/lib/AccountManager/App.pm @@ -33,6 +33,7 @@ my $entity_id_pattern = qr{ my %actions = ( home => 'req_home', + start => 'req_start', select_federation => 'req_select_federation', select_sp => 'req_select_sp', select_email => 'req_select_email', @@ -131,7 +132,6 @@ sub new { sub run { my ($self) = @_; - # process input parameters my %parameters = $self->{cgi}->Vars(); @@ -207,6 +207,19 @@ sub respond { exit 0; } +sub req_start { + my ($self) = @_; + + my @federations = keys %{$self->{configuration}->{federations}}; + if (@federations == 1) { + $self->{in}->{federation} = $federations[0]; + $self->req_select_sp(); + } else { + $self->req_select_federation(); + } +} + + sub req_select_federation { my ($self) = @_; diff --git a/templates/web/home.tt2.html b/templates/web/home.tt2.html index 6fff1a9a684607249df72416512c3bdd22e7d7e9..3217f3e8ae9ab5af0eccfbb0c589f7544c893f97 100644 --- a/templates/web/home.tt2.html +++ b/templates/web/home.tt2.html @@ -17,6 +17,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=select_federation" class="button">[% lh.maketext("Get started") %]</a></p> +<p class="text-center"><a href="[% app.url %]?action=start" class="button">[% lh.maketext("Get started") %]</a></p> [% END %]