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

rename url -> information_url, add organization_url

parent 97af5818
No related branches found
No related tags found
No related merge requests found
...@@ -90,10 +90,11 @@ foreach my $id (split(/, */, $configuration->{groups}->{list})) { ...@@ -90,10 +90,11 @@ foreach my $id (split(/, */, $configuration->{groups}->{list})) {
next if $seen{$entry->{entityid}}++; next if $seen{$entry->{entityid}}++;
my $entity = AccountManager::Entity->new( my $entity = AccountManager::Entity->new(
db => $db, db => $db,
entityid => $entry->{entityid}, entityid => $entry->{entityid},
displayname => $entry->{display_name}, displayname => $entry->{display_name},
url => $entry->{url}, information_url => $entry->{information_url},
organization_url => $entry->{organization_url},
); );
$entity->contacts(uniq map { $_->{EmailAddress} } @{$entry->{contacts}}) $entity->contacts(uniq map { $_->{EmailAddress} } @{$entry->{contacts}})
......
...@@ -14,7 +14,8 @@ CREATE TABLE tokens ( ...@@ -14,7 +14,8 @@ CREATE TABLE tokens (
CREATE TABLE entities ( CREATE TABLE entities (
id bigint(20) NOT NULL AUTO_INCREMENT, id bigint(20) NOT NULL AUTO_INCREMENT,
entityid varchar(200) NOT NULL, entityid varchar(200) NOT NULL,
url varchar(200) DEFAULT NULL, information_url varchar(200) DEFAULT NULL,
organization_url varchar(200) DEFAULT NULL,
displayname varchar(500) DEFAULT NULL, displayname varchar(500) DEFAULT NULL,
contacts varchar(2000) DEFAULT NULL, contacts varchar(2000) DEFAULT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),
......
...@@ -696,7 +696,7 @@ sub req_create_accounts { ...@@ -696,7 +696,7 @@ sub req_create_accounts {
action => 'create_accounts', action => 'create_accounts',
accounts => \@accounts, accounts => \@accounts,
entityid => $entityid, entityid => $entityid,
url => $sp->url(), url => $sp->information_url(),
email => $email, email => $email,
key => $key, key => $key,
token => $download_token->secret(), token => $download_token->secret(),
......
...@@ -12,11 +12,12 @@ __PACKAGE__->meta->setup( ...@@ -12,11 +12,12 @@ __PACKAGE__->meta->setup(
table => 'entities', table => 'entities',
columns => [ columns => [
id => { type => 'bigserial', not_null => 1 }, id => { type => 'bigserial', not_null => 1 },
entityid => { type => 'varchar', length => 200, not_null => 1 }, entityid => { type => 'varchar', length => 200, not_null => 1 },
displayname => { type => 'varchar', length => 500 }, displayname => { type => 'varchar', length => 500 },
url => { type => 'varchar', length => 200 }, information_url => { type => 'varchar', length => 200 },
contacts => { type => 'array' }, organization_url => { type => 'varchar', length => 200 },
contacts => { type => 'array' },
], ],
primary_key_columns => [ 'id' ], primary_key_columns => [ 'id' ],
......
...@@ -146,7 +146,7 @@ sub parse { ...@@ -146,7 +146,7 @@ sub parse {
my %urls = my %urls =
map { $_->getAttribute('xml:lang') => $_->textContent() } map { $_->getAttribute('xml:lang') => $_->textContent() }
@urls; @urls;
$data->{url} = $data->{information_url} =
$urls{en} ? $urls{en} : $urls{en} ? $urls{en} :
@urls ? $urls[0]->textContent() : @urls ? $urls[0]->textContent() :
undef; undef;
...@@ -191,7 +191,7 @@ sub parse { ...@@ -191,7 +191,7 @@ sub parse {
my %urls = my %urls =
map { $_->getAttribute('xml:lang') => $_->textContent() } map { $_->getAttribute('xml:lang') => $_->textContent() }
@urls; @urls;
$data->{organization} = $data->{organization_url} =
$urls{en} ? $urls{en} : $urls{en} ? $urls{en} :
@urls ? $urls[0]->textContent() : @urls ? $urls[0]->textContent() :
undef; undef;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment