You are here

function user_is_blocked in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/user.module \user_is_blocked()

Checks for usernames blocked by user administration.

Parameters

string $name: A string containing a name of the user.

Return value

bool TRUE if the user is blocked, FALSE otherwise.

1 call to user_is_blocked()
UserLoginForm::validateName in core/modules/user/src/Form/UserLoginForm.php
Sets an error if supplied username has been blocked.

File

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

Code

function user_is_blocked($name) {
  return (bool) \Drupal::entityQuery('user')
    ->condition('name', $name)
    ->condition('status', 0)
    ->execute();
}