Right after adding the user would be good. You can add a POST hook on "gmail::noauth::join::add_user". There you'll be passed in a hash of the userid and dgraph:
'dgraph.dgraph_last_name' => 'Last Name',
'dgraph.dgraph_zip' => '',
'dgraph.dgraph_userid' => '5',
'dgraph.dgraph_address' => '',
'dgraph.dgraph_city' => '',
'dgraph.dgraph_first_name' => 'First Name',
'dgraph.dgraph_email' => 'foo@example.com',
'dgraph.dgraph_state' => '',
'dgraph.dgraph_country' => '',
'users.userid' => '5'
}You'll want to check that you have users.userid first as the hook will be called even if they weren't added (it's called every time they press the submit button on the Join page).
So your code would look something like:
my $user_data = shift;
return if !$user_data;
# Update the user's data here. Use $DB, and $user_data->{'users.userid'}, etc
return $user_data;
}
Adrian
Code:
{ 'dgraph.dgraph_last_name' => 'Last Name',
'dgraph.dgraph_zip' => '',
'dgraph.dgraph_userid' => '5',
'dgraph.dgraph_address' => '',
'dgraph.dgraph_city' => '',
'dgraph.dgraph_first_name' => 'First Name',
'dgraph.dgraph_email' => 'foo@example.com',
'dgraph.dgraph_state' => '',
'dgraph.dgraph_country' => '',
'users.userid' => '5'
}
So your code would look something like:
Code:
sub defaults_by_domain { my $user_data = shift;
return if !$user_data;
# Update the user's data here. Use $DB, and $user_data->{'users.userid'}, etc
return $user_data;
}
Adrian