You are here

function fb_form_alter in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 5.2 fb.module \fb_form_alter()
  2. 5 fb.module \fb_form_alter()

File

./fb.module, line 607

Code

function fb_form_alter(&$form, &$form_state, $form_id) {

  // Because facebook users don't have email, it can't be required on user form
  if ($form_id == 'user_register') {
    if (user_access('administer users')) {
      $form['mail']['#required'] = FALSE;
    }
  }
  if ($form_id == 'user_edit') {
    if (user_access('administer users')) {
      $form['account']['mail']['#required'] = FALSE;
    }
  }
}