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.

drupal login regester customisedrupal welcome

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

drupal input format

 PHP code You may post PHP code. You should include <?php ?> tags

Then click the save button.

 drupal save block button

 To enable the customs login block

drupal block

Hit save block after you tick the enable checkbox to apply the changes.

drupal save block


Another version

log in register drupalwelcome

 edit drupal login block and paste this php code

<?php global $user; ?>
<?php if ($user->uid) : ?>
<span class="login_text"><br><br><b>Logged in as: </span> <?php print l($user->name,'user/'.$user->uid); ?> |
<?php print l("logout","logout"); ?>
<?php else : ?>
<form action="/drupal/?q=user&amp;<?php print drupal_get_destination() ?>" method="post" id="user-login">
Username:

<br>

<input type="text" maxlength="60" name="edit[name]" id="edit-name" size="15" value="" class="form-text required" />
<br>
Password:

<br>

<input type="password" maxlength="" name="edit[pass]" id="edit-pass" size="15" class="form-text required" />
<br>
<input type="submit" name="op" value="Login" class="form-submit" />
<br>
<a href="/drupal/?q=user/register" title="Create account">Create account</a>
<br>
<a href="/drupal/?q=user/password" title="Retrieve lost password">Lost password</a>
<input type="hidden" name="edit[form_id]" id="edit-user-login" value="user_login" />
</form>
<?php endif; ?>

Version 3

loginwelcome

 

<?php global $user; ?>
<?php if ($user->uid) : ?>
<span class="login_text">Welcome, </span> <?php print ($user->name); ?> <br>
<?php print l("Your Account",'user/'.$user->uid); ?> |
<?php print l("Log-Out","logout"); ?>
<?php else : ?>
<form action="/drupal/?q=user&amp;<?php print drupal_get_destination() ?>" method="post" id="user-login">
Username:<input type="text" maxlength="60" name="edit[name]" id="edit-name" size="15" value="" class="form-text required" />
<br>
Password: <input type="password" maxlength="" name="edit[pass]" id="edit-pass" size="15" class="form-text required" />
<br>
<input type="submit" name="op" value="Login" class="form-submit" />
<br>
<a href="/drupal/?q=user/password" title="Retrieve lost password">Retrieve lost password</a>
<input type="hidden" name="edit[form_id]" id="edit-user-login" value="user_login" />

</form>

<?php endif; ?>

 

Login not working

Thanks for this post - its most helpful.  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.  Paul.

Ditto on the Login Block

is there something peculiar about 5.1 that makes the code not resolve. It's too good a solution for it not to work as described. I too can't seem to figure this out. Any help would be appreciated.

thanks

Javier

I suggest this winter jackets

I suggest this winter jackets site to my friends so it could be useful & informative winter coats for them also. Thanks!

thanks

افلام اجنبية|افلام عربية|افلام كرتون|افلام عربى|مشاهدة افلام عربية|مشاهدة افلام مباشرة|افلام اجنبي|مشاهدة افلام|مشاهدة افلام اجنبية|افلام رعب|افلام هندية|افلام مغربية|aflam|تحميل افلام|افلام جديدة|افلام اكشن|افلام|

Login Codes

I have used these codes and I di not find any problems till now. Thanks for sharing these valuable information.

wellsfargo online banking

Version 4 - adding member login

login register drupalwelcome user

 

adding Member Log-In to block name

<?php global $user; ?>
<?php if ($user->uid) : ?>
<span class="login_text">Welcome, </span> <b><?php print ($user->name); ?> </b> <br>
<?php print l("Your Account",'user/'.$user->uid); ?> |
<?php print l("Log-Out","logout"); ?>
<?php else : ?>
<form action="/drupal/?q=user&amp;<?php print drupal_get_destination() ?>" method="post" id="user-login">
Username:

<br>

<input type="text" maxlength="60" name="edit[name]" id="edit-name" size="15" value="" class="form-text required" />
<br>
Password:

<br>

<input type="password" maxlength="" name="edit[pass]" id="edit-pass" size="15" class="form-text required" />
<br>
<input type="submit" name="op" value="Login" class="form-submit" />
<br>
<a href="/drupal/?q=user/register" title="Create account">Create account</a>
<br>
<a href="/drupal/?q=user/password" title="Retrieve lost password"> Retrieve lost password</a>
<input type="hidden" name="edit[form_id]" id="edit-user-login" value="user_login" />

</form>

<?php endif; ?>

 

Don't use this script!

I used this script and it locked me out of my own install - it lets me log in, but I only have user rights.  Fortunately, it was a new installation of Drupal 5.1 that I will wipe out from the server side.  But I will be using posted scripts much more cautiously in the future.

Little bit of advice

1. read till the end of post. notice that there is posibble solution for drupal 5.1 

Possible solution for drupal version5.1

2. Then understand the content.

3. Understant the scripts..

4. If you cannot login using newly created login block... you can always go back and login using the default login block http://your_drupal_site_name.com/?q=user

5. and most important... dont be rude... 

 

Agree

I agree with the entire comment above. 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.

Custom login script rocks!

Awesome. Just what I was looking for!

I added your node link to the drupal site

http://drupal.org/node/92657

specifically here http://drupal.org/node/92657#comment-195824

Possible solution for drupal version5.1

This is may be another solution / alternative custome login block for drupal version 5

http://www.nossdutytask.com/node/240

drupal

Thank you for useful information for users of drupal.

Recent versions of Drupal

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

 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

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

Perfect

This is exactly what I needed thanks for posting it.

Interesting Post!

I am presently diversifying my research and thus cannot contribute further; even so, I’ve bookmarked your web site and will be returning to keep up with any future updates. Just Now love it and thanks for granting my remark.site analytics

Great article

I was trying to figure this out for the last few days. You saved me from going mad.
Bumper Stickers Quotes

Very useful!

I've been using Wordpress for years and have only just started looking at Drupal, so this article was very helpful. Thanks!

Yesss!

Hey - thanks, this was quite helpful, just what i needed!

Nice Script

I have been trying to figure this out myself, and this is a life saver ,thanks to you all for supplying this.

Is there any way where i can

Is there any way where i can achieve the above with drupal 6 without having to create a module?

Thanks so much for this! I

Thanks so much for this! I have not been this thrilled by a blog post for quite some time! You’ve got it, whatever that means in blogging. Anyway, You’re definitely someone that has something to say that people should hear. Keep up the wonderful job. Keep on inspiring the people!very useful info for me.Because i'm new in blogging and i'm need good tutorial like your post. Nice to visit here, and don't forget to visit our blog to and give me more spirit to continue my blogging activities.I really loved reading your blog.rhce latest dumps/scjp brain dumps/security+ dumps/sk0-003 dumps/dumps sscp/sy0-201 free braindumps/vcp-410 braindump/vmware dumps

I am keen to get best updates

I am keen to get best updates about important things.Please do send me email about these updates.wood crusher

I walk away with tralala

I walk away with tralala bijuterii argint.

I prefer variant 3... It is

I prefer variant 3... It is more elegant in comparison with the others.

Recent versions of Drupal

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,

 I am using drupal 5.1 and I

 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 , then this custom login block doesn't work anymore. Its got me stumped... If anyone has any suggestions, I would really appreciate it.

I agree with the entire

I agree with the entire comment above. 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.

igrice

Thanks

Thanks to all the commenters here....I was about to implement this code and then read the comments which helped me avoid all the problems that others had. Thanks again

Worx Cordless Electric Lawn Mowers.

I need to point out my

I need to point out my appreciation for your generosity supporting females who totally need to have help with this question. Your special commitment to passing the answer throughout was remarkably functional and has continually helped associates just like me to attain their ambitions. Your remarkable warm and helpful suggestions signifies this considerably to me and specifically to my colleagues. Greatest wishes; from every person of us.

Computer Store

days

This code looks great, thanks for the fix club peinguin.Ways to Make Money OnlineÂ
Dried Fruits

Nice Information

I never ever read such an informative blog here not only blog post is available for reading and learning but also diagram illustration also available for learning.Essays Help

Cn900 pro 7935 chip Can use

Cn900 pro 7935 chip Can use for CN900 Auto Key Programmer. It can be erased to copy 7935 chip repeatedly. That means it can copy 7935 chip many times and unlimited, It reduce locksmith on cost when make a bad copy.

The standard release of

The standard release of Drupal known as Drupal core, contains basic features common to content management systems.

i want to loggin my face book account

i want to loggin my face book account but some security problems it is not loggi9ng and my account is hacked i want to solve this matter please help me

great

I have read many blogs on the same topic, but the way this one defines the things that is really appreciate able. What a lovely speech.

great

The pack is expected to be the solid way out from many counterfeiting practices in the international trade and I believe people should be able to take full benefit from this situation.
* thành lập doanh nghiệp
* dich vu ke toan
* dịch vụ kế toán

great

This blog is really an amazing blog which i really appreciate from my hearth and i have shared its link to my friends as well.

I am really not too familiar

I am really not too familiar with this subject but I do like to visit blogs for layout ideas. You really expanded upon a subject that I usually don’t care much about and made it very exciting. This is a unique blog that I will take note of. I already bookmarked it for future reference.Thank you..5 htp benefits for health

TestoRipped

that blog consist great thought and some nice article nice to search this blog..............
thanx and keep going on.............

SlimQuick

want to say that I dont think Ive read anything so true in a long time. Youve got a lot of great ideas, a great deal of perspective. I think that you definitely have something important to say and Im gonna back it 110%, man. Good job keeping this subject alive and interesting!

apidexin

Your Blog is awesome. I thoroughly enjoyed your post and will keep my eyes open for updates. Keep up the good work! Thanks.

bioslim

A very informative site .
The way you have share this information is really very appreciative . Hope to see more on this topic here .
Thanks for posting this information here.

Post new comment

The content of this field is kept private and will not be shown publicly.
By submitting this form, you accept the Mollom privacy policy.

Custom Search