You are here

function shib_auth_block in Shibboleth Authentication 6.3

Same name and namespace in other branches
  1. 5.3 shib_auth.module \shib_auth_block()
  2. 5.2 shib_auth.module \shib_auth_block()
  3. 6.4 shib_auth.module \shib_auth_block()
  4. 6 shib_auth.module \shib_auth_block()
  5. 6.2 shib_auth.module \shib_auth_block()

Generate the HTML text for the shib_auth login block

@returns block HTML

Parameters

op the operation from the URL:

delta offset:

File

./shib_auth.module, line 331
This is a Shibboleth authentication module.

Code

function shib_auth_block($op = 'list', $delta = 0, $edit = array()) {

  // listing of blocks, such as on the admin/block page
  switch ($op) {
    case "list":
      $blocks[0] = array(
        'info' => t('Shibboleth authentication'),
        'status' => TRUE,
        'visibility' => 1,
        'weight' => 0,
        'region' => 'left',
      );
      return $blocks;
    case 'configure':
      $form = array();
      switch ($delta) {
        case 0:
          $form['auth_link_text'] = array(
            '#type' => 'textfield',
            '#title' => t('Text of the auth link'),
            '#require' => TRUE,
            '#size' => 60,
            '#description' => t('Here you can replace the text of the authentication link.'),
            '#default_value' => variable_get('auth_link_text', t('Shibboleth Login')),
          );
      }
      return $form;
    case 'save':
      switch ($delta) {
        case 0:
          variable_set('auth_link_text', $edit['auth_link_text']);
      }
      break;
    case "view":
    default:
      switch ($delta) {
        case 0:
          $block = array(
            'subject' => t('Shibboleth login'),
            'content' => generate_login_text(),
          );
          break;
      }
      return $block;
  }
}