You are here

function notifications_user_name2uid in Notifications 7

Same name and namespace in other branches
  1. 6.4 includes/user.inc \notifications_user_name2uid()

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_by_name($name)) {
    return $account->uid;
  }
  elseif ($field) {
    form_set_error($field, t('User name not found.'));
  }
}