You are here

function cas_init in CAS 6.2

Same name and namespace in other branches
  1. 6.3 cas.module \cas_init()
  2. 6 cas.module \cas_init()
  3. 7 cas.module \cas_init()

Implementation of hook_init Traps a page load to see if authentication is required.

File

./cas.module, line 73

Code

function cas_init() {
  _cas_single_sign_out_check();
  cas_login_check();
  if (user_is_logged_in() && $_GET['q'] == 'user/login') {

    // If user is logged in, redirect to '<front>' instead of giving 403.
    drupal_goto('');
  }
}