You are here

function drop_down_login_validate_login in Drop Down Login 7

Validate function to validate login form.

1 string reference to 'drop_down_login_validate_login'
drop_down_login_form_alter in ./drop_down_login.module
Implements hook_form_alter().

File

./drop_down_login.module, line 168
Module file for Drop Down Login.

Code

function drop_down_login_validate_login($form, &$form_state) {

  // On successful login, the uid is set in form_state.
  if (empty($form_state["uid"])) {
    $attributes = array();
    if (!drupal_is_front_page()) {

      // No query string passed for homepage.
      $attributes = array(
        'query' => drupal_get_destination(),
      );
    }
    unset($_GET['destination']);
    drupal_static_reset('drupal_get_destination');
    drupal_get_destination();
    $form_state['redirect'] = array(
      'user',
      $attributes,
    );
    drupal_redirect_form($form_state);
  }
}