Checks for usernames blocked by user administration.
$name: A string containing a name of the user.
Object with property 'name' (the user name), if the user is blocked; FALSE if the user is not blocked.
function user_is_blocked($name) {
return db_select('users')
->fields('users', array(
'name',
))
->condition('name', db_like($name), 'LIKE')
->condition('status', 0)
->execute()
->fetchObject();
}