From b622b7b5463d3c372d3428b967564de2d2443932 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Fri, 22 Jan 2010 09:13:40 +0000
Subject: [PATCH] SSOService: Leave exception handling to _include.php.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2124 44740490-163a-0410-bde0-09ae8108e29a
---
 www/saml2/idp/SSOService.php  | 31 +++++++++----------------------
 www/shib13/idp/SSOService.php | 30 +++++++++---------------------
 2 files changed, 18 insertions(+), 43 deletions(-)

diff --git a/www/saml2/idp/SSOService.php b/www/saml2/idp/SSOService.php
index b92512caa..6bdbcecb6 100644
--- a/www/saml2/idp/SSOService.php
+++ b/www/saml2/idp/SSOService.php
@@ -13,26 +13,13 @@ require_once('../../../www/_include.php');
 
 SimpleSAML_Logger::info('SAML2.0 - IdP.SSOService: Accessing SAML 2.0 IdP endpoint SSOService');
 
-try {
-
-	$config = SimpleSAML_Configuration::getInstance();
-	if (!$config->getBoolean('enable.saml20-idp', FALSE)) {
-		throw new SimpleSAML_Error_Error('NOACCESS');
-	}
-
-	$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-	$idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
-	$idp = SimpleSAML_IdP::getById('saml2:' . $idpEntityId);
-	sspmod_saml_IdP_SAML2::receiveAuthnRequest($idp);
-	assert('FALSE');
-
-} catch(SimpleSAML_Error_Error $e) {
-
-	$e->show();
-
-} catch(Exception $e) {
-
-	$e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $e);
-	$e->show();
-
+$config = SimpleSAML_Configuration::getInstance();
+if (!$config->getBoolean('enable.saml20-idp', FALSE)) {
+	throw new SimpleSAML_Error_Error('NOACCESS');
 }
+
+$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
+$idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
+$idp = SimpleSAML_IdP::getById('saml2:' . $idpEntityId);
+sspmod_saml_IdP_SAML2::receiveAuthnRequest($idp);
+assert('FALSE');
diff --git a/www/shib13/idp/SSOService.php b/www/shib13/idp/SSOService.php
index 14de0d166..5bc310a23 100644
--- a/www/shib13/idp/SSOService.php
+++ b/www/shib13/idp/SSOService.php
@@ -13,25 +13,13 @@ require_once('../../../www/_include.php');
 
 SimpleSAML_Logger::info('Shib1.3 - IdP.SSOService: Accessing Shibboleth 1.3 IdP endpoint SSOService');
 
-try {
-	$config = SimpleSAML_Configuration::getInstance();
-	if (!$config->getBoolean('enable.shib13-idp', FALSE)) {
-		throw new SimpleSAML_Error_Error('NOACCESS');
-	}
-
-	$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-	$idpEntityId = $metadata->getMetaDataCurrentEntityID('shib13-idp-hosted');
-	$idp = SimpleSAML_IdP::getById('saml1:' . $idpEntityId);
-	sspmod_saml_IdP_SAML1::receiveAuthnRequest($idp);
-	assert('FALSE');
-
-} catch(SimpleSAML_Error_Error $e) {
-
-	$e->show();
-
-} catch(Exception $e) {
-
-	$e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $e);
-	$e->show();
-
+$config = SimpleSAML_Configuration::getInstance();
+if (!$config->getBoolean('enable.shib13-idp', FALSE)) {
+	throw new SimpleSAML_Error_Error('NOACCESS');
 }
+
+$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
+$idpEntityId = $metadata->getMetaDataCurrentEntityID('shib13-idp-hosted');
+$idp = SimpleSAML_IdP::getById('saml1:' . $idpEntityId);
+sspmod_saml_IdP_SAML1::receiveAuthnRequest($idp);
+assert('FALSE');
-- 
GitLab