From 7a2475cf2a8738f65764f37a6252504ef127202f Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 2 Jul 2008 13:04:28 +0000
Subject: [PATCH] Template: changed all in-tree template users to use the new
 constructor format.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@755 44740490-163a-0410-bde0-09ae8108e29a
---
 attributealter/feideaccess.php       | 2 +-
 lib/SimpleSAML/Utilities.php         | 2 +-
 lib/SimpleSAML/XHTML/IdPDisco.php    | 2 +-
 www/admin/config.php                 | 2 +-
 www/admin/metadata-converter.php     | 2 +-
 www/admin/metadata.php               | 2 +-
 www/auth/login-admin.php             | 2 +-
 www/auth/login-auto.php              | 2 +-
 www/auth/login-feide.php             | 2 +-
 www/auth/login-ldapmulti.php         | 2 +-
 www/auth/login-radius.php            | 2 +-
 www/auth/login.php                   | 2 +-
 www/errorreport.php                  | 2 +-
 www/example-simple/saml2-example.php | 2 +-
 www/example-simple/wsfed-example.php | 2 +-
 www/index.php                        | 2 +-
 www/metashare/add.php                | 2 +-
 www/metashare/index.php              | 2 +-
 www/saml2/idp/SSOService.php         | 2 +-
 www/saml2/idp/metadata.php           | 2 +-
 www/saml2/sp/metadata.php            | 2 +-
 www/shib13/idp/SSOService.php        | 2 +-
 www/shib13/idp/metadata.php          | 2 +-
 www/shib13/sp/metadata.php           | 2 +-
 24 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/attributealter/feideaccess.php b/attributealter/feideaccess.php
index e939c4303..d2972752d 100644
--- a/attributealter/feideaccess.php
+++ b/attributealter/feideaccess.php
@@ -23,7 +23,7 @@ function attributealter_feideaccess(&$attributes, $spEntityId = null, $idpEntity
 		SimpleSAML_Logger::error('FEIDE access control: Organization "' . $org .
 			'" not in list of allowed organization for SP "' . $spEntityId . '".');
 		$config = SimpleSAML_Configuration::getInstance();
-		$t = new SimpleSAML_XHTML_Template($config, 'no_access.php', 'no_access_dictionary.php');
+		$t = new SimpleSAML_XHTML_Template($config, 'no_access.php', 'no_access_dictionary');
 		if(array_key_exists('name', $spMetadata)) {
 			$t->data['sp_name'] = $spMetadata['name'];
 		} else {
diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index 54ed4c201..0d2298afe 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -400,7 +400,7 @@ class SimpleSAML_Utilities {
 		SimpleSAML_Logger::error($_SERVER['PHP_SELF'].' - UserError: ErrCode:'.(!empty($errorcode) ? $errorcode : 'na').': '.urlencode($emsg) );
 		
 		$languagefile = null;
-		if (isset($errorcode)) $languagefile = 'errors.php';
+		if (isset($errorcode)) $languagefile = 'errors';
 		
 		// Initialize a template
 		$t = new SimpleSAML_XHTML_Template($config, 'error.php', $languagefile);
diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php
index 57c968e84..2b7c07c1c 100644
--- a/lib/SimpleSAML/XHTML/IdPDisco.php
+++ b/lib/SimpleSAML/XHTML/IdPDisco.php
@@ -371,7 +371,7 @@ class SimpleSAML_XHTML_IdPDisco {
 			throw new Exception('Invalid value for the \'idpdisco.layout\' option.');
 		}
 
-		$t = new SimpleSAML_XHTML_Template($this->config, $templateFile, 'disco.php');
+		$t = new SimpleSAML_XHTML_Template($this->config, $templateFile, 'disco');
 		$t->data['idplist'] = $idpList;
 		$t->data['preferredidp'] = $preferredIdP;
 		$t->data['return'] = $this->returnURL;
diff --git a/www/admin/config.php b/www/admin/config.php
index e9363c97e..6242d77da 100644
--- a/www/admin/config.php
+++ b/www/admin/config.php
@@ -196,7 +196,7 @@ if(array_key_exists('file', $_GET)) {
 
 
 /* Initialize template page. */
-$et = new SimpleSAML_XHTML_Template($config, 'admin-config.php', 'admin.php');
+$et = new SimpleSAML_XHTML_Template($config, 'admin-config.php', 'admin');
 $et->data['url'] = SimpleSAML_Utilities::selfURLNoQuery();
 
 if($file === NULL) {
diff --git a/www/admin/metadata-converter.php b/www/admin/metadata-converter.php
index 1e356c43c..68d42130a 100644
--- a/www/admin/metadata-converter.php
+++ b/www/admin/metadata-converter.php
@@ -52,7 +52,7 @@ try {
 	}
 
 
-	$template = new SimpleSAML_XHTML_Template($config, 'metadata-converter.php', 'admin.php');
+	$template = new SimpleSAML_XHTML_Template($config, 'metadata-converter.php', 'admin');
 
 	$template->data['xmldata'] = $xmldata;
 	$template->data['output'] = $output;
diff --git a/www/admin/metadata.php b/www/admin/metadata.php
index 25df008b7..b55408430 100644
--- a/www/admin/metadata.php
+++ b/www/admin/metadata.php
@@ -19,7 +19,7 @@ try {
 
 	$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 
-	$et = new SimpleSAML_XHTML_Template($config, 'admin-metadatalist.php', 'admin.php');
+	$et = new SimpleSAML_XHTML_Template($config, 'admin-metadatalist.php', 'admin');
 
 
 	if ($config->getValue('enable.saml20-sp') === true) {
diff --git a/www/auth/login-admin.php b/www/auth/login-admin.php
index ede6fb358..307140809 100644
--- a/www/auth/login-admin.php
+++ b/www/auth/login-admin.php
@@ -79,7 +79,7 @@ if (isset($_POST['password'])) {
 }
 
 
-$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login.php');
+$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login');
 
 $t->data['header'] = 'simpleSAMLphp: Enter username and password';	
 $t->data['relaystate'] = $relaystate;
diff --git a/www/auth/login-auto.php b/www/auth/login-auto.php
index 771dfa718..859597e9c 100644
--- a/www/auth/login-auto.php
+++ b/www/auth/login-auto.php
@@ -44,7 +44,7 @@ if(!is_array($attributes)) {
 if($ask_login && !array_key_exists('username', $_POST)) {
 	/* Show login page. */
 
-	$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login.php');
+	$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login');
 
 	$t->data['header'] = 'simpleSAMLphp: Enter username and password';
 	$t->data['relaystate'] = $_REQUEST['RelayState'];
diff --git a/www/auth/login-feide.php b/www/auth/login-feide.php
index b0a11ec44..efec4e21a 100644
--- a/www/auth/login-feide.php
+++ b/www/auth/login-feide.php
@@ -268,7 +268,7 @@ if (isset($_REQUEST['username'])) {
 }
 
 
-$t = new SimpleSAML_XHTML_Template($config, 'login-feide.php', 'login.php');
+$t = new SimpleSAML_XHTML_Template($config, 'login-feide.php', 'login');
 
 $t->data['header'] = 'simpleSAMLphp: Enter username and password';	
 $t->data['relaystate'] = $_REQUEST['RelayState'];
diff --git a/www/auth/login-ldapmulti.php b/www/auth/login-ldapmulti.php
index 270007128..a2052670d 100644
--- a/www/auth/login-ldapmulti.php
+++ b/www/auth/login-ldapmulti.php
@@ -117,7 +117,7 @@ if (isset($_POST['username'])) {
 }
 
 
-$t = new SimpleSAML_XHTML_Template($config, 'login-ldapmulti.php', 'login.php');
+$t = new SimpleSAML_XHTML_Template($config, 'login-ldapmulti.php', 'login');
 
 $t->data['header'] = 'simpleSAMLphp: Enter username and password';	
 $t->data['relaystate'] = $_REQUEST['RelayState'];
diff --git a/www/auth/login-radius.php b/www/auth/login-radius.php
index fd90e86cd..2047a0e79 100644
--- a/www/auth/login-radius.php
+++ b/www/auth/login-radius.php
@@ -131,7 +131,7 @@ if (isset($_POST['username'])) {
 }
 
 
-$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login.php');
+$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login');
 
 $t->data['header'] = 'simpleSAMLphp: Enter username and password';	
 $t->data['relaystate'] = $_REQUEST['RelayState'];
diff --git a/www/auth/login.php b/www/auth/login.php
index 89d059297..df69a8787 100644
--- a/www/auth/login.php
+++ b/www/auth/login.php
@@ -139,7 +139,7 @@ if (isset($_POST['username'])) {
 }
 
 
-$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login.php');
+$t = new SimpleSAML_XHTML_Template($config, 'login.php', 'login');
 
 $t->data['header'] = 'simpleSAMLphp: Enter username and password';
 $t->data['relaystate'] = $relaystate;
diff --git a/www/errorreport.php b/www/errorreport.php
index fe54bfaa5..2a98dcf88 100644
--- a/www/errorreport.php
+++ b/www/errorreport.php
@@ -8,7 +8,7 @@ $config = SimpleSAML_Configuration::getInstance();
 if($_SERVER['REQUEST_METHOD'] !== 'POST') {
 	/* The message has been sent. Show error report page. */
 
-	$t = new SimpleSAML_XHTML_Template($config, 'errorreport.php', 'errors.php');
+	$t = new SimpleSAML_XHTML_Template($config, 'errorreport.php', 'errors');
 	$t->show();
 	exit;
 }
diff --git a/www/example-simple/saml2-example.php b/www/example-simple/saml2-example.php
index 2997032b6..426be7b1f 100644
--- a/www/example-simple/saml2-example.php
+++ b/www/example-simple/saml2-example.php
@@ -48,7 +48,7 @@ $attributes = $session->getAttributes();
  *
  */
 
-$t = new SimpleSAML_XHTML_Template($config, 'status.php', 'attributes.php');
+$t = new SimpleSAML_XHTML_Template($config, 'status.php', 'attributes');
 
 $t->data['header'] = 'SAML 2.0 SP Demo Example';
 $t->data['remaining'] = $session->remainingTime();
diff --git a/www/example-simple/wsfed-example.php b/www/example-simple/wsfed-example.php
index 8c01bb124..0908962ef 100644
--- a/www/example-simple/wsfed-example.php
+++ b/www/example-simple/wsfed-example.php
@@ -14,7 +14,7 @@ if (!$session->isValid('wsfed') ) {
 
 $attributes = $session->getAttributes();
 
-$t = new SimpleSAML_XHTML_Template($config, 'status.php', 'attributes.php');
+$t = new SimpleSAML_XHTML_Template($config, 'status.php', 'attributes');
 
 $t->data['header'] = 'WS-Fed SP Demo Example';
 $t->data['remaining'] = $session->remainingTime();
diff --git a/www/index.php b/www/index.php
index ace4668df..5a63030c8 100644
--- a/www/index.php
+++ b/www/index.php
@@ -214,7 +214,7 @@ $funcmatrix[] = array(
 
 
 
-$t = new SimpleSAML_XHTML_Template($config, 'frontpage.php', 'frontpage.php');
+$t = new SimpleSAML_XHTML_Template($config, 'frontpage.php', 'frontpage');
 $t->data['header'] = 'simpleSAMLphp installation page';
 $t->data['icon'] = 'compass_l.png';
 $t->data['warnings'] = $warnings;
diff --git a/www/metashare/add.php b/www/metashare/add.php
index dd658db72..138d07b5b 100644
--- a/www/metashare/add.php
+++ b/www/metashare/add.php
@@ -16,7 +16,7 @@ if(!$metaConfig->getBoolean('metashare.enable', FALSE)) {
 }
 
 $store = SimpleSAML_MetaShare_Store::getInstance();
-$t = new SimpleSAML_XHTML_Template($config, 'metashare-add.php', 'metashare.php');
+$t = new SimpleSAML_XHTML_Template($config, 'metashare-add.php', 'metashare');
 
 
 if(!array_key_exists('url', $_GET) || empty($_GET['url'])) {
diff --git a/www/metashare/index.php b/www/metashare/index.php
index 1f52caebd..920ecc873 100644
--- a/www/metashare/index.php
+++ b/www/metashare/index.php
@@ -18,7 +18,7 @@ if(!$metaConfig->getBoolean('metashare.enable', FALSE)) {
 $store = SimpleSAML_MetaShare_Store::getInstance();
 $entities = $store->getEntityList();
 
-$t = new SimpleSAML_XHTML_Template($config, 'metashare-list.php', 'metashare.php');
+$t = new SimpleSAML_XHTML_Template($config, 'metashare-list.php', 'metashare');
 $t->data['entities'] = $entities;
 $t->show();
 exit;
diff --git a/www/saml2/idp/SSOService.php b/www/saml2/idp/SSOService.php
index c96c35317..1c0ab7460 100644
--- a/www/saml2/idp/SSOService.php
+++ b/www/saml2/idp/SSOService.php
@@ -272,7 +272,7 @@ if($needAuth && !$isPassive) {
 				$authId = SimpleSAML_Utilities::generateID();
 				$session->setAuthnRequest('saml2', $authId, $requestcache);
 				
-				$t = new SimpleSAML_XHTML_Template($config, 'consent.php', 'attributes.php');
+				$t = new SimpleSAML_XHTML_Template($config, 'consent.php', 'attributes');
 				$t->data['header'] = 'Consent';
 				$t->data['sp_name'] = $sp_name;
 				$t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid);
diff --git a/www/saml2/idp/metadata.php b/www/saml2/idp/metadata.php
index c890b9de1..82ed4d188 100644
--- a/www/saml2/idp/metadata.php
+++ b/www/saml2/idp/metadata.php
@@ -87,7 +87,7 @@ try {
 	if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') {
 		$defaultidp = $config->getValue('default-saml20-idp');
 		
-		$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin.php');
+		$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin');
 		
 	
 		$t->data['header'] = 'saml20-idp';
diff --git a/www/saml2/sp/metadata.php b/www/saml2/sp/metadata.php
index e31e3a1a5..9499fd589 100644
--- a/www/saml2/sp/metadata.php
+++ b/www/saml2/sp/metadata.php
@@ -84,7 +84,7 @@ try {
 	if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') {
 		$defaultidp = $config->getValue('default-saml20-idp');
 		
-		$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin.php');
+		$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin');
 	
 		$t->data['header'] = 'saml20-sp';
 		$t->data['metadata'] = htmlentities($metaxml);
diff --git a/www/shib13/idp/SSOService.php b/www/shib13/idp/SSOService.php
index 34baa010e..3862d2daa 100644
--- a/www/shib13/idp/SSOService.php
+++ b/www/shib13/idp/SSOService.php
@@ -184,7 +184,7 @@ if (!$session->isAuthenticated($authority) ) {
 				$authId = SimpleSAML_Utilities::generateID();
 				$session->setAuthnRequest('shib13', $authId, $requestcache);
 				
-				$t = new SimpleSAML_XHTML_Template($config, 'consent.php', 'attributes.php');
+				$t = new SimpleSAML_XHTML_Template($config, 'consent.php', 'attributes');
 				$t->data['header'] = 'Consent';
 				$t->data['sp_name'] = $sp_name;
 				$t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid);
diff --git a/www/shib13/idp/metadata.php b/www/shib13/idp/metadata.php
index a38285b4d..be1cbfb82 100644
--- a/www/shib13/idp/metadata.php
+++ b/www/shib13/idp/metadata.php
@@ -77,7 +77,7 @@ try {
 	if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') {
 		$defaultidp = $config->getValue('default-shib13-idp');
 		
-		$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin.php');
+		$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin');
 	
 		$t->data['header'] = 'shib13-idp';
 		
diff --git a/www/shib13/sp/metadata.php b/www/shib13/sp/metadata.php
index f886eb930..138ca32a1 100644
--- a/www/shib13/sp/metadata.php
+++ b/www/shib13/sp/metadata.php
@@ -56,7 +56,7 @@ try {
 	if (array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml') {
 		$defaultidp = $config->getValue('default-shib13-idp');
 		
-		$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin.php');
+		$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin');
 		
 	
 		$t->data['header'] = 'shib13-sp';
-- 
GitLab