You are here

function simplesamlphp_auth_block in simpleSAMLphp Authentication 6.2

Same name and namespace in other branches
  1. 6.3 simplesamlphp_auth.module \simplesamlphp_auth_block()

Implementation of hook_block().

File

./simplesamlphp_auth.module, line 526
simpleSAMLphp authentication module for Drupal.

Code

function simplesamlphp_auth_block($op = 'list', $delta = 0, $edit = array()) {
  if (!_simplesamlphp_auth_isEnabled()) {

    // Exit without executing.
    return;
  }
  if ($op == 'list') {
    $blocks = array(
      array(
        'info' => t('simpleSAMLphp authentication'),
        'weight' => 0,
        'status' => 1,
        'region' => 'left',
        'cache' => BLOCK_NO_CACHE,
      ),
    );
    return $blocks;
  }
  elseif ($op == 'view') {
    switch ($delta) {
      case 0:
        $block = array(
          'subject' => t('simpleSAMLphp login'),
          'content' => _simplesamlphp_auth_generate_block_text(),
        );
        break;
    }
    return $block;
  }
}