You are here

function ajax_get_login_block_content in Ajax Login/Register 6

Same name and namespace in other branches
  1. 6.2 ajax_register.module \ajax_get_login_block_content()
1 call to ajax_get_login_block_content()
ajax_register_block in ./ajax_register.module

File

./ajax_register.module, line 88

Code

function ajax_get_login_block_content() {
  global $user;
  $user_uri = ajax_register_get_my_account_link();
  $login_uri = ajax_register_get_login_link();
  $register_uri = ajax_register_get_register_link();
  $logout_uri = ajax_register_get_logout_link();
  if (user_is_anonymous()) {
    $block_content = "<div id='ajax_register_block_anonymous'>" . $login_uri . "<br/>" . $register_uri . "</div>";
    return $block_content;
  }
  else {
    $block_content = "<div id='ajax_register_block_authenticated'><p>" . t("Welcome: ") . "<span class='ajax_register_user_name'>" . $user->name . "</span></p>" . $user_uri . "<br/>" . $logout_uri . "</div>";
    return $block_content;
  }
}