From d48656f0eba09bc0c0d8346269d6a587ddf7131e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Fri, 26 Oct 2007 12:29:44 +0000
Subject: [PATCH] Adding functionality in sessino to get a list of SP sessions

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@57 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Session.php | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index 814be119f..e37d30c4a 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -90,6 +90,19 @@ class SimpleSAML_Session {
 		return null;
 	}
 	
+	public function get_sp_list() {
+		
+		$list = array();
+		if (!$this->sp_at_idpsessions) return $list;
+		
+		foreach ($this->sp_at_idpsessions AS $entityid => $sp) {
+			if ($sp == self::STATE_ONLINE) {
+				$list[] = $entityid;
+			}
+		}
+		return $list;
+	}
+	
 	public function set_sp_logout_completed($entityid) {
 		$this->sp_at_idpsessions[$entityid] = self::STATE_LOGGEDOUT;
 	}
-- 
GitLab