You are here

function fb_form_alter in Drupal for Facebook 5.2

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

File

./fb.module, line 501

Code

function fb_form_alter($form_id, &$form) {

  // 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;
    }
  }
}