From ae8644ac373727678b1b36a3f471e1abeee0a8a6 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 26 Jan 2010 10:07:25 +0000
Subject: [PATCH] Session: Add getAuthnInstant().

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

diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index bc272c901..91588e388 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -518,6 +518,20 @@ class SimpleSAML_Session {
 	public function isAuthenticated() {
 		return $this->authenticated;
 	}
+
+
+	/**
+	 * Retrieve the time the user was authenticated.
+	 *
+	 * @return int|NULL  The timestamp for when the user was authenticated. NULL if the user hasn't authenticated.
+	 */
+	public function getAuthnInstant() {
+		if (!$this->isAuthenticated()) {
+			return NULL;
+		}
+
+		return $this->sessionstarted;
+	}
 	
 	
 	// *** Attributes ***
-- 
GitLab