function fbconnect_register_form_submit in Facebook Connect 6.2
Same name and namespace in other branches
- 5 fbconnect.module \fbconnect_register_form_submit()
- 6 fbconnect.pages.inc \fbconnect_register_form_submit()
@todo.
1 call to fbconnect_register_form_submit()
- fbconnect_register_page in ./
fbconnect.pages.inc - Menu callback. Called when user perform facebook registration
1 string reference to 'fbconnect_register_form_submit'
- fbconnect_register_page in ./
fbconnect.pages.inc - Menu callback. Called when user perform facebook registration
File
- ./
fbconnect.pages.inc, line 143 - User pages callbacks for the fbconnect module.
Code
function fbconnect_register_form_submit($form, &$form_state) {
$fbuid = fbconnect_get_fbuid();
if (_fbconnect_is_user($fbuid)) {
$msg = t("Retrying registration. Your Facebook account already assigned to one account on our site");
drupal_set_message($msg, 'error');
watchdog('fbconnect', 'Error creating account for @fbuid', array(
'@fbuid' => $fbuid,
), WATCHDOG_ALERT);
drupal_goto();
}
if (variable_get('fbconnect_fast_reg', NULL)) {
$user = user_save(NULL, $form_state['values']);
}
else {
$user = $form_state['user'];
}
if (!$user) {
drupal_set_message(t("Error saving user account."), 'error');
drupal_goto();
}
fbconnect_register($user->uid, $fbuid);
$data['fb_avatar'] = isset($form_state['values']['fb_avatar']) ? $form_state['values']['fb_avatar'] : 0;
$data['fb_visible'] = $form_state['values']['fb_visible'];
user_save($user, $data);
user_external_login($user);
$_SESSION['fbconnect_feed']['type'] = 'register';
}