ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
getconsent.php File Reference

Go to the source code of this file.

Namespaces

 SimpleSAMLphp
 Temporary autoloader to ensure compatibility with old, non-PSR-2 compliant classes.
 

Functions

 present_attributes ($t, $attributes, $nameParent)
 Recursive attribute array listing function. More...
 

Variables

 $globalConfig = SimpleSAML_Configuration::getInstance()
 
if(!array_key_exists('StateId', $_REQUEST)) $id = $_REQUEST['StateId']
 
 $state = SimpleSAML_Auth_State::loadState($id, 'consent:request')
 
if(array_key_exists('core:SP', $state)) else if(array_key_exists('saml:sp:State', $state)) else
 
if(array_key_exists('yes', $_REQUEST)) $attributes = $state['Attributes']
 
 $noconsentattributes = $state['consent:noconsentattributes']
 
foreach($attributes AS $attrkey=> $attrval) $para
 
 $t = new SimpleSAML_XHTML_Template($globalConfig, 'consent:consentform.php')
 
 $translator = $t->getTranslator()
 
$t data ['srcMetadata'] = $state['Source']
 
$t data ['dstMetadata'] = $state['Destination']
 
$t data ['yesTarget'] = SimpleSAML\Module::getModuleURL('consent/getconsent.php')
 
$t data ['yesData'] = array('StateId' => $id)
 
$t data ['noTarget'] = SimpleSAML\Module::getModuleURL('consent/noconsent.php')
 
$t data ['noData'] = array('StateId' => $id)
 
$t data ['attributes'] = $attributes
 
$t data ['checked'] = $state['consent:checked']
 
$t data ['stateId'] = $id
 
 $srcName = htmlspecialchars(is_array($srcName) ? $translator->t($srcName) : $srcName)
 
 $dstName = htmlspecialchars(is_array($dstName) ? $translator->t($dstName) : $dstName)
 
$t data ['consent_attributes_header']
 
$t data ['consent_accept']
 
if(array_key_exists('descr_purpose', $state['Destination'])) $t data ['srcName'] = $srcName
 
$t data ['dstName'] = $dstName
 
if($privacypolicy !==false) $t data ['sppp'] = $privacypolicy
 
$t data ['attributes_html'] = present_attributes($t, $attributes, '')
 

Function Documentation

◆ present_attributes()

present_attributes (   $t,
  $attributes,
  $nameParent 
)

Recursive attribute array listing function.

Parameters
\SimpleSAML\XHTML\Template$tTemplate object
array$attributesAttributes to be presented
string$nameParentName of parent element
Returns
string HTML representation of the attributes

Definition at line 216 of file getconsent.php.

References $attributes, $i, $name, $summary, $t, $translator, and SimpleSAML\Utils\Random\generateID().

Referenced by present_eptid().

217 {
218  $translator = $t->getTranslator();
219  $alternate = array('odd', 'even');
220  $i = 0;
221  $summary = 'summary="'.$translator->t('{consent:consent:table_summary}').'"';
222  if (strlen($nameParent) > 0) {
223  $parentStr = strtolower($nameParent).'_';
224  $str = '<table class="attributes" '.$summary.'>';
225  } else {
226  $parentStr = '';
227  $str = '<table id="table_with_attributes" class="attributes" '.$summary.'>';
228  $str .= "\n".'<caption>'.$translator->t('{consent:consent:table_caption}').'</caption>';
229  }
230  foreach ($attributes as $name => $value) {
231  $nameraw = $name;
232  $name = $translator->getAttributeTranslation($parentStr.$nameraw);
233  if (preg_match('/^child_/', $nameraw)) {
234  // insert child table
235  $parentName = preg_replace('/^child_/', '', $nameraw);
236  foreach ($value as $child) {
237  $str .= "\n".'<tr class="odd"><td class="td_odd">'.
238  present_attributes($t, $child, $parentName).'</td></tr>';
239  }
240  } else {
241  // insert values directly
242  $str .= "\n".'<tr class="'.$alternate[($i++ % 2)].
243  '"><td><span class="attrname">'.htmlspecialchars($name).'</span>';
244  $isHidden = in_array($nameraw, $t->data['hiddenAttributes'], true);
245  if ($isHidden) {
247  $str .= '<div class="attrvalue hidden" id="hidden_'.$hiddenId.'">';
248  } else {
249  $str .= '<div class="attrvalue">';
250  }
251  if (sizeof($value) > 1) {
252  // we hawe several values
253  $str .= '<ul>';
254  foreach ($value as $listitem) {
255  if ($nameraw === 'jpegPhoto') {
256  $str .= '<li><img src="data:image/jpeg;base64,'.
257  htmlspecialchars($listitem).'" alt="User photo" /></li>';
258  } else {
259  $str .= '<li>'.htmlspecialchars($listitem).'</li>';
260  }
261  }
262  $str .= '</ul>';
263  } elseif (isset($value[0])) {
264  // we hawe only one value
265  if ($nameraw === 'jpegPhoto') {
266  $str .= '<img src="data:image/jpeg;base64,'.
267  htmlspecialchars($value[0]).'" alt="User photo" />';
268  } else {
269  $str .= htmlspecialchars($value[0]);
270  }
271  } // end of if multivalue
272  $str .= '</div>';
273  if ($isHidden) {
274  $str .= '<div class="attrvalue consent_showattribute" id="visible_'.$hiddenId.'">';
275  $str .= '... ';
276  $str .= '<a class="consent_showattributelink" href="javascript:SimpleSAML_show(\'hidden_'.$hiddenId;
277  $str .= '\'); SimpleSAML_hide(\'visible_'.$hiddenId.'\');">';
278  $str .= $t->t('{consent:consent:show_attribute}');
279  $str .= '</a>';
280  $str .= '</div>';
281  }
282  $str .= '</td></tr>';
283  } // end else: not child table
284  } // end foreach
285  $str .= isset($attributes) ? '</table>' : '';
286  return $str;
287 }
static generateID()
Generate a random identifier, ID_LENGTH bytes long.
Definition: Random.php:26
$t
Definition: getconsent.php:118
present_attributes($t, $attributes, $nameParent)
Recursive attribute array listing function.
Definition: getconsent.php:216
$summary
Definition: cron.php:24
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85
$i
Definition: disco.tpl.php:19
$translator
Definition: getconsent.php:119
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ $attributes

if (array_key_exists( 'yes', $_REQUEST)) $attributes = $state['Attributes']

Definition at line 85 of file getconsent.php.

Referenced by sspmod_exampleauth_Auth_Source_UserPass\__construct(), sspmod_authcrypt_Auth_Source_Hash\__construct(), SAML2\AttributeQuery\__construct(), soapval\__construct(), phpseclib\File\X509\_extensions(), ilExternalFeed\_getRSSLocation(), phpseclib\Net\SFTP\_list(), phpseclib\File\X509\_mapInAttributes(), phpseclib\File\X509\_mapOutAttributes(), SimpleSAML_Metadata_SAMLBuilder\addAttributeConsumingService(), ilNestedSetXML\addDomNode(), HTMLPurifier_HTMLDefinition\addElement(), ilMediaAliasItem\addMapArea(), pdoDB\addTableColumn(), ilUserDefinedFields\addToXML(), ilPCInteractiveImage\addTriggerArea(), ilPCInteractiveImage\addTriggerMarker(), sspmod_authX509_Auth_Source_X509userCert\authenticate(), sspmod_exampleauth_Auth_Source_External\authenticate(), sspmod_core_Auth_UserPassBase\authenticate(), sspmod_saml_IdP_SAML2\buildAssertion(), sspmod_cas_Auth_Source_CAS\casServiceValidate(), sspmod_statistics_AccessCheck\checkAccess(), HTMLPurifier_Injector\checkNeeded(), ilECSMappingSettingsGUI\cInitMappingForm(), ilECSMappingSettingsGUI\cUpdateSettings(), SAML2\Assertion\decryptAttributes(), PhpOffice\PhpSpreadsheet\Reader\Gnumeric\Properties\docPropertiesMeta(), ilBPMN2ParserUtils\extractDataNamingFromElement(), ilTestResultsImportParser\fetchAttribute(), GeSHi\finalise(), sspmod_authwindowslive_Auth_Source_LiveID\finalStep(), sspmod_authtwitter_Auth_Source_Twitter\finalStep(), sspmod_authfacebook_Auth_Source_Facebook\finalStep(), sspmod_cas_Auth_Source_CAS\finalStep(), ilBiblLibraryPresentationGUI\formatAttribute(), ilUtil\formSelect(), SimpleSAML\XML\Shib13\AuthnResponse\generate(), ilBiblLibraryPresentationGUI\generateLibraryLink(), sspmod_saml_IdP_SAML2\generateNameIdValue(), sspmod_adfs_IdP_ADFS\generateResponse(), ilLDAPRoleAssignmentRules\getAdditionalPluginAttributes(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\Chart\getAttribute(), phpseclib\File\X509\getAttribute(), sspmod_consent_Auth_Process_Consent\getAttributeHash(), SAML2\AttributeQuery\getAttributes(), SimpleSAML_Auth_LDAP\getAttributes(), SAML2\Assertion\getAttributes(), phpseclib\File\X509\getAttributes(), ilBiblAttributeFactory\getAttributesForEntry(), ilLDAPResult\getEntries(), SimpleSAML\Utils\Attributes\getExpectedAttribute(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\getFromZipArchive(), sspmod_ldap_Auth_Process_AttributeAddUsersGroups\getGroups(), sspmod_ldap_Auth_Process_AttributeAddUsersGroups\getGroupsActiveDirectory(), sspmod_ldap_Auth_Process_AttributeAddUsersGroups\getGroupsOpenLdap(), SimpleSAML\XML\Shib13\AuthnResponse\getSessionIndex(), sspmod_exampleauth_Auth_Source_External\getUser(), sspmod_authYubiKey_Auth_Source_YubiKey\handleLogin(), sspmod_core_Auth_UserPassOrgBase\handleLogin(), sspmod_core_Auth_UserPassBase\handleLogin(), GeSHi\header(), arFieldList\initFields(), ilECSMappingSettingsGUI\initFormCSettings(), kses(), ilLMPresentationGUI\layout(), sspmod_radius_Auth_Source_Radius\login(), sspmod_authYubiKey_Auth_Source_YubiKey\login(), ilECSCourseMappingRule\lookupLastExistingAttribute(), SimpleSAML\Utils\Attributes\normalizeAttributesArray(), sspmod_core_ACL\opAnd(), sspmod_core_ACL\opEquals(), sspmod_core_ACL\opEqualsPreg(), sspmod_core_ACL\opHas(), sspmod_core_ACL\opHasPreg(), sspmod_core_ACL\opOr(), GeSHi\parse_code(), GeSHi\parse_non_string_part(), Sabre\Xml\Reader\parseAttributes(), SimpleSAML_Utilities\parseAttributes(), SAML2\Assertion\parseAttributes(), Sabre\Xml\Reader\parseCurrentElement(), HTMLPurifier_HTMLDefinition\parseTinyMCEAllowedList(), ilTestExportRandomQuestionSet\populateSelectionDefinitions(), present_attributes(), present_eptid(), sspmod_ldap_Auth_Process_AttributeAddUsersGroups\process(), sspmod_core_Auth_Process_AttributeRealm\process(), sspmod_core_Auth_Process_LanguageAdaptor\process(), sspmod_core_Auth_Process_PHP\process(), sspmod_core_Auth_Process_ScopeFromAttribute\process(), sspmod_authYubiKey_Auth_Process_OTP2YubiPrefix\process(), sspmod_core_Auth_Process_GenerateGroups\process(), sspmod_core_Auth_Process_AttributeCopy\process(), sspmod_core_Auth_Process_ScopeAttribute\process(), sspmod_authorize_Auth_Process_Authorize\process(), sspmod_core_Auth_Process_AttributeLimit\process(), sspmod_core_Auth_Process_AttributeAlter\process(), SimpleSAML\Module\core\Auth\Process\AttributeValueMap\process(), sspmod_ldap_Auth_Process_AttributeAddFromLDAP\process(), sspmod_consent_Auth_Process_Consent\process(), sspmod_saml_Message\processAssertion(), PhpOffice\PhpSpreadsheet\Reader\Gnumeric\processAutofilter(), ilLMPresentationGUI\processNodes(), phpseclib\File\X509\removeAttribute(), ilBiblEntryTablePresentationGUI\render(), ilBiblEntryDetailPresentationGUI\renderAttributes(), ilMMTopItemGUI\restore(), sspmod_exampleauth_Auth_Source_External\resume(), arConverter\returnAttributesForField(), sspmod_ldap_Auth_Process_AttributeAddUsersGroups\search(), SimpleSAML_Auth_LDAP\searchformultiple(), sspmod_saml_IdP_SAML1\sendResponse(), sspmod_adfs_IdP_ADFS\sendResponse(), nusoap_base\serialize_val(), ilMediaAliasItem\setAreaExtLink(), ilMediaAliasItem\setAreaIntLink(), phpseclib\File\X509\setAttribute(), SAML2\AttributeQuery\setAttributes(), CAS_Client\setAttributes(), SAML2\Assertion\setAttributes(), ilPCSection\setExtLink(), ilPCSection\setIntLink(), ilMediaAliasItem\setParameters(), SimpleSAML_Error_Error\show(), ilOrgUnitExporter\simpleExport(), ilOrgUnitSimpleImport\simpleImportElement(), ilOrgUnitSimpleUserImport\simpleUserImportElement(), soapval\soapval(), Sabre\Xml\Serializer\standardSerializer(), Monolog\Handler\AmqpHandlerTest\testHandleAmqpExt(), enshrined\svgSanitize\Tests\SanitizerTest\testLoadDefaultAttributes(), enshrined\svgSanitize\Tests\SanitizerTest\testSetCustomAttributes(), SimpleSAML_Auth_LDAP\validate(), and ilRoleXmlExport\writeRole().

◆ $dstName

$dstName = htmlspecialchars(is_array($dstName) ? $translator->t($dstName) : $dstName)

Definition at line 131 of file getconsent.php.

◆ $globalConfig

Definition at line 22 of file getconsent.php.

◆ $id

if (!array_key_exists( 'StateId', $_REQUEST)) $id = $_REQUEST['StateId']

Definition at line 32 of file getconsent.php.

◆ $noconsentattributes

$noconsentattributes = $state['consent:noconsentattributes']

Definition at line 86 of file getconsent.php.

◆ $para

foreach ( $attributes AS $attrkey=> $attrval) $para
Initial value:
= array(
'attributes' => &$attributes
)
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85

Definition at line 94 of file getconsent.php.

◆ $srcName

$srcName = htmlspecialchars(is_array($srcName) ? $translator->t($srcName) : $srcName)

Definition at line 130 of file getconsent.php.

◆ $state

$state = SimpleSAML_Auth_State::loadState($id, 'consent:request')

Definition at line 33 of file getconsent.php.

◆ $t

$t = new SimpleSAML_XHTML_Template($globalConfig, 'consent:consentform.php')

Definition at line 118 of file getconsent.php.

Referenced by present_attributes().

◆ $translator

◆ data [1/15]

$t data[ 'srcMetadata'] = $state['Source']

Definition at line 120 of file getconsent.php.

◆ data [2/15]

$t data[ 'dstMetadata'] = $state['Destination']

Definition at line 121 of file getconsent.php.

◆ data [3/15]

$t data[ 'yesTarget'] = SimpleSAML\Module::getModuleURL('consent/getconsent.php')

Definition at line 122 of file getconsent.php.

◆ data [4/15]

$t data[ 'yesData'] = array('StateId' => $id)

Definition at line 123 of file getconsent.php.

◆ data [5/15]

$t data[ 'noTarget'] = SimpleSAML\Module::getModuleURL('consent/noconsent.php')

Definition at line 124 of file getconsent.php.

◆ data [6/15]

$t data[ 'noData'] = array('StateId' => $id)

Definition at line 125 of file getconsent.php.

◆ data [7/15]

$t data[ 'attributes'] = $attributes

Definition at line 126 of file getconsent.php.

◆ data [8/15]

$t data[ 'checked'] = $state['consent:checked']

Definition at line 127 of file getconsent.php.

◆ data [9/15]

$t data[ 'stateId'] = $id

Definition at line 128 of file getconsent.php.

◆ data [10/15]

$t data[ 'consent_attributes_header']
Initial value:
'{consent:consent:consent_attributes_header}',
array('SPNAME' => $dstName, 'IDPNAME' => $srcName)
)
$dstName
Definition: getconsent.php:131
$srcName
Definition: getconsent.php:130
$translator
Definition: getconsent.php:119

Definition at line 133 of file getconsent.php.

◆ data [11/15]

$t data[ 'consent_accept']
Initial value:
'{consent:consent:consent_accept}',
array('SPNAME' => $dstName, 'IDPNAME' => $srcName)
)
$dstName
Definition: getconsent.php:131
$srcName
Definition: getconsent.php:130
$translator
Definition: getconsent.php:119

Definition at line 138 of file getconsent.php.

◆ data [12/15]

if (array_key_exists( 'descr_purpose', $state[ 'Destination'])) $t data[ 'srcName'] = $srcName

Definition at line 158 of file getconsent.php.

◆ data [13/15]

$t data[ 'dstName'] = $dstName

Definition at line 159 of file getconsent.php.

◆ data [14/15]

if ( $privacypolicy !==false) $t data[ 'sppp'] = $privacypolicy

Definition at line 176 of file getconsent.php.

◆ data [15/15]

$t data[ 'attributes_html'] = present_attributes($t, $attributes, '')

Definition at line 203 of file getconsent.php.

◆ else

if (array_key_exists( 'consent:hiddenAttributes', $state)) else
Initial value:
{
$spentityid = 'UNKNOWN'

Definition at line 39 of file getconsent.php.