Skip to content
Snippets Groups Projects
Commit 8a9d21b4 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

pass title, subtitle and action to the templates

parent b672b10f
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ use IdPAccountManager::Data::AuthenticationToken; ...@@ -12,6 +12,7 @@ use IdPAccountManager::Data::AuthenticationToken;
use IdPAccountManager::Data::ServiceProvider; use IdPAccountManager::Data::ServiceProvider;
use IdPAccountManager::Logger; use IdPAccountManager::Logger;
use IdPAccountManager::SAMLMetadata; use IdPAccountManager::SAMLMetadata;
use IdPAccountManager::Tools;
## Defining parameters format ## Defining parameters format
my $urn_or_url_regex = '(http(s?):\/\/|urn:)[^\\\$\*\"\'\`\^\|\<\>\n\s]+' my $urn_or_url_regex = '(http(s?):\/\/|urn:)[^\\\$\*\"\'\`\^\|\<\>\n\s]+'
...@@ -87,23 +88,6 @@ sub execute { ...@@ -87,23 +88,6 @@ sub execute {
my $status; my $status;
# initialize output parameters
$self->{out} = {
env => {
REMOTE_HOST => $ENV{REMOTE_HOST},
REMOTE_ADDR => $ENV{REMOTE_ADDR},
SCRIPT_NAME => $ENV{SCRIPT_NAME}
},
conf => {
accounts_validity_period => $self->{configuration}->{accounts_validity_period},
app_name => $self->{configuration}->{app_name},
app_url => $self->{configuration}->{app_url},
idp_scope => $self->{configuration}->{idp_scope},
idp_displayname => $self->{configuration}->{idp_displayname},
support_email => $self->{configuration}->{support_email},
version => $self->{configuration}->{version},
}
};
# process input parameters # process input parameters
my %parameters = $self->{cgi}->Vars(); my %parameters = $self->{cgi}->Vars();
...@@ -142,9 +126,29 @@ sub execute { ...@@ -142,9 +126,29 @@ sub execute {
}; };
} }
# Check the requested action
my $action = $parameters{action} || 'home'; my $action = $parameters{action} || 'home';
# initialize output parameters
$self->{out} = {
env => {
REMOTE_HOST => $ENV{REMOTE_HOST},
REMOTE_ADDR => $ENV{REMOTE_ADDR},
SCRIPT_NAME => $ENV{SCRIPT_NAME}
},
conf => {
accounts_validity_period => $self->{configuration}->{accounts_validity_period},
app_name => $self->{configuration}->{app_name},
app_url => $self->{configuration}->{app_url},
idp_scope => $self->{configuration}->{idp_scope},
idp_displayname => $self->{configuration}->{idp_displayname},
support_email => $self->{configuration}->{support_email},
version => $self->{configuration}->{version},
},
action => $action,
title => $self->{configuration}->{app_name}
};
# process requested action
if ($actions{$action}) { if ($actions{$action}) {
my $method = $actions{$action}; my $method = $actions{$action};
$status = $self->$method(); $status = $self->$method();
...@@ -183,7 +187,7 @@ sub respond { ...@@ -183,7 +187,7 @@ sub respond {
my $template; my $template;
## nobanner is used to do AJAX to get only pieces of HTML to load in the web client ## nobanner is used to do AJAX to get only pieces of HTML to load in the web client
if ($self->{in}->{style} eq 'nobanner') { if ($self->{in}->{style} && $self->{in}->{style} eq 'nobanner') {
$template = 'web/index-nobanner.tt2.html'; $template = 'web/index-nobanner.tt2.html';
} else { } else {
$template = 'web/index.tt2.html'; $template = 'web/index.tt2.html';
...@@ -255,6 +259,8 @@ sub req_account_wizard { ...@@ -255,6 +259,8 @@ sub req_account_wizard {
return undef; return undef;
} }
$self->{out}->{subtitle} = 'Select your Service Provider';
return 1; return 1;
} }
...@@ -362,6 +368,7 @@ sub req_select_sp { ...@@ -362,6 +368,7 @@ sub req_select_sp {
$self->{out}->{sp_metadata_as_hashref} = $self->{out}->{sp_metadata_as_hashref} =
$federation_metadata->{federation_metadata_as_hashref}->[0]; $federation_metadata->{federation_metadata_as_hashref}->[0];
$self->{out}->{serviceprovider} = $service_provider; $self->{out}->{serviceprovider} = $service_provider;
$self->{out}->{subtitle} = 'Select your Service Provider';
return 1; return 1;
} }
...@@ -477,6 +484,7 @@ sub req_generate_token { ...@@ -477,6 +484,7 @@ sub req_generate_token {
$self->{out}->{to} = $self->{in}->{email_address}; $self->{out}->{to} = $self->{in}->{email_address};
$self->{out}->{authentication_token} = $self->{out}->{authentication_token} =
$authentication_token->get('token'); $authentication_token->get('token');
$self->{out}->{subtitle} = 'Generate an authentication token';
## Send the challenge email with the token ## Send the challenge email with the token
IdPAccountManager::Tools::mail_notice( IdPAccountManager::Tools::mail_notice(
...@@ -607,6 +615,7 @@ sub req_validate_token { ...@@ -607,6 +615,7 @@ sub req_validate_token {
$self->{out}->{sp_entityid} = $self->{in}->{sp_entityid}; $self->{out}->{sp_entityid} = $self->{in}->{sp_entityid};
$self->{out}->{test_accounts} = \@test_accounts; $self->{out}->{test_accounts} = \@test_accounts;
$self->{out}->{subtitle} = 'Complete Email Challenge';
return 1; return 1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment