I created a webform for which I need all the submitted fields with values on the confirmation page after the user submitted the form. I am using WebForm 7.3.
The user when confirms the information, can make any final change before submitting it (updating the existing one, I guess).
This is what I used and placed it in the template.php but sadly it doesn't work:-
function user_register_webform_submission_insert($node, $submission){
// Load information about form components
$comps = $node->webform['components'];
$fields = array();
//Extract the component info to get form_key=>cid to resolve relation
foreach($comps as $cid => $comp_info){
$fields[$comp_info['form_key']] = $cid;
}
// Load the submitted data (field values)
$data = $submission->data;
//Prepare a user info
$user = array(
'mail' => $data[$fields['mail']]['value'][0],
'name' => $data[$fields['name']]['value'][0],
'pass' => user_password(8),
'status' => 1,
'init' => $data[$fields['mail']]['value'][0],
'roles' => array(2, 3),
);
$account = user_save(null, $user);
}