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

no need to hardcode attributes list

parent 26ecbb01
Branches
Tags
No related merge requests found
...@@ -9,9 +9,8 @@ $validTestAccounts = array ( ...@@ -9,9 +9,8 @@ $validTestAccounts = array (
'[% account.internal_uid() %]:{SHA256}[% account.password_hash() %]=' => array( '[% account.internal_uid() %]:{SHA256}[% account.password_hash() %]=' => array(
'internal_uid' => array([% account.internal_uid().quote %]), 'internal_uid' => array([% account.internal_uid().quote %]),
'associatedSP' => array([% account.entityid().quote %]), 'associatedSP' => array([% account.entityid().quote %]),
[% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName', 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] %] [% FOREACH pair IN attributes.pairs %]
[% NEXT UNLESS attributes.$attribute %] '[% pair.key %]' => array([% pair.value.quote("'").join(', ') %]),
'[% attribute %]' => array([% attributes.$attribute.quote("'").join(', ') %]),
[% END %] [% END %]
), ),
......
...@@ -58,9 +58,9 @@ ...@@ -58,9 +58,9 @@
<div> <div>
<table> <table>
<caption>[% lh.maketext("List of user attributes") %]</caption> <caption>[% lh.maketext("List of user attributes") %]</caption>
[% FOREACH attribute IN [ 'cn', 'displayName', 'givenName', 'sn', 'mail', 'schacHomeOrganization', 'schacHomeOrganizationType', 'eduPersonPrincipalName', 'eduPersonAffiliation', 'eduPersonScopedAffiliation' ] %] [% FOREACH pair IN attributes.pairs %]
<tr> <tr>
<th>[% attribute %]</th><td>[% attributes.$attribute.join(', ') %]</td> <th>[% pair.key %]</th><td>[% pair.value.join(', ') %]</td>
</tr> </tr>
[% END %] [% END %]
<tr> <tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment