I have a situation where after doing the basic registration the user is redirected to a page where he needs to fill a small form.
I aim at implementing the hook_user_insert()
and hook_menu()
to do something like this
function registration_user_insert(&$edit, $account, $category){
drupal_goto('splan/'.$edit['uid']);
}
function registration_menu() {
$items['splan/%'] = array(
'title' => 'Select a Plan',
'page callback' => 'drupal_get_form',
'page arguments' => array('selectplan_form'),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
return $items;
}
In selectplan_form()
I will define my new form and then, using the user ID, I would save data into user table.
The basic user registration form is being submitted, the user is redirected to splan/uid, but I also get the following error.
You are not authorized to access this page.
I have changed permissions to allow anonymous users to create and edit webform, but the problem still persists.