--- 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 @@
 <?php
 // $Id: loginmenu.module,v 1.2 2006/11/19 20:30:05 rwohleb Exp $
+// for drupal 6.x
 
-function loginmenu_help($section) {
+/**
+ * Implementation of hook_help().
+ */
+function loginmenu_help($path, $arg) {
   $output = '';
-  switch ($section) {
+  switch ($path) {
     case 'admin/modules#description':
       $output .= t('Generates a login link for anonymous users');
       break;
@@ -16,30 +20,30 @@
   }
   return $output;
 }
-/* Implements hook_menu
-* Returns a menu hook with access set to NOT(userid)
-* Since anonymous has uid 0, this will be true for anon
+
+/**
+ * Implementation of hook_menu().
 */
-function loginmenu_menu($may_cache) {
-  global $user;
-  $items = array();
-  if($may_cache){
-    $items[] = array(
-      'path'      =>  '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) );
+}
+
