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

Move Exension fields within IdPDescriptor and SPdescriptor. As discussed on the mailinglist.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1505 44740490-163a-0410-bde0-09ae8108e29a
parent a5c00042
No related branches found
No related tags found
No related merge requests found
......@@ -91,8 +91,11 @@ class SimpleSAML_Metadata_SAMLBuilder {
return $this->document->saveXML();
}
private function addExtensions($metadata) {
/**
* @param $metadata Metadata array
* @param $e Reference to the element where the Extensions element should be included.
*/
private function addExtensions($metadata, &$e = NULL) {
$extensions = $this->createElement('Extensions');
$includeExtensions = FALSE;
......@@ -127,7 +130,13 @@ class SimpleSAML_Metadata_SAMLBuilder {
$extensions->appendChild($scope);
}
}
if ($includeExtensions) $this->entityDescriptor->appendChild($extensions);
if ($includeExtensions) {
if (isset($e)) {
$e->appendChild($extensions);
} else {
$this->entityDescriptor->appendChild($extensions);
}
}
}
public static function arrayize($data) {
......@@ -230,7 +239,7 @@ class SimpleSAML_Metadata_SAMLBuilder {
$e->setAttribute('protocolSupportEnumeration', 'urn:oasis:names:tc:SAML:2.0:protocol');
$this->addExtensions($metadata);
$this->addExtensions($metadata, $e);
$this->addCertificate($e, $metadata);
......@@ -352,7 +361,7 @@ class SimpleSAML_Metadata_SAMLBuilder {
$e->setAttribute('WantAuthnRequestSigned', 'true');
}
$this->addExtensions($metadata);
$this->addExtensions($metadata, $e);
$this->addCertificate($e, $metadata);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment