From a206063005247edafde82a4c9de6905436791759 Mon Sep 17 00:00:00 2001
From: Jacob Christiansen <jach@wayf.dk>
Date: Fri, 6 Nov 2009 10:59:11 +0000
Subject: [PATCH] Do not display services that have consent disabled.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1978 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/consentAdmin/www/consentAdmin.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/consentAdmin/www/consentAdmin.php b/modules/consentAdmin/www/consentAdmin.php
index abca499ca..5361c1932 100644
--- a/modules/consentAdmin/www/consentAdmin.php
+++ b/modules/consentAdmin/www/consentAdmin.php
@@ -124,7 +124,14 @@ if($session->getIdP() != null) {
 	$idp_entityid = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
 	$idp_metadata = $metadata->getMetaData($idp_entityid, 'saml20-idp-hosted');
 }
- 
+
+// Remove services, whitch have consent disabled
+foreach($idp_metadata['consent.disable'] AS $disable) {
+    if(array_key_exists($disable, $all_sp_metadata)) {
+        unset($all_sp_metadata[$disable]);
+    }
+}
+
 SimpleSAML_Logger::info('consentAdmin: '.$idp_entityid);
 
 // Calc correct source
-- 
GitLab