From fc28a048c3c604b5b352993f476ee8d39244b1da Mon Sep 17 00:00:00 2001
From: Anders Lund <anders.lund@uninett.no>
Date: Mon, 26 Jan 2009 10:14:31 +0000
Subject: [PATCH] Small modification to not show info about purpose when no
 purpose is given.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1184 44740490-163a-0410-bde0-09ae8108e29a
---
 .../consent/templates/default/consentform.php    | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/modules/consent/templates/default/consentform.php b/modules/consent/templates/default/consentform.php
index c5c0b736c..12eaeb004 100644
--- a/modules/consent/templates/default/consentform.php
+++ b/modules/consent/templates/default/consentform.php
@@ -46,7 +46,6 @@ if (array_key_exists('name', $this->data['dstMetadata'])) {
 	$dstName = $this->data['dstMetadata']['entityid'];
 }
 
-$spPurpose = 'unspecified';
 if (array_key_exists('descr_purpose', $this->data['dstMetadata'])) {
 	$spPurpose = $this->data['dstMetadata']['descr_purpose'];
 	if (is_array($spPurpose)) {
@@ -99,11 +98,16 @@ $this->includeAtTemplateBase('includes/header.php');
 ?>
 
 <p>
-<?php echo $this->t('{consent:consent_accept}', array(
-	'IDPNAME' => $srcName,
-	'SPNAME' => $dstName,
-	'SPDESC' => $spPurpose,
-)) ?>
+<?php
+  echo $this->t('{consent:consent_notice}', array( 'SPNAME' => $dstName ));
+  if ($spPurpose) echo '</p><p>' . $this->t('{consent:consent_purpose}', array( 'SPNAME' => $dstName, 'SPDESC' => $spPurpose ));
+?>
+</p>
+
+<p>
+<?php
+  echo $this->t('{consent:consent_accept}', array( 'SPNAME' => $dstName, 'IDPNAME' => $srcName ));
+?>
 </p>
 
 	<p style="margin: 1em">
-- 
GitLab