when an user login in Drupal, the login block disappear from my pages.
I would like instead to keep it there with a message stating the user is logged in.
Something like this (with logout link): "Welcome Patrick. Logout"
thanks
The login-form will not work for not logged in-users.
What is easiest, is to make a new block (admin » build » blocks » new(tab)) Then set that block to show only for role "authenticated". That way, the block will work exact opposite from the user-login block, which shows only for role: anonymous.
You can add any custom text in there, as long as it is static text. If you want to include dynamic text, such as "Hello $username, you will have to go for the tip by Jeremy French: create a module with its own hook_block.
The login block is created by the follwing code from the user_block() function.
if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
$block['subject'] = t('User login');
$block['content'] = drupal_get_form('user_login_block');
}
There is no code to display a message if you are logged in.
One simple way to do what you want would be to create a module which implements the above code in hook_block, and has an elese statement which displays what you want.