I need to redirect an anonymous user when they hit the url 'node/add/project' to 'user/login' - otherwise, just leave them enter that url.
Not sure if I'm going about this the correct way (probably not as it doesn't appear to work!) - Can someone shed some light, or advice!
function local_menu() { $items['node/add/project'] = array( 'page callback' => 'local_project_anonymous', 'access callback' => TRUE, 'type' => MENU_CALLBACK, ); return $items; } function local_project_anonymous(){ global $user; if($user->uid == 0){ drupal_goto('user/login'); } }
Cheers