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

Improvements to metadata handling to get current hosted metadata automatically...

Improvements to metadata handling to get current hosted metadata automatically using __default__ host and dynamic entityid.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1144 44740490-163a-0410-bde0-09ae8108e29a
parent 1bfe2504
No related branches found
No related tags found
No related merge requests found
...@@ -172,8 +172,19 @@ abstract class SimpleSAML_Metadata_MetaDataStorageSource { ...@@ -172,8 +172,19 @@ abstract class SimpleSAML_Metadata_MetaDataStorageSource {
$metadataSet = $this->getMetadataSet($set); $metadataSet = $this->getMetadataSet($set);
foreach($metadataSet AS $index => $entry) /* Check for hostname. */
if ($entry['entityid'] === $entityId) return $index; $currenthost = SimpleSAML_Utilities::getSelfHost(); // sp.example.org
if(strpos($currenthost, ":") !== FALSE) {
$currenthostdecomposed = explode(":", $currenthost);
$currenthost = $currenthostdecomposed[0];
}
foreach($metadataSet AS $index => $entry) {
if ($index === $entityId) return $index;
if ($entry['entityid'] === $entityId) {
if ($entry['host'] === '__DEFAULT__' || $entry['host'] === $currenthost) return $index;
}
}
return NULL; return NULL;
} }
......
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