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

import IdPs too

parent fae128e7
No related branches found
No related tags found
No related merge requests found
...@@ -78,7 +78,7 @@ foreach my $id (split(/, */, $configuration->{groups}->{list})) { ...@@ -78,7 +78,7 @@ foreach my $id (split(/, */, $configuration->{groups}->{list})) {
print "parsing metadata from file $file\n" if $options{verbose}; print "parsing metadata from file $file\n" if $options{verbose};
my $entities; my $entities;
eval { eval {
$entities = $metadata->parse(type => 'sp'); $entities = $metadata->parse();
}; };
if ($EVAL_ERROR) { if ($EVAL_ERROR) {
$db->rollback(); $db->rollback();
...@@ -86,11 +86,15 @@ foreach my $id (split(/, */, $configuration->{groups}->{list})) { ...@@ -86,11 +86,15 @@ foreach my $id (split(/, */, $configuration->{groups}->{list})) {
} }
foreach my $entry (@$entities) { foreach my $entry (@$entities) {
# avoid duplicates # skip duplicates
next if $seen{$entry->{entityid}}++; next if $seen{$entry->{entityid}}++;
# skip entities different from SP or IdP
next if !$entry->{type};
my $entity = AccountManager::Entity->new( my $entity = AccountManager::Entity->new(
db => $db, db => $db,
type => $entry->{type},
entityid => $entry->{entityid}, entityid => $entry->{entityid},
displayname => $entry->{display_name}, displayname => $entry->{display_name},
information_url => $entry->{information_url}, information_url => $entry->{information_url},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment