Skip to content
Snippets Groups Projects
Commit 4d56877d authored by Jacob Christiansen's avatar Jacob Christiansen
Browse files

Made addMeatdataSP20 and addMetadataIdP20 call addContact instead on only...

Made addMeatdataSP20 and addMetadataIdP20 call addContact instead on only adding emailaddress and surname


git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1832 44740490-163a-0410-bde0-09ae8108e29a
parent 65859abd
No related branches found
No related tags found
No related merge requests found
...@@ -336,19 +336,8 @@ class SimpleSAML_Metadata_SAMLBuilder { ...@@ -336,19 +336,8 @@ class SimpleSAML_Metadata_SAMLBuilder {
if (array_key_exists('contacts', $metadata) && is_array($metadata['contacts']) ) { if (array_key_exists('contacts', $metadata) && is_array($metadata['contacts']) ) {
foreach($metadata['contacts'] AS $contact) { foreach($metadata['contacts'] AS $contact) {
if (array_key_exists('contactType', $contact) && array_key_exists('EmailAddress', $contact)) { if (array_key_exists('contactType', $contact) && array_key_exists('emailAddress', $contact)) {
$t = $this->createElement('ContactPerson'); $this->addContact($contact['contactType'], $contact);
$t->setAttribute('contactType', $contact['contactType']);
if (array_key_exists('SurName', $contact)) {
$surname = $this->createTextElement('SurName', $contact['SurName']);
$t->appendChild($surname);
}
$email = $this->createTextElement('EmailAddress', $contact['EmailAddress']);
$t->appendChild($email);
$this->entityDescriptor->appendChild($t);
} }
} }
} }
...@@ -408,19 +397,8 @@ class SimpleSAML_Metadata_SAMLBuilder { ...@@ -408,19 +397,8 @@ class SimpleSAML_Metadata_SAMLBuilder {
if (array_key_exists('contacts', $metadata) && is_array($metadata['contacts']) ) { if (array_key_exists('contacts', $metadata) && is_array($metadata['contacts']) ) {
foreach($metadata['contacts'] AS $contact) { foreach($metadata['contacts'] AS $contact) {
if (array_key_exists('contactType', $contact) && array_key_exists('EmailAddress', $contact)) { if (array_key_exists('contactType', $contact) && array_key_exists('emailAddress', $contact)) {
$t = $this->createElement('ContactPerson'); $this->addContact($contact['contactType'], $contact);
$t->setAttribute('contactType', $contact['contactType']);
if (array_key_exists('SurName', $contact)) {
$surname = $this->createTextElement('SurName', $contact['SurName']);
$t->appendChild($surname);
}
$email = $this->createTextElement('EmailAddress', $contact['EmailAddress']);
$t->appendChild($email);
$this->entityDescriptor->appendChild($t);
} }
} }
} }
...@@ -672,4 +650,4 @@ class SimpleSAML_Metadata_SAMLBuilder { ...@@ -672,4 +650,4 @@ class SimpleSAML_Metadata_SAMLBuilder {
} }
?> ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment