Skip to content
Snippets Groups Projects
Commit e8742a2b authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Reformat the files remaining in www/saml2/idp/.

parent 68e27e18
Branches
Tags
No related merge requests found
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
require_once('../../_include.php'); require_once('../../_include.php');
$config = SimpleSAML_Configuration::getInstance(); $config = SimpleSAML_Configuration::getInstance();
if (!$config->getBoolean('enable.saml20-idp', FALSE)) { if (!$config->getBoolean('enable.saml20-idp', false)) {
throw new SimpleSAML_Error_Error('NOACCESS'); throw new SimpleSAML_Error_Error('NOACCESS');
} }
...@@ -19,12 +19,12 @@ $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); ...@@ -19,12 +19,12 @@ $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
$idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); $idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
$idpMetadata = $metadata->getMetaDataConfig($idpEntityId, 'saml20-idp-hosted'); $idpMetadata = $metadata->getMetaDataConfig($idpEntityId, 'saml20-idp-hosted');
if (!$idpMetadata->getBoolean('saml20.sendartifact', FALSE)) { if (!$idpMetadata->getBoolean('saml20.sendartifact', false)) {
throw new SimpleSAML_Error_Error('NOACCESS'); throw new SimpleSAML_Error_Error('NOACCESS');
} }
$store = SimpleSAML_Store::getInstance(); $store = SimpleSAML_Store::getInstance();
if ($store === FALSE) { if ($store === false) {
throw new Exception('Unable to send artifact without a datastore configured.'); throw new Exception('Unable to send artifact without a datastore configured.');
} }
...@@ -53,11 +53,11 @@ $artifact = $request->getArtifact(); ...@@ -53,11 +53,11 @@ $artifact = $request->getArtifact();
$responseData = $store->get('artifact', $artifact); $responseData = $store->get('artifact', $artifact);
$store->delete('artifact', $artifact); $store->delete('artifact', $artifact);
if ($responseData !== NULL) { if ($responseData !== null) {
$document = SAML2_DOMDocumentFactory::fromString($responseData); $document = SAML2_DOMDocumentFactory::fromString($responseData);
$responseXML = $document->firstChild; $responseXML = $document->firstChild;
} else { } else {
$responseXML = NULL; $responseXML = null;
} }
$artifactResponse = new SAML2_ArtifactResponse(); $artifactResponse = new SAML2_ArtifactResponse();
......
...@@ -22,8 +22,10 @@ if (isset($_REQUEST['ReturnTo'])) { ...@@ -22,8 +22,10 @@ if (isset($_REQUEST['ReturnTo'])) {
try { try {
sspmod_saml_IdP_SAML2::receiveLogoutMessage($idp); sspmod_saml_IdP_SAML2::receiveLogoutMessage($idp);
} catch (Exception $e) { // TODO: look for a specific exception } catch (Exception $e) { // TODO: look for a specific exception
// This is dirty. Instead of checking the message of the exception, SAML2_Binding::getCurrentBinding() should throw /*
// an specific exception when the binding is unknown, and we should capture that here * This is dirty. Instead of checking the message of the exception, SAML2_Binding::getCurrentBinding() should
* throw an specific exception when the binding is unknown, and we should capture that here
*/
if ($e->getMessage() === 'Unable to find the current binding.') { if ($e->getMessage() === 'Unable to find the current binding.') {
throw new SimpleSAML_Error_Error('SLOSERVICEPARAMS', $e, 400); throw new SimpleSAML_Error_Error('SLOSERVICEPARAMS', $e, 400);
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment