17 assert(
'is_array($this->data["srcMetadata"])');
18 assert(
'is_array($this->data["dstMetadata"])');
19 assert(
'is_string($this->data["yesTarget"])');
20 assert(
'is_array($this->data["yesData"])');
21 assert(
'is_string($this->data["noTarget"])');
22 assert(
'is_array($this->data["noData"])');
23 assert(
'is_array($this->data["attributes"])');
24 assert(
'is_array($this->data["hiddenAttributes"])');
25 assert(
'$this->data["sppp"] === false || is_string($this->data["sppp"])');
28 if (array_key_exists(
'name', $this->
data[
'srcMetadata'])) {
30 } elseif (array_key_exists(
'OrganizationDisplayName', $this->
data[
'srcMetadata'])) {
31 $srcName = $this->
data[
'srcMetadata'][
'OrganizationDisplayName'];
40 if (array_key_exists(
'name', $this->
data[
'dstMetadata'])) {
42 } elseif (array_key_exists(
'OrganizationDisplayName', $this->
data[
'dstMetadata'])) {
43 $dstName = $this->
data[
'dstMetadata'][
'OrganizationDisplayName'];
57 $this->
data[
'header'] = $this->t(
'{consent:consent:consent_header}');
58 $this->
data[
'head'] =
'<link rel="stylesheet" type="text/css" href="/' .
59 $this->
data[
'baseurlpath'] .
'module.php/consent/style.css" />' .
"\n";
61 $this->includeAtTemplateBase(
'includes/header.php');
66 '{consent:consent:consent_accept}',
70 if (array_key_exists(
'descr_purpose', $this->
data[
'dstMetadata'])) {
71 echo
'</p><p>' . $this->t(
72 '{consent:consent:consent_purpose}',
75 'SPDESC' => $this->getTranslator()->getPreferredTranslation(
77 $this->
data[
'dstMetadata'][
'descr_purpose'],
87 <form
style=
"display: inline; margin: 0px; padding: 0px" 88 action=
"<?php echo htmlspecialchars($this->data['yesTarget']); ?>">
89 <p style=
"margin: 1em">
92 if ($this->
data[
'usestorage']) {
93 $checked = ($this->
data[
'checked'] ?
'checked="checked"' :
'');
94 echo
'<input type="checkbox" name="saveconsent" ' . $checked .
95 ' value="1" /> ' . $this->t(
'{consent:consent:remember}');
99 foreach ($this->
data[
'yesData'] as
$name => $value) {
100 echo
'<input type="hidden" name="' . htmlspecialchars(
$name) .
101 '" value="' . htmlspecialchars($value) .
'" />';
105 <button type=
"submit" name=
"yes" class=
"btn" id=
"yesbutton">
106 <?php echo htmlspecialchars($this->t(
'{consent:consent:yes}')) ?>
110 <form style=
"display: inline; margin-left: .5em;" action=
"<?php echo htmlspecialchars($this->data['noTarget']); ?>" 114 foreach ($this->
data[
'noData'] as
$name => $value) {
115 echo(
'<input type="hidden" name="' . htmlspecialchars(
$name) .
116 '" value="' . htmlspecialchars($value) .
'" />');
119 <button type=
"submit" class=
"btn" name=
"no" id=
"nobutton">
120 <?php echo htmlspecialchars($this->t(
'{consent:consent:no}')) ?>
125 if ($this->
data[
'sppp'] !==
false) {
126 echo
"<p>" . htmlspecialchars($this->t(
'{consent:consent:consent_privacypolicy}')) .
" ";
127 echo
'<a target="_blank" href="' . htmlspecialchars($this->
data[
'sppp']) .
'">' .
$dstName .
"</a>";
144 $alternate =
array(
'odd',
'even');
146 $summary =
'summary="' .
$t->t(
'{consent:consent:table_summary}') .
'"';
148 if (strlen($nameParent) > 0) {
149 $parentStr = strtolower($nameParent) .
'_';
150 $str =
'<table class="attributes" ' .
$summary .
'>';
153 $str =
'<table id="table_with_attributes" class="attributes" '.
$summary .
'>';
154 $str .=
"\n" .
'<caption>' .
$t->t(
'{consent:consent:table_caption}') .
162 if (preg_match(
'/^child_/', $nameraw)) {
164 $parentName = preg_replace(
'/^child_/',
'', $nameraw);
165 foreach ($value as $child) {
166 $str .=
"\n" .
'<tr class="odd"><td style="padding: 2em">' .
167 present_attributes(
$t, $child, $parentName) .
'</td></tr>';
172 $str .=
"\n" .
'<tr class="' . $alternate[(
$i++ % 2)] .
173 '"><td><span class="attrname">' . htmlspecialchars(
$name) .
'</span>';
175 $isHidden = in_array($nameraw,
$t->data[
'hiddenAttributes'],
true);
179 $str .=
'<div class="attrvalue" style="display: none;" id="hidden_' . $hiddenId .
'">';
181 $str .=
'<div class="attrvalue">';
184 if (
sizeof($value) > 1) {
187 foreach ($value as $listitem) {
188 if ($nameraw ===
'jpegPhoto') {
189 $str .=
'<li><img src="data:image/jpeg;base64,' .
190 htmlspecialchars($listitem) .
191 '" alt="User photo" /></li>';
193 $str .=
'<li>' . htmlspecialchars($listitem) .
'</li>';
197 } elseif (isset($value[0])) {
199 if ($nameraw ===
'jpegPhoto') {
200 $str .=
'<img src="data:image/jpeg;base64,' .
201 htmlspecialchars($value[0]) .
202 '" alt="User photo" />';
204 $str .= htmlspecialchars($value[0]);
210 $str .=
'<div class="attrvalue consent_showattribute" id="visible_' . $hiddenId .
'">';
212 $str .=
'<a class="consent_showattributelink" href="javascript:SimpleSAML_show(\'hidden_' . $hiddenId;
213 $str .=
'\'); SimpleSAML_hide(\
'visible_' . $hiddenId .
'\');
">'; 214 $str .= $t->t('{consent:consent:show_attribute}'); 219 $str .= '</td></tr>'; 220 } // end else: not child table 222 $str .= isset($attributes)? '</table>':''; 226 echo '<h3 id="attributeheader
">' . 228 '{consent:consent:consent_attributes_header}', 229 array( 'SPNAME' => $dstName, 'IDPNAME' => $srcName) 233 echo present_attributes($this, $attributes, ''); 235 $this->includeAtTemplateBase('includes/footer.php'); static generateID()
Generate a random identifier, ID_LENGTH bytes long.
Attribute-related utility methods.
Create styles array
The data for the language used.