You are here

function notifications_user_name2uid in Notifications 6.4

Same name and namespace in other branches
  1. 7 includes/user.inc \notifications_user_name2uid()
1 string reference to 'notifications_user_name2uid'
notifications_notifications in ./notifications.module
Implementation of hook_notifications()

File

includes/user.inc, line 23
Notifications node API for use by plug-in modules providing user related features

Code

function notifications_user_name2uid($name, $field = NULL) {
  if ($account = user_load(array(
    'name' => $name,
  ))) {
    return $account->uid;
  }
  elseif ($field) {
    form_set_error($field, t('User name not found.'));
  }
}