From 1dce3f1a2d4ff7f2ceece582546e3cb2f5f70dc4 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 14 Feb 2008 15:00:24 +0000
Subject: [PATCH] Moved initialization of $config global variable.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@304 44740490-163a-0410-bde0-09ae8108e29a
---
 www/saml2/sp/AssertionConsumerService.php  | 3 ++-
 www/saml2/sp/initSLO.php                   | 3 ++-
 www/shib13/sp/AssertionConsumerService.php | 4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/www/saml2/sp/AssertionConsumerService.php b/www/saml2/sp/AssertionConsumerService.php
index 99e001871..13fad5ce9 100644
--- a/www/saml2/sp/AssertionConsumerService.php
+++ b/www/saml2/sp/AssertionConsumerService.php
@@ -3,6 +3,7 @@
 require_once('../../_include.php');
 
 
+require_once('SimpleSAML/Configuration.php');
 require_once('SimpleSAML/Utilities.php');
 require_once('SimpleSAML/Session.php');
 require_once('SimpleSAML/Logger.php');
@@ -21,6 +22,7 @@ require_once('SimpleSAML/XHTML/Template.php');
  * @abstract
  */
 
+$config = SimpleSAML_Configuration::getInstance();
 
 /* Get the session object for the user. Create a new session if no session
  * exists for this user.
@@ -35,7 +37,6 @@ if (!$config->getValue('enable.saml20-sp', false))
 	
 try {
 	
-	$config = SimpleSAML_Configuration::getInstance();	
 	$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 
 	$binding = new SimpleSAML_Bindings_SAML20_HTTPPost($config, $metadata);
diff --git a/www/saml2/sp/initSLO.php b/www/saml2/sp/initSLO.php
index 70ce06cdc..afc19688e 100644
--- a/www/saml2/sp/initSLO.php
+++ b/www/saml2/sp/initSLO.php
@@ -2,6 +2,7 @@
 
 require_once('../../_include.php');
 
+require_once('SimpleSAML/Configuration.php');
 require_once('SimpleSAML/Logger.php');
 require_once('SimpleSAML/Utilities.php');
 require_once('SimpleSAML/Session.php');
@@ -9,6 +10,7 @@ require_once('SimpleSAML/Metadata/MetaDataStorageHandler.php');
 require_once('SimpleSAML/XML/SAML20/LogoutRequest.php');
 require_once('SimpleSAML/Bindings/SAML20/HTTPRedirect.php');
 
+$config = SimpleSAML_Configuration::getInstance();
 
 $session = SimpleSAML_Session::getInstance();
 
@@ -22,7 +24,6 @@ if (isset($session) ) {
 	
 	try {
 	
-		$config = SimpleSAML_Configuration::getInstance();
 		$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 	
 		$idpentityid = $session->getIdP();
diff --git a/www/shib13/sp/AssertionConsumerService.php b/www/shib13/sp/AssertionConsumerService.php
index b6f34e85b..675172a28 100644
--- a/www/shib13/sp/AssertionConsumerService.php
+++ b/www/shib13/sp/AssertionConsumerService.php
@@ -3,6 +3,7 @@
 require_once('../../_include.php');
 
 
+require_once('SimpleSAML/Configuration.php');
 require_once('SimpleSAML/Utilities.php');
 require_once('SimpleSAML/Session.php');
 require_once('SimpleSAML/Metadata/MetaDataStorageHandler.php');
@@ -10,6 +11,8 @@ require_once('SimpleSAML/XML/Shib13/AuthnRequest.php');
 require_once('SimpleSAML/Bindings/Shib13/HTTPPost.php');
 require_once('SimpleSAML/XHTML/Template.php');
 
+$config = SimpleSAML_Configuration::getInstance();
+
 $session = SimpleSAML_Session::getInstance(TRUE);
 
 
@@ -20,7 +23,6 @@ if (!$config->getValue('enable.shib13-sp', false))
 
 try {
 
-	$config = SimpleSAML_Configuration::getInstance();
 	$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 
 	$binding = new SimpleSAML_Bindings_Shib13_HTTPPost($config, $metadata);
-- 
GitLab