I just had a thought, as this is a 'dangerous' thing to do, I want to make sure that it's done right.
If another user is logged in when they confirm their signup, then it's that other user that will be updated.
My thought is to compare the currently logged in user's email address with the email address given in the form
Something like this
Code:
if ($juser->email == $form->data['email1']) {
$user->name = $form->data['navn1'];
$user->cb_cell = $form->data['mobil1'];
$user->cb_adresse = $form->data['adresse1'];
$user->cb_postnummer = $form->data['post1'];
$user->cb_birthday = $form->data['foedsel1'];
$user->store();
};
Or maybe via CB:
Code:
if ($cbUser->getField( 'email', null, 'html', 'none', 'profile' ) == $form->data['email1']) {
Neither of these seems to be 'true' and perform the update.