User role specific login link This may sound like a strange question but it is desired functionality from a client. They would like to have a login screen that only staff members can log in through. What I mean by that is if an anonymous user logs in, and if their role is staff (or admin) then they are logged in. If it is any other role, then they are not logged in and redirected to a 'normal' login page.

I know this seems unorthodox but is there a way to accomplish this?

Thanks.
Which ever role you want to allow to login give the role the permission.

Drupal 6

Please change the permission to an appropriate one. This is just for test purpose.

function modulename_perm() {
  return array('allow modulename login');
}

function modulename_user($op, &amp;$edit, &amp;$account, $category = NULL) {
  if ($op == 'login') {
    if (user_access('allow modulename login') == FALSE) {
      drupal_set_message('Member logins have been temporarily disabled. Please try again later.', 'warning');
      user_logout();
      exit;
    }
  } 
}


DRUPAL 7

function modulename_permission() {
  return array(
    'allow modulename login' =&gt; array(
      'title' =&gt; t('allow modulename login'), 
      'description' =&gt; t('allow modulename login.'),
    ),
  );
}
function modulename_user_login(&amp;$edit, $account) {
 if (user_access('allow modulename login') == FALSE) {
      drupal_set_message('Member logins have been temporarily disabled. Please try again later.', 'warning');
      user_logout();
      exit;
 }
}