From 9e547f4eae2a47a6890cc70fa8f6fc89ecf112e5 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 3 Sep 2009 10:37:34 +0000
Subject: [PATCH] saml_Auth_Source_SP: Add getMetadataURL()-function.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1742 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/saml/lib/Auth/Source/SP.php | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php
index 2127746b0..0f023943e 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -51,7 +51,7 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
 		if (array_key_exists('entityId', $config)) {
 			$config['entityid'] = $config['entityId'];
 		} else {
-			$config['entityid'] = SimpleSAML_Module::getModuleURL('saml/sp/metadata.php/' . urlencode($this->authId));
+			$config['entityid'] = $this->getMetadataURL();
 		}
 
 		$this->metadata = SimpleSAML_Configuration::loadFromArray($config, 'authsources[' . var_export($this->authId, TRUE) . ']');
@@ -61,6 +61,17 @@ class sspmod_saml_Auth_Source_SP extends SimpleSAML_Auth_Source {
 	}
 
 
+	/**
+	 * Retrieve the URL to the metadata of this SP.
+	 *
+	 * @return string  The metadata URL.
+	 */
+	public function getMetadataURL() {
+
+		return SimpleSAML_Module::getModuleURL('saml/sp/metadata.php/' . urlencode($this->authId));
+	}
+
+
 	/**
 	 * Retrieve the entity id of this SP.
 	 *
-- 
GitLab