Customize drupal user login block
Log in to your drupal site as admin and then, go to administer -> block then go to tab add block to create new customize your drupal user login block.

![]()
On the block body paste this php code to create the new customize your drupal user login block:
<?php global $user; ?>
<?php if ($user->uid) : ?>
Welcome: <?php print l($user->name,'user/'.$user->uid); ?> |
<?php print l("logout","logout"); ?>
<?php else : ?>
For full access and to post messages and comments please Login/Register: <?php print l("Login/Register","user/login"); ?>
<?php endif; ?>
Make sure that you set the input format as php code
![]()
 ![]()
Then click the save button.
 ![]()
 To enable the customs login block

Hit save block after you tick the enable checkbox to apply the changes.
![]()
- drupal's blog
- 84677 reads

6 comments
drupal
Submitted by seks on Tue, 2009/05/05 - 21:06.Recent versions of Drupal
Submitted by jega123 on Mon, 2009/06/08 - 15:31.Recent versions of Drupal have the oh-so-cool feature that allows you to host many websites off a single Drupal codebase. The coolest part about this is that you can share some tables accross multiple websites; which means you can do things like have a single username/password table accross all the websites.
Thanks,
Website Design
 I am using drupal 5.1 and
Submitted by hankjmatt on Thu, 2009/06/18 - 13:11. I am using drupal 5.1 and I have copied this code into a block and it works for me, but only when I have the default login block visible. If I remove the login block, by setting its region to <none>, then this custom login block doesn't work anymore. Its got me stumped... If anyone has any suggestions, I would really appreciate it.
club penguin
Thanks for sharing nice
Submitted by nidayede (not verified) on Tue, 2011/08/30 - 15:09.Thanks for sharing nice information with us. free psp games, get rid of pimples, steam mops, radar detectors. i like your post and all you share with us is up todate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job.Petite Wigs
Is there any way where i can
Submitted by surf thakur (not verified) on Wed, 2011/10/05 - 17:45.Is there any way where i can achieve the above with drupal 6 without having to create a module?
Recent versions of Drupal
Submitted by Jack Deneris (not verified) on Fri, 2011/11/25 - 20:10.Recent versions of Drupal have the oh-so-cool feature that allows you to host many websites off a single Drupal codebase. The coolest part about this is that you can share some tables accross multiple websites; which means you can do things like have a single username/password table accross all the websites. bloons tower defense 4
Thanks,