Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
0d5c9ba8
Commit
0d5c9ba8
authored
9 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Reformat and enhance the consent form page.
parent
c65e767e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/consent/templates/consentform.php
+23
-17
23 additions, 17 deletions
modules/consent/templates/consentform.php
with
23 additions
and
17 deletions
modules/consent/templates/consentform.php
+
23
−
17
View file @
0d5c9ba8
...
...
@@ -12,7 +12,7 @@
* - 'attributes': The attributes which are about to be released.
* - 'sppp': URL to the privacy policy of the destination, or FALSE.
*
* @package
s
impleSAMLphp
* @package
S
impleSAMLphp
*/
assert
(
'is_array($this->data["srcMetadata"])'
);
assert
(
'is_array($this->data["dstMetadata"])'
);
...
...
@@ -60,7 +60,6 @@ $this->data['head'] = '<link rel="stylesheet" type="text/css" href="/' .
$this
->
includeAtTemplateBase
(
'includes/header.php'
);
?>
<p>
<?php
echo
$this
->
t
(
...
...
@@ -70,7 +69,7 @@ echo $this->t(
if
(
array_key_exists
(
'descr_purpose'
,
$this
->
data
[
'dstMetadata'
]))
{
echo
'</p><p>'
.
$this
->
t
(
'{consent:consent:consent_purpose}'
,
'{consent:consent:consent_purpose}'
,
array
(
'SPNAME'
=>
$dstName
,
'SPDESC'
=>
$this
->
getTranslation
(
...
...
@@ -85,7 +84,8 @@ if (array_key_exists('descr_purpose', $this->data['dstMetadata'])) {
?>
</p>
<form
style=
"display: inline; margin: 0px; padding: 0px"
action=
"
<?php
echo
htmlspecialchars
(
$this
->
data
[
'yesTarget'
]);
?>
"
>
<form
style=
"display: inline; margin: 0px; padding: 0px"
action=
"
<?php
echo
htmlspecialchars
(
$this
->
data
[
'yesTarget'
]);
?>
"
>
<p
style=
"margin: 1em"
>
<?php
...
...
@@ -102,10 +102,13 @@ foreach ($this->data['yesData'] as $name => $value) {
}
?>
</p>
<input
type=
"submit"
name=
"yes"
id=
"yesbutton"
value=
"
<?php
echo
htmlspecialchars
(
$this
->
t
(
'{consent:consent:yes}'
))
?>
"
/>
<button
type=
"submit"
name=
"yes"
class=
"btn"
id=
"yesbutton"
>
<?php
echo
htmlspecialchars
(
$this
->
t
(
'{consent:consent:yes}'
))
?>
</button>
</form>
<form
style=
"display: inline; margin-left: .5em;"
action=
"
<?php
echo
htmlspecialchars
(
$this
->
data
[
'noTarget'
]);
?>
"
method=
"get"
>
<form
style=
"display: inline; margin-left: .5em;"
action=
"
<?php
echo
htmlspecialchars
(
$this
->
data
[
'noTarget'
]);
?>
"
method=
"get"
>
<?php
foreach
(
$this
->
data
[
'noData'
]
as
$name
=>
$value
)
{
...
...
@@ -113,7 +116,9 @@ foreach ($this->data['noData'] as $name => $value) {
'" value="'
.
htmlspecialchars
(
$value
)
.
'" />'
);
}
?>
<input
type=
"submit"
style=
"display: inline"
name=
"no"
id=
"nobutton"
value=
"
<?php
echo
htmlspecialchars
(
$this
->
t
(
'{consent:consent:no}'
))
?>
"
/>
<button
type=
"submit"
class=
"btn"
name=
"no"
id=
"nobutton"
>
<?php
echo
htmlspecialchars
(
$this
->
t
(
'{consent:consent:no}'
))
?>
</button>
</form>
<?php
...
...
@@ -124,7 +129,7 @@ if ($this->data['sppp'] !== false) {
}
/**
* Recursiv attribute array listing function
* Recursiv
e
attribute array listing function
*
* @param SimpleSAML_XHTML_Template $t Template object
* @param array $attributes Attributes to be presented
...
...
@@ -153,14 +158,14 @@ function present_attributes($t, $attributes, $nameParent)
$name
=
$t
->
getAttributeTranslation
(
$parentStr
.
$nameraw
);
if
(
preg_match
(
'/^child_/'
,
$nameraw
))
{
//
I
nsert child table
//
i
nsert child table
$parentName
=
preg_replace
(
'/^child_/'
,
''
,
$nameraw
);
foreach
(
$value
AS
$child
)
{
foreach
(
$value
as
$child
)
{
$str
.
=
"
\n
"
.
'<tr class="odd"><td style="padding: 2em">'
.
present_attributes
(
$t
,
$child
,
$parentName
)
.
'</td></tr>'
;
}
}
else
{
//
I
nsert values directly
//
i
nsert values directly
$str
.
=
"
\n
"
.
'<tr class="'
.
$alternate
[(
$i
++
%
2
)]
.
'"><td><span class="attrname">'
.
htmlspecialchars
(
$name
)
.
'</span>'
;
...
...
@@ -175,9 +180,9 @@ function present_attributes($t, $attributes, $nameParent)
}
if
(
sizeof
(
$value
)
>
1
)
{
//
W
e hawe several values
//
w
e hawe several values
$str
.
=
'<ul>'
;
foreach
(
$value
AS
$listitem
)
{
foreach
(
$value
as
$listitem
)
{
if
(
$nameraw
===
'jpegPhoto'
)
{
$str
.
=
'<li><img src="data:image/jpeg;base64,'
.
htmlspecialchars
(
$listitem
)
.
...
...
@@ -188,7 +193,7 @@ function present_attributes($t, $attributes, $nameParent)
}
$str
.
=
'</ul>'
;
}
elseif
(
isset
(
$value
[
0
]))
{
//
W
e hawe only one value
//
w
e hawe only one value
if
(
$nameraw
===
'jpegPhoto'
)
{
$str
.
=
'<img src="data:image/jpeg;base64,'
.
htmlspecialchars
(
$value
[
0
])
.
...
...
@@ -196,13 +201,14 @@ function present_attributes($t, $attributes, $nameParent)
}
else
{
$str
.
=
htmlspecialchars
(
$value
[
0
]);
}
}
// end of if multivalue
}
// end of if multivalue
$str
.
=
'</div>'
;
if
(
$isHidden
)
{
$str
.
=
'<div class="attrvalue consent_showattribute" id="visible_'
.
$hiddenId
.
'">'
;
$str
.
=
'... '
;
$str
.
=
'<a class="consent_showattributelink" href="javascript:SimpleSAML_show(\'hidden_'
.
$hiddenId
.
'\'); SimpleSAML_hide(\'visible_'
.
$hiddenId
.
'\');">'
;
$str
.
=
'<a class="consent_showattributelink" href="javascript:SimpleSAML_show(\'hidden_'
.
$hiddenId
;
$str
.
=
'\'); SimpleSAML_hide(\'visible_'
.
$hiddenId
.
'\');">'
;
$str
.
=
$t
->
t
(
'{consent:consent:show_attribute}'
);
$str
.
=
'</a>'
;
$str
.
=
'</div>'
;
...
...
@@ -222,6 +228,6 @@ echo '<h3 id="attributeheader">' .
)
.
'</h3>'
;
echo
(
present_attributes
(
$this
,
$attributes
,
''
)
);
echo
present_attributes
(
$this
,
$attributes
,
''
)
;
$this
->
includeAtTemplateBase
(
'includes/footer.php'
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment