[development] deny user #1

Augustin (Beginner) drupal.beginner at wechange.org
Wed Sep 13 13:47:57 UTC 2006


On Wednesday 13 September 2006 08:53 pm, Gerhard Killesreiter wrote:
> Augustin (Beginner) wrote:
> > On Wednesday 13 September 2006 08:24 pm, Gerhard Killesreiter wrote:
> >> A brute force method is to unset the form and redirect elsewhere in
> >> hook_form_alter if you are processing your node form and uid == 1.
> >
> > thanks Gerhard,
> > I'll try that.
>
> You'll also need to exit() after the redirect or the form would still be
> generated, IIRC.

Apparently, it's not necessary. I did the quick test below, and die() doesn't 
get executed, but if I add a drupal_set_message() to the redirect, then I 
have something that is good enough for my purposes.

function demexp_form_alter($form_id, &$form) {
  if ($form_id == 'demexp_question_node_form') {
    drupal_goto('<front>');
    die('forbidden');
  }
}

thanks,

A.


-- 
http://www.wechange.org/
Because we and the world need to change.
 
http://www.reuniting.info/
Intimate Relationships, peace and harmony in the couple.


More information about the development mailing list