ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
sspmod_metarefresh_ARP Class Reference
+ Collaboration diagram for sspmod_metarefresh_ARP:

Public Member Functions

 __construct ($metadata, $attributemap, $prefix, $suffix)
 Constructor. More...
 
 getXML ()
 

Private Member Functions

 loadAttributeMap ($attributemap)
 
 surround ($name)
 
 getAttributeID ($name)
 
 getEntryXML ($entry)
 
 getEntryXMLcontent ($entry)
 

Private Attributes

 $metadata
 
 $attributes
 
 $prefix
 
 $suffix
 

Detailed Description

Definition at line 7 of file ARP.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_metarefresh_ARP::__construct (   $metadata,
  $attributemap,
  $prefix,
  $suffix 
)

Constructor.

Parameters
array$metadata
string$attributemap
string$prefix
string$suffix

Definition at line 37 of file ARP.php.

References $attributemap, $metadata, $prefix, $suffix, and loadAttributeMap().

38  {
39  $this->metadata = $metadata;
40  $this->prefix = $prefix;
41  $this->suffix = $suffix;
42 
43  if (isset($attributemap)) {
45  }
46  }
loadAttributeMap($attributemap)
Definition: ARP.php:53
$attributemap
Definition: addurnprefix.php:3
+ Here is the call graph for this function:

Member Function Documentation

◆ getAttributeID()

sspmod_metarefresh_ARP::getAttributeID (   $name)
private
Parameters
string$name
Returns
string

Definition at line 84 of file ARP.php.

References $name, and surround().

Referenced by getEntryXMLcontent().

85  {
86  if (empty($this->attributes)) {
87  return $this->surround($name);
88  }
89  if (array_key_exists($name, $this->attributes)) {
90  return $this->surround($this->attributes[$name]);
91  }
92  return $this->surround($name);
93  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEntryXML()

sspmod_metarefresh_ARP::getEntryXML (   $entry)
private
Parameters
array$entry
Returns
string

Definition at line 123 of file ARP.php.

References getEntryXMLcontent().

Referenced by getXML().

124  {
125  $entityid = $entry['entityid'];
126  return ' <AttributeFilterPolicy id="' . $entityid .
127  '"><PolicyRequirementRule xsi:type="basic:AttributeRequesterString" value="' . $entityid .
128  '" />' . $this->getEntryXMLcontent($entry) . '</AttributeFilterPolicy>';
129  }
getEntryXMLcontent($entry)
Definition: ARP.php:136
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEntryXMLcontent()

sspmod_metarefresh_ARP::getEntryXMLcontent (   $entry)
private
Parameters
array$entry
Returns
string

Definition at line 136 of file ARP.php.

References $ret, and getAttributeID().

Referenced by getEntryXML().

137  {
138  if (!array_key_exists('attributes', $entry)) {
139  return '';
140  }
141 
142  $ret = '';
143  foreach ($entry['attributes'] as $a) {
144  $ret .= ' <AttributeRule attributeID="' . $this->getAttributeID($a) .
145  '"><PermitValueRule xsi:type="basic:ANY" /></AttributeRule>';
146  }
147  return $ret;
148  }
getAttributeID($name)
Definition: ARP.php:84
$ret
Definition: parser.php:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getXML()

sspmod_metarefresh_ARP::getXML ( )
Returns
string

Definition at line 98 of file ARP.php.

References $metadata, $xml, and getEntryXML().

99  {
100  $xml = <<<MSG
101  <?xml version="1.0" encoding="UTF-8"?>
102  <AttributeFilterPolicyGroup id="urn:mace:funet.fi:haka:kalmar" xmlns="urn:mace:shibboleth:2.0:afp"
103  xmlns:basic="urn:mace:shibboleth:2.0:afp:mf:basic" xmlns:saml="urn:mace:shibboleth:2.0:afp:mf:saml"
104  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
105  xsi:schemaLocation="urn:mace:shibboleth:2.0:afp classpath:/schema/shibboleth-2.0-afp.xsd
106  urn:mace:shibboleth:2.0:afp:mf:basic classpath:/schema/shibboleth-2.0-afp-mf-basic.xsd
107  urn:mace:shibboleth:2.0:afp:mf:saml classpath:/schema/shibboleth-2.0-afp-mf-saml.xsd">
108 MSG;
109 
110  foreach ($this->metadata as $metadata) {
111  $xml .= $this->getEntryXML($metadata['metadata']);
112  }
113 
114  $xml .= '</AttributeFilterPolicyGroup>';
115  return $xml;
116  }
getEntryXML($entry)
Definition: ARP.php:123
+ Here is the call graph for this function:

◆ loadAttributeMap()

sspmod_metarefresh_ARP::loadAttributeMap (   $attributemap)
private
Parameters
string$attributemap
Returns
void

Definition at line 53 of file ARP.php.

References $attributemap, $config, and SimpleSAML_Configuration\getInstance().

Referenced by __construct().

54  {
56  include($config->getPathValue('attributemap', 'attributemap/') . $attributemap . '.php');
57  // Note that $attributemap was a string before the call to include() and is now an array!
58  $this->attributes = $attributemap;
59  }
$config
Definition: bootstrap.php:15
$attributemap
Definition: addurnprefix.php:3
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ surround()

sspmod_metarefresh_ARP::surround (   $name)
private
Parameters
string$name
Returns
string

Definition at line 66 of file ARP.php.

References $name, $prefix, $ret, and $suffix.

Referenced by getAttributeID().

67  {
68  $ret = '';
69  if (!empty($this->prefix)) {
71  }
72  $ret .= $name;
73  if (!empty($this->suffix)) {
75  }
76  return $ret;
77  }
$ret
Definition: parser.php:6
+ Here is the caller graph for this function:

Field Documentation

◆ $attributes

sspmod_metarefresh_ARP::$attributes
private

Definition at line 17 of file ARP.php.

◆ $metadata

sspmod_metarefresh_ARP::$metadata
private

Definition at line 12 of file ARP.php.

Referenced by __construct(), and getXML().

◆ $prefix

sspmod_metarefresh_ARP::$prefix
private

Definition at line 22 of file ARP.php.

Referenced by __construct(), and surround().

◆ $suffix

sspmod_metarefresh_ARP::$suffix
private

Definition at line 27 of file ARP.php.

Referenced by __construct(), and surround().


The documentation for this class was generated from the following file: