Skip to content
Snippets Groups Projects
Commit 7fd819a6 authored by Olav Morken's avatar Olav Morken
Browse files

Consent: Add support for returning to consent page after answering "no".

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@800 44740490-163a-0410-bde0-09ae8108e29a
parent cde830e4
Branches
Tags
No related merge requests found
...@@ -189,6 +189,9 @@ $lang = array( ...@@ -189,6 +189,9 @@ $lang = array(
'hr' => 'Niste dali pristanak da se vaši podaci isporuče davatelju usluge.', 'hr' => 'Niste dali pristanak da se vaši podaci isporuče davatelju usluge.',
'hu' => 'Nem adta belegyezését, ahoz hogy adatait kiszlgálatassuk a szolgáltató felé.', 'hu' => 'Nem adta belegyezését, ahoz hogy adatait kiszlgálatassuk a szolgáltató felé.',
), ),
'noconsent_return' => array (
'en' => 'Return to consent page',
),
); );
......
...@@ -28,9 +28,10 @@ ...@@ -28,9 +28,10 @@
</form> </form>
<form style="display: inline; margin-left: .5em;" action="<?php echo htmlspecialchars($this->data['noconsent']); ?>" method="GET"> <form style="display: inline; margin-left: .5em;" action="<?php echo htmlspecialchars($this->data['noconsent']); ?>" method="GET">
<?php <?php
if(array_key_exists('sptype', $this->data) && array_key_exists('spentityid', $this->data)) { if(array_key_exists('noconsent_data', $this->data)) {
echo('<input type="hidden" name="sptype" value="' . htmlspecialchars($this->data['sptype']) . '" />'); foreach($this->data['noconsent_data'] as $name => $value) {
echo('<input type="hidden" name="spentityid" value="' . htmlspecialchars($this->data['spentityid']) . '" />'); echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />');
}
} }
?> ?>
<input type="submit" id="nobutton" value="<?php echo htmlspecialchars($this->t('no')) ?>" /> <input type="submit" id="nobutton" value="<?php echo htmlspecialchars($this->t('no')) ?>" />
......
...@@ -10,4 +10,12 @@ ...@@ -10,4 +10,12 @@
<h2><?php echo($this->data['header']); ?></h2> <h2><?php echo($this->data['header']); ?></h2>
<p><?php echo($this->t('{consent:noconsent_text}')); ?></p> <p><?php echo($this->t('{consent:noconsent_text}')); ?></p>
<?php
if($this->data['resumeFrom']) {
echo('<p><a href="' . htmlspecialchars($this->data['resumeFrom']) . '">');
echo($this->t('{consent:noconsent_return}'));
echo('</a></p>');
}
?>
<?php $this->includeAtTemplateBase('includes/footer.php'); ?> <?php $this->includeAtTemplateBase('includes/footer.php'); ?>
\ No newline at end of file
...@@ -14,6 +14,9 @@ $session = SimpleSAML_Session::getInstance(); ...@@ -14,6 +14,9 @@ $session = SimpleSAML_Session::getInstance();
$t = new SimpleSAML_XHTML_Template($config, 'noconsent.php'); $t = new SimpleSAML_XHTML_Template($config, 'noconsent.php');
$t->data['spmetadata'] = $spmetadata; $t->data['spmetadata'] = $spmetadata;
if(array_key_exists('resumeFrom', $_REQUEST)) {
$t->data['resumeFrom'] = $_REQUEST['resumeFrom'];
}
$t->show(); $t->show();
?> ?>
\ No newline at end of file
...@@ -276,7 +276,6 @@ if($needAuth && !$isPassive) { ...@@ -276,7 +276,6 @@ if($needAuth && !$isPassive) {
$t->data['header'] = 'Consent'; $t->data['header'] = 'Consent';
$t->data['sp_name'] = $sp_name; $t->data['sp_name'] = $sp_name;
$t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid); $t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid);
$t->data['sptype'] = 'saml20-sp-remote';
$t->data['spentityid'] = $spentityid; $t->data['spentityid'] = $spentityid;
$t->data['spmetadata'] = $spmetadata; $t->data['spmetadata'] = $spmetadata;
$t->data['attributes'] = $filteredattributes; $t->data['attributes'] = $filteredattributes;
...@@ -285,6 +284,11 @@ if($needAuth && !$isPassive) { ...@@ -285,6 +284,11 @@ if($needAuth && !$isPassive) {
$t->data['consent_cookie'] = $requestcache['ConsentCookie']; $t->data['consent_cookie'] = $requestcache['ConsentCookie'];
$t->data['usestorage'] = $consent->useStorage(); $t->data['usestorage'] = $consent->useStorage();
$t->data['noconsent'] = '/' . $config->getBaseURL() . 'noconsent.php'; $t->data['noconsent'] = '/' . $config->getBaseURL() . 'noconsent.php';
$t->data['noconsent_data'] = array(
'sptype' => 'saml20-sp-remote',
'spentityid' => $spentityid,
'resumeFrom' => SimpleSAML_Utilities::selfURL(),
);
if (array_key_exists('privacypolicy', $spmetadata)) { if (array_key_exists('privacypolicy', $spmetadata)) {
$privacypolicy = $spmetadata['privacypolicy']; $privacypolicy = $spmetadata['privacypolicy'];
......
...@@ -189,7 +189,6 @@ if (!$session->isAuthenticated($authority) ) { ...@@ -189,7 +189,6 @@ if (!$session->isAuthenticated($authority) ) {
$t->data['header'] = 'Consent'; $t->data['header'] = 'Consent';
$t->data['sp_name'] = $sp_name; $t->data['sp_name'] = $sp_name;
$t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid); $t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid);
$t->data['sptype'] = 'shib13-sp-remote';
$t->data['spentityid'] = $spentityid; $t->data['spentityid'] = $spentityid;
$t->data['spmetadata'] = $spmetadata; $t->data['spmetadata'] = $spmetadata;
$t->data['attributes'] = $filteredattributes; $t->data['attributes'] = $filteredattributes;
...@@ -198,6 +197,11 @@ if (!$session->isAuthenticated($authority) ) { ...@@ -198,6 +197,11 @@ if (!$session->isAuthenticated($authority) ) {
$t->data['consent_cookie'] = $requestcache['ConsentCookie']; $t->data['consent_cookie'] = $requestcache['ConsentCookie'];
$t->data['usestorage'] = $consent->useStorage(); $t->data['usestorage'] = $consent->useStorage();
$t->data['noconsent'] = '/' . $config->getBaseURL() . 'noconsent.php'; $t->data['noconsent'] = '/' . $config->getBaseURL() . 'noconsent.php';
$t->data['noconsent_data'] = array(
'sptype' => 'shib13-sp-remote',
'spentityid' => $spentityid,
'resumeFrom' => SimpleSAML_Utilities::selfURL(),
);
if (array_key_exists('privacypolicy', $spmetadata)) { if (array_key_exists('privacypolicy', $spmetadata)) {
$privacypolicy = $spmetadata['privacypolicy']; $privacypolicy = $spmetadata['privacypolicy'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment