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

allow either to replace or complete provider contacts

parent c1ee4a67
No related branches found
No related tags found
No related merge requests found
......@@ -262,12 +262,20 @@ sub req_select_sp {
}
}
# replace metadata contacts from configuration contacts if defined
# override metadata contacts if needed
my $entity = $self->{in}->{sp_entityid};
my $contacts =
$self->{configuration}->{$entity}->{contacts} ||
$self->{configuration}->{service}->{contacts};
$provider->contacts(split(/, */, $contacts)) if $contacts;
if ($contacts) {
if ($contacts =~ /^\+(.+)/) {
# complement original contacts
$provider->contacts($provider->contacts(), split(/, */, $1));
} else {
# replace original contacts
$provider->contacts(split(/, */, $contacts));
}
}
$self->{out}->{provider} = $provider;
$self->{out}->{subtitle} = 'Select your Service Provider';
......@@ -303,12 +311,20 @@ sub req_generate_token {
return;
}
# replace metadata contacts from configuration contacts if defined
# override metadata contacts if needed
my $entity = $self->{in}->{sp_entityid};
my $contacts =
$self->{configuration}->{$entity}->{contacts} ||
$self->{configuration}->{service}->{contacts};
$provider->contacts(split(/, */, $contacts)) if $contacts;
if ($contacts) {
if ($contacts =~ /^\+(.+)/) {
# complement original contacts
$provider->contacts($provider->contacts(), split(/, */, $1));
} else {
# replace original contacts
$provider->contacts(split(/, */, $contacts));
}
}
## Check that email_address is a known contact for this SP
unless ($provider->is_contact($self->{in}->{email_address}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment