You are here

function openid_connect_username_exists in OpenID Connect / OAuth client 7

Same name and namespace in other branches
  1. 8 openid_connect.module \openid_connect_username_exists()

Check if a user name already exists.

Parameters

string $name: A name to test.

Return value

bool TRUE if a user exists with the given name, FALSE otherwise.

1 call to openid_connect_username_exists()
openid_connect_generate_username in ./openid_connect.module
Generate a username for a new account.

File

./openid_connect.module, line 416
A pluggable client implementation for the OpenID Connect protocol.

Code

function openid_connect_username_exists($name) {
  return db_query('SELECT COUNT(*) FROM {users} WHERE name = :name', array(
    ':name' => $name,
  ))
    ->fetchField() > 0;
}