From 686cc254110938d3a6c42c7a296b6c7fa167d746 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Tue, 5 Jan 2010 13:52:00 +0000 Subject: [PATCH] SAMLParser: Extract name and description from SP metadata. This patch extracts the name and description of the SP from the AttributeConsumingService element in the metadata. Patch by gyufii (http://code.google.com/u/gyufii/), attached to issue 252. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2073 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/Metadata/SAMLParser.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php index 9f00df0ce..f06bceb82 100644 --- a/lib/SimpleSAML/Metadata/SAMLParser.php +++ b/lib/SimpleSAML/Metadata/SAMLParser.php @@ -520,6 +520,14 @@ class SimpleSAML_Metadata_SAMLParser { $ret['attributes'] = $spd['attributes']; } + /* Add name & description. */ + if (array_key_exists('name', $spd)) { + $ret['name'] = $spd['name']; + } + if (array_key_exists('description', $spd)) { + $ret['description'] = $spd['description']; + } + /* Add certificate data. Only the first valid certificate will be added. */ foreach($spd['keys'] as $key) { if($key['type'] !== 'X509Certificate') { @@ -661,6 +669,14 @@ class SimpleSAML_Metadata_SAMLParser { $ret['attributes'] = $spd['attributes']; } + /* Add name & description. */ + if (array_key_exists('name', $spd)) { + $ret['name'] = $spd['name']; + } + if (array_key_exists('description', $spd)) { + $ret['description'] = $spd['description']; + } + /* Add certificate data. Only the first valid certificate will be added. */ foreach($spd['keys'] as $key) { if($key['type'] !== 'X509Certificate') { -- GitLab