You are here

function cas_block_view in CAS 7

Implements hook_block_view().

File

./cas.module, line 758
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_block_view($delta = '') {
  global $user;
  $block = array();
  switch ($delta) {
    case 'login':

      // For usability's sake, avoid showing two login forms on one page.
      if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
        $block['subject'] = t('User login');
        $block['content'] = drupal_get_form('cas_login_block');
      }
      return $block;
  }
}