2

The first time that the user login to the page, have to be redirected to the user edit profile to fill a field (Id) that is mandatory at the first login, I tryed using drupal_goto at hook_user_insert and hook_user_presave and don't worked. How can I do that? In which hook I can do that?

EDIT: I am using LDAP Authentication, user don't have to fill a form registration.

1
  • Have you tried using the Rules module? You should be able to react to a user login and set an action to redirect to the appropriate path
    – Clive
    Nov 22, 2013 at 16:29

1 Answer 1

1

Thanks for your answers, I could do it, no with Rules module. I did it using hook_user_login(), and $_GET['destination'].

    function webform_sub_user_login(&$edit, $account) {
    $currentuser = $edit['uid'];
    $_GET['destination']= "/user/".$currentuser."/edit";
    }

If it can cause problems, let me know. But for now it seems to work well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.