From acc82b31c3616a1f2437703820a68ac487cb96c5 Mon Sep 17 00:00:00 2001
From: Bradley M. Froehle <brad.froehle@gmail.com>
Date: Tue, 1 Mar 2011 14:57:13 -0800
Subject: [PATCH] Check session variables to see if /caslogout menu should appear.

---
 cas.module |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/cas.module b/cas.module
index 31c76f1..0ca268f 100644
--- a/cas.module
+++ b/cas.module
@@ -46,13 +46,12 @@ function cas_menu_check() {
 /**
  * Check to see if we need to display the logout menu.
  *
- * @return boolean
+ * @return
+ *   TRUE if the current session has authenticated with CAS.
+ * @see phpCAS::isSessionAuthenticated()
  */
 function cas_menu_logout_check() {
-  global $user;
-  $access = FALSE;
-  if ($user->uid) $access = TRUE;
-  return $access;
+  return !empty($_SESSION['phpCAS']['user']);
 }
 
 /**
-- 
1.7.3.5

