summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Morken <olav.morken@uninett.no>2010-01-22 09:13:52 +0000
committerOlav Morken <olav.morken@uninett.no>2010-01-22 09:13:52 +0000
commit0164d1f61a9e85cfafba69ed63b5087af89642e8 (patch)
treeb50b652067a09f117ad69c7b021fc2369a6e0952
parentb622b7b5463d3c372d3428b967564de2d2443932 (diff)
downloadsimplesamlphp-0164d1f61a9e85cfafba69ed63b5087af89642e8.zip
simplesamlphp-0164d1f61a9e85cfafba69ed63b5087af89642e8.tar.gz
simplesamlphp-0164d1f61a9e85cfafba69ed63b5087af89642e8.tar.bz2
Move IdP enabled check into SimpleSAML_IdP.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2125 44740490-163a-0410-bde0-09ae8108e29a
-rw-r--r--lib/SimpleSAML/IdP.php8
-rw-r--r--www/saml2/idp/SSOService.php5
-rw-r--r--www/shib13/idp/SSOService.php5
3 files changed, 8 insertions, 10 deletions
diff --git a/lib/SimpleSAML/IdP.php b/lib/SimpleSAML/IdP.php
index 1be653d..1800365 100644
--- a/lib/SimpleSAML/IdP.php
+++ b/lib/SimpleSAML/IdP.php
@@ -45,9 +45,17 @@ class SimpleSAML_IdP {
$this->id = $id;
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
+ $globalConfig = SimpleSAML_Configuration::getInstance();
+
if (substr($id, 0, 6) === 'saml2:') {
+ if (!$globalConfig->getBoolean('enable.saml20-idp', FALSE)) {
+ throw new SimpleSAML_Error_Exception('enable.saml20-idp disabled in config.php.');
+ }
$this->config = $metadata->getMetaDataConfig(substr($id, 6), 'saml20-idp-hosted');
} elseif (substr($id, 0, 6) === 'saml1:') {
+ if (!$globalConfig->getBoolean('enable.shib13-idp', FALSE)) {
+ throw new SimpleSAML_Error_Exception('enable.shib13-idp disabled in config.php.');
+ }
$this->config = $metadata->getMetaDataConfig(substr($id, 6), 'shib13-idp-hosted');
} else {
assert(FALSE);
diff --git a/www/saml2/idp/SSOService.php b/www/saml2/idp/SSOService.php
index 6bdbcec..3d8a696 100644
--- a/www/saml2/idp/SSOService.php
+++ b/www/saml2/idp/SSOService.php
@@ -13,11 +13,6 @@ require_once('../../../www/_include.php');
SimpleSAML_Logger::info('SAML2.0 - IdP.SSOService: Accessing SAML 2.0 IdP endpoint SSOService');
-$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);
diff --git a/www/shib13/idp/SSOService.php b/www/shib13/idp/SSOService.php
index 5bc310a..fc3ec6b 100644
--- a/www/shib13/idp/SSOService.php
+++ b/www/shib13/idp/SSOService.php
@@ -13,11 +13,6 @@ require_once('../../../www/_include.php');
SimpleSAML_Logger::info('Shib1.3 - IdP.SSOService: Accessing Shibboleth 1.3 IdP endpoint SSOService');
-$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);