Drupal toggle

login logout toggle.

make 2 menu options in the Primary Links menu, weights -10.

The core Drupal permissions will only allow the logout link to appear when currently logged in, and the user/login link to appear only when not logged in. It will appear to toggle, but it is just being replaced as permissions dictate.


<?php
global $user;

if ($user->uid) 
{
hello 
print l($user->name,'user/'.$user->uid);
print l("logout","logout");//this is logout link
} else 
  {
//show login form
  }
?>