user_is_blocked($name)
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.
File
- core/modules/user/user.module, line 362
- 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(); }
Please login to continue.