You are here

function user_is_blocked in Drupal 4

Same name and namespace in other branches
  1. 8 core/modules/user/user.module \user_is_blocked()
  2. 5 modules/user/user.module \user_is_blocked()
  3. 6 modules/user/user.module \user_is_blocked()
  4. 7 modules/user/user.module \user_is_blocked()
  5. 9 core/modules/user/user.module \user_is_blocked()

Checks for usernames blocked by user administration

Return value

boolean true for blocked users, false for active

1 call to user_is_blocked()
user_login_validate in modules/user.module

File

modules/user.module, line 371
Enables the user registration and login system.

Code

function user_is_blocked($name) {
  $allow = db_fetch_object(db_query("SELECT * FROM {users} WHERE status = 1 AND name = LOWER('%s')", $name));
  $deny = db_fetch_object(db_query("SELECT * FROM {users} WHERE status = 0 AND name = LOWER('%s')", $name));
  return $deny && !$allow;
}