You are here

function login_disable_user_login in Login Disable 7

Same name and namespace in other branches
  1. 8 login_disable.module \login_disable_user_login()
  2. 2.0.x login_disable.module \login_disable_user_login()

Implements hook_user_login().

File

./login_disable.module, line 88

Code

function login_disable_user_login(&$edit, $account) {
  if (variable_get('login_disable_is_active', FALSE)) {

    // If user is not allowed to bypass then log them out
    if (user_access('bypass disabled login') == FALSE) {
      drupal_set_message(variable_get('login_disable_message', t('Member access has been temporarily disabled. Please try again later.')), 'warning');
      module_load_include('pages.inc', 'user');
      user_logout();
      exit;
    }
  }
}