You are here

function _simplesamlphp_auth_generate_block_text in simpleSAMLphp Authentication 7

Same name and namespace in other branches
  1. 6.3 simplesamlphp_auth.module \_simplesamlphp_auth_generate_block_text()
  2. 6.2 simplesamlphp_auth.module \_simplesamlphp_auth_generate_block_text()
  3. 7.3 simplesamlphp_auth.module \_simplesamlphp_auth_generate_block_text()
  4. 7.2 simplesamlphp_auth.module \_simplesamlphp_auth_generate_block_text()

Generates the text for the log in block.

1 call to _simplesamlphp_auth_generate_block_text()
simplesamlphp_auth_block_view in ./simplesamlphp_auth.module
Implements hook_block_view().

File

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

Code

function _simplesamlphp_auth_generate_block_text() {
  global $_simplesamlphp_auth_as;
  $block_content = '';
  global $user;

  // Check if valid local session exists..
  if ($_simplesamlphp_auth_as
    ->isAuthenticated()) {
    $block_content .= '<p>Logged in as: ' . $user->name . '<br />' . l('Log Out', 'user/logout') . '</a></p>';
  }
  else {
    $block_content .= '<p>' . l('Federated Log In', 'saml_login') . '</p>';
  }
  return $block_content;
}