From 6481b022531858711572586615e9e13894433a32 Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Mon, 19 Sep 2011 17:02:30 +0000
Subject: [PATCH] [gh-222] Merging from testing into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1060 20a16fea-79d4-4915-8869-1ea9d5ebf173
---
 sites/all/modules/unl/unl_cas/unl_cas.module | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sites/all/modules/unl/unl_cas/unl_cas.module b/sites/all/modules/unl/unl_cas/unl_cas.module
index 3ec9e532..a92c9022 100644
--- a/sites/all/modules/unl/unl_cas/unl_cas.module
+++ b/sites/all/modules/unl/unl_cas/unl_cas.module
@@ -18,9 +18,11 @@ function unl_cas_init() {
     return;
   }
 
-  // If the current user's CAS ticket is expired or doesn't exist, renew their CAS session.
+  // If the user's CAS service ticket is expired, and their drupal session hasn't,
+  // redirect their next GET request to CAS to keep their CAS session active.
+  // However, if their drupal session expired (and they're now anonymous), redirect them regardless.
   $cas = unl_cas_get_adapter();
-  if ($cas->isTicketExpired()) {
+  if ($cas->isTicketExpired() && ($_SERVER['REQUEST_METHOD'] == 'GET' || user_is_anonymous())) {
     $cas->setGateway();
     drupal_goto($cas->getLoginUrl());
   }
-- 
GitLab