You are here

function ajax_get_login_block_content in Ajax Login/Register 6.2

Same name and namespace in other branches
  1. 6 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 89

Code

function ajax_get_login_block_content() {
  global $user;
  $user_uri = theme('my_account_link', array());
  $login_uri = theme('user_login_link', array(), array());
  $register_uri = theme('user_register_link', array(), array());
  $logout_uri = theme('user_logout_link', array());
  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'>" . theme('username', $user) . "</span></p>" . $user_uri . "<br/>" . $logout_uri . "</div>";
    return $block_content;
  }
}