You are here

function cas_update_6303 in CAS 6.3

Same name and namespace in other branches
  1. 7 cas.install \cas_update_6303()

Remove unnecessary CAS settings.

File

./cas.install, line 284
Installation hooks for the CAS module.

Code

function cas_update_6303() {

  // We have removed the cas_first_login option, and instead verify that
  // cas_first_login_destination is non-empty. To preserve functionality,
  // we need to update the destination to '<front>' if previously the option
  // was selected but the destination was empty.
  if (variable_get('cas_first_login', FALSE)) {
    if (variable_get('cas_first_login_destination', '') == '') {
      variable_set('cas_first_login_destination', '<front>');
    }
  }
  else {
    variable_set('cas_first_login_destination', '');
  }
  variable_del('cas_first_login');

  // Similarly for the cas_logout_redirect and cas_logout_destination
  // variables.
  if (variable_get('cas_logout_redirect', FALSE)) {
    if (variable_get('cas_logout_destination', '') == '') {
      variable_set('cas_logout_destination', '<front>');
    }
  }
  else {
    variable_set('cas_logout_destination', '');
  }
  variable_del('cas_logout_redirect');

  // If the Certicate Authority is not being verified, ensure that the
  // certificate field is empty.
  if (variable_get('cas_cert_verify', 'none') == 'none') {
    variable_set('cas_cert', '');
  }
  variable_del('cas_cert_verify');

  // Also remove the variable controlling CAS Single Sign-Out which is now
  // always enabled.
  variable_del('cas_signout');
  return array();
}