20session_cache_limiter(
'nocache');
 
   26if (!array_key_exists(
'StateId', $_REQUEST)) {
 
   28        'Missing required StateId query parameter.' 
   32$id = $_REQUEST[
'StateId'];
 
   35if (array_key_exists(
'core:SP', 
$state)) {
 
   36    $spentityid = 
$state[
'core:SP'];
 
   37} 
else if (array_key_exists(
'saml:sp:State', 
$state)) {
 
   38    $spentityid = 
$state[
'saml:sp:State'][
'core:SP'];
 
   40    $spentityid = 
'UNKNOWN';
 
   45if (array_key_exists(
'yes', $_REQUEST)) {
 
   46    if (array_key_exists(
'saveconsent', $_REQUEST)) {
 
   53        'remember' => array_key_exists(
'saveconsent', $_REQUEST),
 
   55    if (isset(
$state[
'Destination'][
'entityid'])) {
 
   60    if (   array_key_exists(
'consent:store', 
$state) 
 
   61        && array_key_exists(
'saveconsent', $_REQUEST)
 
   62        && $_REQUEST[
'saveconsent'] === 
'1' 
   66        $userId = 
$state[
'consent:store.userId'];
 
   67        $targetedId = 
$state[
'consent:store.destination'];
 
   68        $attributeSet = 
$state[
'consent:store.attributeSet'];
 
   71            'Consent - saveConsent() : [' . $userId . 
'|' .
 
   72            $targetedId . 
'|' .  $attributeSet . 
']' 
   75            $store->saveConsent($userId, $targetedId, $attributeSet);
 
   76        } 
catch (Exception $e) {
 
  102if (array_key_exists(
'name', 
$state[
'Source'])) {
 
  104} elseif (array_key_exists(
'OrganizationDisplayName', 
$state[
'Source'])) {
 
  109if (array_key_exists(
'name', 
$state[
'Destination'])) {
 
  111} elseif (array_key_exists(
'OrganizationDisplayName', 
$state[
'Destination'])) {
 
  123$t->data[
'yesData'] = array(
'StateId' => 
$id);
 
  125$t->data[
'noData'] = array(
'StateId' => 
$id);
 
  134    '{consent:consent:consent_attributes_header}',
 
  139    '{consent:consent:consent_accept}',
 
  143if (array_key_exists(
'descr_purpose', 
$state[
'Destination'])) {
 
  145        '{consent:consent:consent_purpose}',
 
  150                    $state[
'Destination'][
'descr_purpose'],
 
  162if (array_key_exists(
'privacypolicy', 
$state[
'Destination'])) {
 
  163    $privacypolicy = 
$state[
'Destination'][
'privacypolicy'];
 
  164} elseif (array_key_exists(
'privacypolicy', 
$state[
'Source'])) {
 
  165    $privacypolicy = 
$state[
'Source'][
'privacypolicy'];
 
  167    $privacypolicy = 
false;
 
  169if ($privacypolicy !== 
false) {
 
  170    $privacypolicy = str_replace(
 
  172        urlencode($spentityid), 
 
  176$t->data[
'sppp'] = $privacypolicy;
 
  179switch (
$state[
'consent:focus']) {
 
  181    $t->data[
'autofocus'] = 
'yesbutton';
 
  184    $t->data[
'autofocus'] = 
'nobutton';
 
  191if (array_key_exists(
'consent:store', 
$state)) {
 
  192    $t->data[
'usestorage'] = 
true;
 
  194    $t->data[
'usestorage'] = 
false;
 
  197if (array_key_exists(
'consent:hiddenAttributes', 
$state)) {
 
  198    $t->data[
'hiddenAttributes'] = 
$state[
'consent:hiddenAttributes'];
 
  200    $t->data[
'hiddenAttributes'] = array();
 
  219    $alternate = array(
'odd', 
'even');
 
  221    $summary = 
'summary="'.$translator->t(
'{consent:consent:table_summary}').
'"';
 
  222    if (strlen($nameParent) > 0) {
 
  223        $parentStr = strtolower($nameParent).
'_';
 
  224        $str = 
'<table class="attributes" '.$summary.
'>';
 
  227        $str = 
'<table id="table_with_attributes"  class="attributes" '.$summary.
'>';
 
  228        $str .= 
"\n".
'<caption>'.
$translator->t(
'{consent:consent:table_caption}').
'</caption>';
 
  233        if (preg_match(
'/^child_/', $nameraw)) {
 
  235            $parentName = preg_replace(
'/^child_/', 
'', $nameraw);
 
  236            foreach ($value as $child) {
 
  237                $str .= 
"\n".
'<tr class="odd"><td class="td_odd">'.
 
  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);
 
  247                $str .= 
'<div class="attrvalue hidden" id="hidden_'.$hiddenId.
'">';
 
  249                $str .= 
'<div class="attrvalue">';
 
  251            if (
sizeof($value) > 1) {
 
  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>';
 
  259                        $str .= 
'<li>'.htmlspecialchars($listitem).
'</li>';
 
  263            } elseif (isset($value[0])) {
 
  265                if ($nameraw === 
'jpegPhoto') {
 
  266                    $str .= 
'<img src="data:image/jpeg;base64,'.
 
  267                        htmlspecialchars($value[0]).
'" alt="User photo" />';
 
  269                    $str .= htmlspecialchars($value[0]);
 
  274                $str .= 
'<div class="attrvalue consent_showattribute" id="visible_'.$hiddenId.
'">';
 
  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}'); 
  282            $str .= '</td></tr>'; 
  283        }       // end else: not child table 
  285    $str .= isset($attributes) ? '</table>' : ''; 
An exception for terminatinating execution or to throw for unit testing.
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
static generateID()
Generate a random identifier, ID_LENGTH bytes long.
static resumeProcessing($state)
Continues processing of the state.
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
static log($event, array $data=array())
Notify about an event.
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
if(!array_key_exists('StateId', $_REQUEST)) $id
present_attributes($t, $attributes, $nameParent)
Recursive attribute array listing function.
foreach($attributes AS $attrkey=> $attrval) $para
if(array_key_exists('yes', $_REQUEST)) $attributes
Attribute-related utility methods.
if(!isset($state['consent:showNoConsentAboutService'])|| $state['consent:showNoConsentAboutService']) $statsInfo