function user_is_blocked
Same name in other branches
- 9 core/modules/user/user.module \user_is_blocked()
- 8.9.x core/modules/user/user.module \user_is_blocked()
- 10 core/modules/user/user.module \user_is_blocked()
- 11.x core/modules/user/user.module \user_is_blocked()
Checks for usernames blocked by user administration.
Parameters
$name: A string containing a name of the user.
Return value
Object with property 'name' (the user name), if the user is blocked; FALSE if the user is not blocked.
1 call to user_is_blocked()
- user_login_name_validate in modules/
user/ user.module - A FAPI validate handler. Sets an error if supplied username has been blocked.
File
-
modules/
user/ user.module, line 850
Code
function user_is_blocked($name) {
return db_select('users')->fields('users', array(
'name',
))
->condition('name', db_like($name), 'LIKE')
->condition('status', 0)
->execute()
->fetchObject();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.