You are here

function cas_login_page in CAS 6.3

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

Redirects to appropriate page based on user settings.

Parameters

$cas_first_login: TRUE if the user was just registered and they should be redirected to the configured 'Initial login landing page'.

1 call to cas_login_page()
cas_login_check in ./cas.module
Checks to see if the user needs to be logged in.
1 string reference to 'cas_login_page'
cas_menu in ./cas.module
Implementation of hook_menu().

File

./cas.module, line 573
Enables users to authenticate via a Central Authentication Service (CAS) Cas will currently work if the auto registration is turned on and will create user accounts automatically.

Code

function cas_login_page($cas_first_login = FALSE) {
  global $user;
  $destination = '';
  $query = array();

  // If it is the user's first CAS login and initial login redirection is enabled, go to the set page
  if ($cas_first_login && variable_get('cas_first_login_destination', '')) {
    $destination = variable_get('cas_first_login_destination', '');
    if (isset($_REQUEST['destination'])) {
      $query['destination'] = $_REQUEST['destination'];
    }
    unset($_REQUEST['destination']);
  }

  // Respect the query string, if transmitted.
  drupal_goto($destination, $query);
}