From 92b0b48eb8abe3db167343c2e4056ccf90a64add Mon Sep 17 00:00:00 2001
From: Mads Freek Petersen <freek@wayf.dk>
Date: Tue, 24 Jun 2008 13:22:32 +0000
Subject: [PATCH] Made idp_name available for the consent template, translated
 it and used it as a replacement string for the 'consent_accept' string.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@708 44740490-163a-0410-bde0-09ae8108e29a
---
 templates/default/consent.php | 5 +++--
 www/saml2/idp/SSOService.php  | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/templates/default/consent.php b/templates/default/consent.php
index 8622e73eb..c4c1cbc3d 100644
--- a/templates/default/consent.php
+++ b/templates/default/consent.php
@@ -3,12 +3,13 @@
 	
 	$this->includeLanguageFile('consent.php'); 
 	$this->includeInlineTranslation('spname', $this->data['sp_name']);
+	$this->includeInlineTranslation('IDPNAME', $this->data['idp_name']);
 ?>
 
 	<div id="content">
 
 		<p><?php echo htmlspecialchars($this->t('consent_notice')); ?> <strong><?php echo htmlspecialchars($this->t('spname')); ?></strong>.
-		<?php echo htmlspecialchars($this->t('consent_accept')) ?> 
+		<?php echo htmlspecialchars($this->t('consent_accept', true, true, array('IDPNAME' => ''))) ?> 
 		</p>
 
 		<?php if ($this->data['sppp'] !== FALSE) {
@@ -28,7 +29,7 @@
 		<form style="display: inline; margin-left: .5em;" action="<?php echo htmlspecialchars($this->data['noconsent']); ?>" method="GET">
 			<input type="submit" value="<?php echo htmlspecialchars($this->t('no')) ?>" />
 		</form>
-
+		<p>
 
 		<table style="font-size: x-small">
 <?php
diff --git a/www/saml2/idp/SSOService.php b/www/saml2/idp/SSOService.php
index 925dcf9fb..ee6e0a020 100644
--- a/www/saml2/idp/SSOService.php
+++ b/www/saml2/idp/SSOService.php
@@ -275,6 +275,7 @@ if($needAuth && !$isPassive) {
 				$t = new SimpleSAML_XHTML_Template($config, 'consent.php', 'attributes.php');
 				$t->data['header'] = 'Consent';
 				$t->data['sp_name'] = $sp_name;
+				$t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid);
 				$t->data['spentityid'] = $spentityid;
 				$t->data['attributes'] = $filteredattributes;
 				$t->data['consenturl'] = SimpleSAML_Utilities::selfURLNoQuery();
-- 
GitLab