function fbconnect_login_register_form_submit in Facebook Connect 7.2
Same name and namespace in other branches
- 8.2 fbconnect_login/fbconnect_login.pages.inc \fbconnect_login_register_form_submit()
_state
Parameters
$form:
Throws
\Exception
1 call to fbconnect_login_register_form_submit()
- fbconnect_login_authorize_page in fbconnect_login/
fbconnect_login.pages.inc - Menu callback. Called when user perform Facebook registration
1 string reference to 'fbconnect_login_register_form_submit'
- fbconnect_login_authorize_page in fbconnect_login/
fbconnect_login.pages.inc - Menu callback. Called when user perform Facebook registration
File
- fbconnect_login/
fbconnect_login.pages.inc, line 258 - User pages callbacks for the fbconnect module.
Code
function fbconnect_login_register_form_submit($form, &$form_state) {
$fbuid = fbconnect_get_fbuid();
if (_is_fbconnect_user($fbuid)) {
drupal_set_message(t('Retrying registration. Your Facebook account is already assigned to one account on our site.'), '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_login_register($user->uid, $fbuid);
$data['data']['fb_avatar'] = isset($form_state['values']['fb_avatar']) ? $form_state['values']['fb_avatar'] : 0;
$data['data']['fb_visible'] = $form_state['values']['fb_visible'];
$user = user_save($user, $data);
$form_state['uid'] = $user->uid;
user_login_submit(array(), $form_state);
$_SESSION['fbconnect_feed']['type'] = 'register';
$conf = fbconnect_get_config();
if ($conf['fast_reg_mode']) {
drupal_goto('user');
}
}