From 4b184650ab3a9d8e840f47ce289d3b1dae12214b Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 13 Mar 2012 09:40:01 +0000
Subject: [PATCH] consent: Also allow disabling of consent when datastore has
 failed.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3042 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/consent/lib/Auth/Process/Consent.php | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/consent/lib/Auth/Process/Consent.php b/modules/consent/lib/Auth/Process/Consent.php
index e8e2acb30..17b102725 100644
--- a/modules/consent/lib/Auth/Process/Consent.php
+++ b/modules/consent/lib/Auth/Process/Consent.php
@@ -166,12 +166,13 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
             $state['Source'] = $idpmeta;
         }
 
+        // Do not use consent if disabled on source entity
+        if ( isset($state['Source']['consent.disable']) && in_array($spEntityId, $state['Source']['consent.disable'])) {
+            SimpleSAML_Logger::debug('Consent: Consent disabled for entity ' . $spEntityId);
+            return;
+        }
+
         if ($this->_store !== null) {
-            // Do not use consent if disabled on source entity 
-            if ( isset($state['Source']['consent.disable']) && in_array($spEntityId, $state['Source']['consent.disable'])) {
-                SimpleSAML_Logger::debug('Consent: Consent disabled for entity ' . $spEntityId);
-                return;
-            }
 
             $source      = $state['Source']['metadata-set'] . '|' . $idpEntityId;
             $destination = $state['Destination']['metadata-set'] . '|' . $spEntityId;
-- 
GitLab