20 Jun
2007
20 Jun
'07
5:35 p.m.
Hi,
I've never done what you're suggesting in a template, but I use exactly that strategy in my cas module. (make a simple module that runs implements hook_init() that does this check, and redirects the user with "drupal_goto".
Thanks for that: it worked, but as written it put the browser into an infinite-redirect loop (is drupal_goto() meant to avoid that?) Changing the if statement to: if ((!$user->uid) && ($_GET['q'] != 'user/login')) fixed the loop. I suppose e.g. (arg(0) != "user") instead would permit user/register to be visited? Cheers, J-P