Drupal 6 Custom Login in block PHP Code

This is a very simple block to display a link to the login page when the user is not logged in and to display a logout link when the user is logged in. Create a custom block and set the input filter to php.

<?php
 global $user;
 if ($user->uid) {
   print l("Log Out " . $user->name,"logout");
 } else {
   print drupal_get_form('user_login_block');
 }
?>

Add new comment

Visit also our brothers site :

Scroll to top

Copyright © 2012. All rights reserved
By GLOBAL9 Networks

Bisnisapa.com