function user_load_by_name

7.x user.module user_load_by_name($name)

Fetch a user object by account name.

Parameters

$name: String with the account's user name.

Return value

A fully-loaded $user object upon successful user load or FALSE if user cannot be loaded.

See also

user_load_multiple()

17 calls to user_load_by_name()
comment_form_validate in drupal-7.x/modules/comment/comment.module
Validate comment form submissions.
comment_preview in drupal-7.x/modules/comment/comment.module
Generate a comment preview.
comment_submit in drupal-7.x/modules/comment/comment.module
Prepare a comment for submission.
DBLogTestCase::doUser in drupal-7.x/modules/dblog/dblog.test
Generates and then verifies some user events.
LocaleUserCreationTest::testLocalUserCreation in drupal-7.x/modules/locale/locale.test
Functional test for language handling during user creation.

... See full list

File

drupal-7.x/modules/user/user.module, line 397
Enables the user registration and login system.

Code

function user_load_by_name($name) {
  $users = user_load_multiple(array(), array('name' => $name));
  return reset($users);
}