diff-readMetadata.txt

Michael Simon, 2018-09-24 10:41

Download (1.12 KB)

 
1
358c358
2
< 	global $defaultLanguage, $supportHideFromDiscoveryEntityCategory;
3
---
4
> 	global $defaultLanguage, $supportHideFromDiscoveryEntityCategory, $filterEntityCategory;
5
370a371,376
6
> 	if (isset($filterEntityCategory)){
7
> 		if (! hasSpecificEntityCategory($IDPRoleDescriptorNode, $filterEntityCategory)){
8
> 			return false;
9
> 		}
10
> 	}
11
> 
12
778a785,804
13
> 
14
> /******************************************************************************/
15
> // Returns true if IdP has specific entity category attribute
16
> function hasSpecificEntityCategory($IDPRoleDescriptorNode, $filterEntityCategory){
17
>         // Get SAML Attributes for this entity
18
>         $AttributeValues = $IDPRoleDescriptorNode->parentNode->getElementsByTagNameNS('urn:oasis:names:tc:SAML:2.0:assertion', 'AttributeValue');
19
> 
20
>         if (!$AttributeValues || $AttributeValues->length < 1){
21
>                 return false;
22
>         }
23
> 
24
>         foreach( $AttributeValues as $AttributeValue ){
25
>                 if (trim($AttributeValue->nodeValue) == $filterEntityCategory){
26
>                         return true;
27
>                 }
28
>         }
29
> 
30
>         return false;
31
> }
32
>