From 184fe1cb75adbac692f9b52a18c4477c4b3133eb Mon Sep 17 00:00:00 2001
From: Bradley M. Froehle <brad.froehle@gmail.com>
Date: Thu, 7 Apr 2011 14:22:11 -0700
Subject: [PATCH] Issue #1120142 - Avoid 403 Access Denied errors when visiting 'cas'.

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

diff --git a/cas.module b/cas.module
index 70066ad..096b512 100644
--- a/cas.module
+++ b/cas.module
@@ -28,6 +28,10 @@ function cas_init() {
     // do any processing here. Necessary for CAS gateway tests.
     return;
   }
+  if (user_is_logged_in() && $_GET['q'] == 'cas') {
+    // If user is logged in, redirect to '<front>' instead of giving 403.
+    drupal_goto('');
+  }
   _cas_single_sign_out_check();
   cas_login_check();
 }
-- 
1.7.4.1

