You are here

function _hybridauth_check_additional_info in HybridAuth Social Login 6.2

Same name and namespace in other branches
  1. 7.2 hybridauth.pages.inc \_hybridauth_check_additional_info()
1 call to _hybridauth_check_additional_info()
_hybridauth_window_process_auth in ./hybridauth.pages.inc
Handle the Drupal authentication.

File

./hybridauth.pages.inc, line 305

Code

function _hybridauth_check_additional_info($data) {
  $show_form = FALSE;
  if (variable_get('hybridauth_registration_username_change', 0) && empty($data['username'])) {
    $show_form = TRUE;
  }
  $required_fields = array_filter(variable_get('hybridauth_required_fields', array(
    'email' => 'email',
  )));
  foreach ($required_fields as $key => $value) {
    if (empty($data[$key]) && !($data[$key] === 0)) {
      $show_form = TRUE;
      break;
    }
  }
  if ($show_form) {
    $form = drupal_get_form('hybridauth_additional_info_form', $data);

    // theme('page', $content, $show_blocks, $show_messages)
    print theme('page', $form, FALSE, TRUE);
    exit;
  }
}