In login_disable_form_user_login_alter(), drupal_set_message() is called to display the login disabled message) even when the user is allowed to login:

function login_disable_form_user_login_alter(&$form, &$form_state) {
  if (variable_get('login_disable_is_active', FALSE)) {
    $key = variable_get('login_disable_key', 'admin');

    // If the key is set, block people from logging in if it was not passed as
    // an argument in the URL.
    if (!empty($key) && !array_key_exists($key, $_GET)) {
      $form['name']['#disabled'] = 'disabled';
      $form['pass']['#disabled'] = 'disabled';
      unset($form['#validate']);
      unset($form['#submit']);
      unset($form['action']);
    }

    drupal_set_message(variable_get('login_disable_message', t('Member access has been temporarily disabled. Please try again later.')), 'warning', FALSE);
  }
}

A patch is attached to move drupal_set_message() to the appropriate block so it is only displayed when login is blocked.

Comments

interdruper’s picture

Status: Needs review » Reviewed & tested by the community

Patch works fine for me.

nehajyoti’s picture

Patch applied cleanly and works fine. Applying patch to dev release.

  • nehajyoti committed 12b9f11 on 7.x-1.x authored by wonder95
    Issue #2375073 by wonder95, interdruper, nehajyoti: Logn disabled...
nehajyoti’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

gsquirrel’s picture

Did this fix get lost - I have same issue with current version and it appears the drupal_Set_message is back in the wrong place?