/** * Retrieve the EntityDescriptor element which is generated for this entity. * * @return DOMElement The EntityDescriptor element of this entity. */ public function getEntityDescriptor() { $xml = $this->entityDescriptor->toXML(); $xml->ownerDocument->appendChild($xml); return $xml; }
/** * This is the constructor for the SAMLParser class. * * @param SAML2_XML_md_EntityDescriptor $entityElement The EntityDescriptor. * @param int|NULL $maxExpireTime The unix timestamp for when this entity should expire, or NULL if unknwon. * @param array $validators An array of parent elements that may validate this element. */ private function __construct(SAML2_XML_md_EntityDescriptor $entityElement, $maxExpireTime, array $validators = array()) { assert('is_null($maxExpireTime) || is_int($maxExpireTime)'); $this->spDescriptors = array(); $this->idpDescriptors = array(); $e = $entityElement->toXML(); $e = $e->ownerDocument->saveXML($e); $this->entityDescriptor = base64_encode($e); $this->entityId = $entityElement->entityID; $expireTime = self::getExpireTime($entityElement, $maxExpireTime); $this->validators = $validators; $this->validators[] = $entityElement; /* Process Extensions element, if it exists. */ $ext = self::processExtensions($entityElement); $this->scopes = $ext['scope']; $this->tags = $ext['tags']; /* Look over the RoleDescriptors. */ foreach ($entityElement->RoleDescriptor as $child) { if ($child instanceof SAML2_XML_md_SPSSODescriptor) { $this->processSPSSODescriptor($child, $expireTime); } elseif ($child instanceof SAML2_XML_md_IDPSSODescriptor) { $this->processIDPSSODescriptor($child, $expireTime); } elseif ($child instanceof SAML2_XML_md_AttributeAuthorityDescriptor) { $this->processAttributeAuthorityDescriptor($child, $expireTime); } } if ($entityElement->Organization) { $this->processOrganization($entityElement->Organization); } if (!empty($entityElement->ContactPerson)) { foreach ($entityElement->ContactPerson as $contact) { $this->processContactPerson($contact); } } }
$c->EmailAddress = array($email); } $name = $config->getString('technicalcontact_name', NULL); if ($name === NULL) { /* Nothing to do here... */ } elseif (preg_match('@^(.*?)\\s*,\\s*(.*)$@D', $name, $matches)) { $c->SurName = $matches[1]; $c->GivenName = $matches[2]; } elseif (preg_match('@^(.*?)\\s+(.*)$@D', $name, $matches)) { $c->GivenName = $matches[1]; $c->SurName = $matches[2]; } else { $c->GivenName = $name; } $ed->ContactPerson[] = $c; $xml = $ed->toXML(); SimpleSAML_Utilities::formatDOMElement($xml); $xml = $xml->ownerDocument->saveXML($xml); if (count($keys) === 1) { $metaArray20['certData'] = $keys[0]['X509Certificate']; } elseif (count($keys) > 1) { $metaArray20['keys'] = $keys; } if (array_key_exists('output', $_REQUEST) && $_REQUEST['output'] == 'xhtml') { $t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin'); $t->data['header'] = 'saml20-sp'; $t->data['metadata'] = htmlspecialchars($xml); $t->data['metadataflat'] = '$metadata[' . var_export($entityId, TRUE) . '] = ' . var_export($metaArray20, TRUE) . ';'; $t->data['metaurl'] = $source->getMetadataURL(); $t->show(); } else {