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

extract service URL, and provide a direct access link to user

parent 2fb08fe8
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ CREATE TABLE tokens (
CREATE TABLE services (
id bigint(20) NOT NULL AUTO_INCREMENT,
entityid varchar(200) NOT NULL,
url varchar(200) DEFAULT NULL,
displayname varchar(500) DEFAULT NULL,
contacts varchar(2000) DEFAULT NULL,
PRIMARY KEY (id),
......
......@@ -344,6 +344,7 @@ sub req_select_email {
# complete persistent object
$sp->displayname($entity->{display_name});
$sp->url($entity->{url});
$sp->contacts(uniq map { $_->{EmailAddress} } @{$entity->{contacts}})
if $entity->{contacts};
......@@ -570,6 +571,15 @@ sub req_create_accounts {
$self->check_token(token => $token, entityid => $entityid);
my $sp = AccountManager::ServiceProvider->new(
db => $self->{db},
entityid => $entityid,
);
$self->abort(
log => sprintf("No such SP '%s' in database", $entityid),
user => "no_such_entity"
) if !$sp->load(speculative => 1);
## create test accounts
my @accounts;
......@@ -645,6 +655,7 @@ sub req_create_accounts {
action => 'create_accounts',
accounts => \@accounts,
entityid => $entityid,
url => $sp->url(),
email => $email,
key => $key,
token => $download_token->secret(),
......
......@@ -259,8 +259,8 @@ msgid "Validation token: %1"
msgstr "Code de validation: %1"
#: templates/web/edugain/create_accounts.tt2.html:10 templates/web/renater/create_accounts.tt2.html:12
msgid "You can now use these test accounts to login at your service provider."
msgstr "Vous pouvez maintenant utiliser ces comptes pour vous identifier sur votre fournisseur de service."
msgid "You can now use these test accounts to login at your <a href=\"%1\">service provider</a>."
msgstr "Vous pouvez maintenant utiliser ces comptes pour vous identifier sur votre <a href=\"%1\">fournisseur de service</a>."
#: templates/web/edugain/errors.tt2.html:38 templates/web/renater/errors.tt2.html:37
msgid "You can report the issue to the administrators"
......
......@@ -138,7 +138,12 @@ sub parse {
my %names =
map { $_->getAttribute('xml:lang') => $_->textContent() }
@names;
$data->{name} = $names{en} ? $names{en} : $names[0];
$data->{name} = $names{en} ? $names{en} : $names[0]->textContent();
my @urls = $uiinfo->getChildrenByLocalName('InformationURL');
my %urls =
map { $_->getAttribute('xml:lang') => $_->textContent() }
@urls;
$data->{url} = $urls{en} ? $urls{en} : $urls[0]->textContent();
}
} elsif ($child->localname() eq 'Extensions') {
......
......@@ -15,6 +15,7 @@ __PACKAGE__->meta->setup(
id => { type => 'bigserial', not_null => 1 },
entityid => { type => 'varchar', length => 200, not_null => 1 },
displayname => { type => 'varchar', length => 500 },
url => { type => 'varchar', length => 200 },
contacts => { type => 'array' },
],
......
......@@ -7,8 +7,8 @@
<h2>[% lh.maketext("Test accounts created") %]</h2>
<p>
[% lh.maketext("You can now use these test accounts to login at your service provider.") %]
[% lh.maketext("To do so, select <strong>[_1]</strong> when choosing an identity provider.", idp_displayname) %]
[% lh.maketext("You can now use these test accounts to login at your <a href=\"[_1]\">service provider</a>.", url) %]
[% lh.maketext("To do so, select <strong>[_1]</strong> when choosing an identity provider.", idp_displayname) %]
</p>
<p><a class="button" href="[% app.url %]?action=download_accounts&entityid=[% entityid %]&token=[% token %]&key=[% key %]">[% lh.maketext("Download in CSV format") %]</a></p>
......
......@@ -9,8 +9,8 @@
<h2>[% lh.maketext("Test accounts created") %]</h2>
<p>
[% lh.maketext("You can now use these test accounts to login at your service provider.") %]
[% lh.maketext("To do so, select <strong>[_1]</strong> when choosing an identity provider.", idp_displayname) %]
[% lh.maketext("You can now use these test accounts to login at your <a href=\"[_1]\">service provider</a>.", url) %]
[% lh.maketext("To do so, select <strong>[_1]</strong> when choosing an identity provider.", idp_displayname) %]
</p>
<p><a class="button" href="[% app.url %]?action=download_accounts&entityid=[% entityid %]&token=[% token %]&key=[% key %]">[% lh.maketext("Download in CSV format") %]</a></p>
......
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