diff --git a/lib/AccountManager/Account.pm b/lib/AccountManager/Account.pm index 4c329f047db0b0c37b92de568f9f7be63de756e3..dbd4fc561782bc0c8f7ed4690eff80223e28e175 100644 --- a/lib/AccountManager/Account.pm +++ b/lib/AccountManager/Account.pm @@ -1,5 +1,6 @@ package AccountManager::Account; +use utf8; use strict; use warnings; @@ -153,14 +154,18 @@ sub mail { sub eduPersonAffiliation { my ($self) = @_; - return $affiliation{$self->profile()}; + my $affiliations = $affiliation{$self->profile()} || []; + + return join(', ', @$affiliations); } sub eduPersonScopedAffiliation { my ($self) = @_; - my $affiliations = $scopedAffiliation{$self->profile()}; - return $affiliations ? - [ map { $_ . '@' . $self->{scope} } @$affiliations ] : undef; + my $affiliations = $scopedAffiliation{$self->profile()} || []; + + $affiliations = [ map { $_ . '@' . $self->{scope} } @$affiliations ]; + + return join(', ', @$affiliations); } sub eduPersonPrincipalName { diff --git a/templates/web/validate_token.tt2.html b/templates/web/validate_token.tt2.html index 258226053bf324bceec79ff7be4c33089f293a33..b58179c88bb4f771fa98bf90f0576e08db08b330 100644 --- a/templates/web/validate_token.tt2.html +++ b/templates/web/validate_token.tt2.html @@ -37,15 +37,10 @@ <div> <table> <caption>List of user attributes</caption> - [% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName' ] -%] + [% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName', 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] -%] <tr> <th>[% attribute %]</th><td> [% account.$attribute %]</td> </tr> - [% END %] - [% FOREACH attribute IN [ 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] -%] - <tr> - <th>[% attribute %]</th><td> [% account.$attribute.join(', ') %]</td> - </tr> [% END %] <tr> <th>eduPersonTargetedID:</th><td><i>value dynamically generated by the SP</i></td> @@ -60,7 +55,7 @@ [% END %] </div> -<p><strong>Please keep a record of the above user names and passwords</strong> because currently there is no mecanism to retrieve the above credentials once you close this page. If you forget the username and passwords, you can however request new test accounts.</p> +<p>Click <a href="[% conf.app_url %]?action=download_accounts&entityid=[% sp_entityid %]&token=[% token %]&key=[% key %]">here</a> to download the details of those accounts in CSV format.</p> <div class="alert-box warning radius"> <p>Note that these test accounts will automatically expire in [% conf.accounts_validity_period %] days and that they can only be used to test federated login to your eduGAIN-enabled Service Provider with entityID <strong>[% sp_entityid %]</strong>.</p>