You are here

function cas_login_block in CAS 6.3

Same name and namespace in other branches
  1. 7 cas.module \cas_login_block()

Login form for the CAS login block.

1 string reference to 'cas_login_block'
cas_block in ./cas.module
Implements hook_block().

File

./cas.module, line 679
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_block($form_state) {
  $form['cas.return_to'] = array(
    '#type' => 'hidden',
    '#value' => cas_login_destination(),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t(variable_get('cas_login_invite', CAS_LOGIN_INVITE_DEFAULT)),
  );
  $form['cas_login_redirection_message'] = array(
    '#value' => '<div class="form-item cas-login-redirection-message">' . t(variable_get('cas_login_redir_message', CAS_LOGIN_REDIR_MESSAGE)) . '</div>',
    '#weight' => -1,
  );
  if (module_exists('persistent_login') && variable_get('cas_allow_rememberme', 0)) {
    $form['remember'] = array(
      '#type' => 'checkbox',
      '#title' => t('Remember me'),
      '#default_value' => 0,
    );
  }
  return $form;
}