Revision: 1745
Author: olavmrk
Date: Thu Sep  3 03:38:02 2009
Log: saml: Add metadata to frontpage.
http://code.google.com/p/simplesamlphp/source/detail?r=1745

Added:
  /trunk/modules/saml/hooks
  /trunk/modules/saml/hooks/hook_metadata_hosted.php

=======================================
--- /dev/null
+++ /trunk/modules/saml/hooks/hook_metadata_hosted.php  Thu Sep  3 03:38:02  
2009
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * Hook to add the metadata for hosted entities to the frontpage.
+ *
+ * @param array &$metadataHosted  The metadata links for hosted metadata  
on the frontpage.
+ */
+function saml_hook_metadata_hosted(&$metadataHosted) {
+       assert('is_array($metadataHosted)');
+
+       $sources = SimpleSAML_Auth_Source::getSourcesOfType('saml:SP');
+
+       foreach ($sources as $source) {
+
+               $metadata = $source->getMetadata();
+
+               $name = $metadata->getValue('name', NULL);
+               if ($name === NULL) {
+                       $name = $source->getAuthID();
+               }
+
+               $md = array(
+                       'entityid' => $source->getEntityId(),
+                       'metadata-index' => $source->getEntityId(),
+                       'metadata-set' => 'saml20-sp-hosted',
+                       'metadata-url' => $source->getMetadataURL() . 
'?output=xhtml',
+                       'name' => $name,
+               );
+
+               $metadataHosted[] = $md;
+       }
+
+}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/simplesamlphp-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to