Drupal 6 Custom Login in block PHP Code

webadmin's picture
Drupal

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');
}
?>

Baca Juga

14 years 6 months ago
12 years 6 months ago
14 years 6 months ago