Skip to content
Snippets Groups Projects
Commit 8f6f3189 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Add support for adding contact persons in generated SAML 2.0 Metadata.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1068 44740490-163a-0410-bde0-09ae8108e29a
parent ed929363
No related branches found
No related tags found
No related merge requests found
...@@ -139,6 +139,25 @@ class SimpleSAML_Metadata_SAMLBuilder { ...@@ -139,6 +139,25 @@ class SimpleSAML_Metadata_SAMLBuilder {
} }
$this->entityDescriptor->appendChild($e); $this->entityDescriptor->appendChild($e);
if (array_key_exists('contacts', $metadata) && is_array($metadata['contacts']) ) {
foreach($metadata['contacts'] AS $contact) {
if (array_key_exists('contactType', $contact) && array_key_exists('EmailAddress', $contact)) {
$t = $this->createElement('ContactPerson');
$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);
}
}
}
} }
...@@ -183,8 +202,28 @@ class SimpleSAML_Metadata_SAMLBuilder { ...@@ -183,8 +202,28 @@ class SimpleSAML_Metadata_SAMLBuilder {
$t->setAttribute('Location', $metadata['SingleSignOnService']); $t->setAttribute('Location', $metadata['SingleSignOnService']);
$e->appendChild($t); $e->appendChild($t);
} }
$this->entityDescriptor->appendChild($e); $this->entityDescriptor->appendChild($e);
if (array_key_exists('contacts', $metadata) && is_array($metadata['contacts']) ) {
foreach($metadata['contacts'] AS $contact) {
if (array_key_exists('contactType', $contact) && array_key_exists('EmailAddress', $contact)) {
$t = $this->createElement('ContactPerson');
$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);
}
}
}
} }
......
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