You are here

function cas_save_page in CAS 5

Same name and namespace in other branches
  1. 5.4 cas.module \cas_save_page()
  2. 5.3 cas.module \cas_save_page()
  3. 6 cas.module \cas_save_page()
  4. 6.2 cas.module \cas_save_page()

Saves the page that the user was on when login was requested or required

1 call to cas_save_page()
cas_login_check in ./cas.module
Implementation of hook_init Traps a page load to see if authentication is required.

File

./cas.module, line 557

Code

function cas_save_page() {
  if (!$_SESSION['cas_goto']) {
    if (arg(0) == 'cas') {

      //we're were destined to the CAS login page, so set

      //the page to the referrer.
      $_SESSION['cas_goto'] = $_SERVER['HTTP_REFERER'];
    }
    else {

      //We're destined for another page, so save the group.
      $_SESSION['cas_goto'] = $_GET['q'];
    }
  }
}