From 318b57ce1c2b7e7379284cf905967ffd87b6dd9a Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 22 Sep 2009 07:43:39 +0000
Subject: [PATCH] preprodwarning: Don't show warning in passive request.

Fixes issue 140

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1766 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/preprodwarning/lib/Auth/Process/Warning.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/preprodwarning/lib/Auth/Process/Warning.php b/modules/preprodwarning/lib/Auth/Process/Warning.php
index 2c03d558c..089801534 100644
--- a/modules/preprodwarning/lib/Auth/Process/Warning.php
+++ b/modules/preprodwarning/lib/Auth/Process/Warning.php
@@ -21,6 +21,11 @@ class sspmod_preprodwarning_Auth_Process_Warning extends SimpleSAML_Auth_Process
 	public function process(&$state) {
 		assert('is_array($state)');
 
+		if (isset($state['isPassive']) && $state['isPassive'] === TRUE) {
+			/* We have a passive request. Skip the warning. */
+			return;
+		}
+
 		/* Save state and redirect. */
 		$id = SimpleSAML_Auth_State::saveState($state, 'warning:request');
 		$url = SimpleSAML_Module::getModuleURL('preprodwarning/showwarning.php');
-- 
GitLab