--- loginmenu.module.org 2007-04-01 12:16:26.000000000 +0100 +++ loginmenu.module 2007-12-29 19:20:07.000000000 +0000 @@ -1,9 +1,13 @@ 'login', +function loginmenu_menu() { + $items['login'] = array( 'title' => t('Log in'), 'description' => t('Log in'), - 'access' => !($user->uid), - 'callback' => 'drupal_goto', - 'callback arguments' => array('user'), + 'access callback' => 'loginmenu_access', + 'access arguments' => array(1), + 'page callback' => 'loginmenu_loginredirect', + 'page arguments' => array(1), 'type' => MENU_DYNAMIC_ITEM | MENU_NORMAL_ITEM, 'weight' => 10, ); - } return $items; } function loginmenu_loginredirect() { - // the redirect is nessecary, beacuse hijacking user/login here creates a little problem when logging in + // the redirect is necessary, because hijacking user/login here creates a little problem when logging in drupal_goto('user/login'); } -?> \ No newline at end of file + +function loginmenu_access() { + return ((! $GLOBALS['user']->uid) ); +} +