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

add organization-filtered list for authenticated users

parent e92391db
No related branches found
No related tags found
No related merge requests found
...@@ -256,6 +256,7 @@ sub req_select_sp { ...@@ -256,6 +256,7 @@ sub req_select_sp {
my @federations = split(/, */, $self->{configuration}->{federations}->{list}); my @federations = split(/, */, $self->{configuration}->{federations}->{list});
my %federations; my %federations;
my @self_entities;
foreach my $federation (@federations) { foreach my $federation (@federations) {
my $file = $self->get_metadata_file(federation => $federation); my $file = $self->get_metadata_file(federation => $federation);
...@@ -275,6 +276,25 @@ sub req_select_sp { ...@@ -275,6 +276,25 @@ sub req_select_sp {
label => $self->{configuration}->{$federation}->{label}, label => $self->{configuration}->{$federation}->{label},
entities => $entities entities => $entities
}; };
# if user is authenticated, and its IdP is found in metadata,
# push all entities with the same organization URL in a list
if ($ENV{HTTP_SHIB_IDENTITY_PROVIDER}) {
my $idp = $metadata->parse(entityid => $ENV{HTTP_SHIB_IDENTITY_PROVIDER});
if ($idp) {
my $organization = $idp->organization();
push @self_entities,
grep { $_->{organization} eq $organization }
@$entities;
}
}
}
if (@self_entities) {
$federations{self} = {
label => $self->{lh}->maketext("My organization"),
entities => \@self_entities,
};
} }
$self->respond( $self->respond(
......
...@@ -117,6 +117,10 @@ msgstr "Liste des attributs utilisateur" ...@@ -117,6 +117,10 @@ msgstr "Liste des attributs utilisateur"
msgid "More information" msgid "More information"
msgstr "Plus d'information" msgstr "Plus d'information"
#: lib/AccountManager/App.pm:295
msgid "My organization"
msgstr "Mon organisme"
#: templates/web/edugain/complete_challenge.tt2.html:29 templates/web/edugain/select_email.tt2.html:38 templates/web/edugain/select_sp.tt2.html:37 templates/web/renater/complete_challenge.tt2.html:29 templates/web/renater/select_email.tt2.html:38 templates/web/renater/select_sp.tt2.html:37 #: templates/web/edugain/complete_challenge.tt2.html:29 templates/web/edugain/select_email.tt2.html:38 templates/web/edugain/select_sp.tt2.html:37 templates/web/renater/complete_challenge.tt2.html:29 templates/web/renater/select_email.tt2.html:38 templates/web/renater/select_sp.tt2.html:37
msgid "Next" msgid "Next"
msgstr "Suivant" msgstr "Suivant"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment