$name))) { return $account->uid; } elseif ($field) { form_set_error($field, t('User name not found.')); } } /** * Check user access to user * * @param $user * Target user account to check access to * @param $account * User account who wants to access */ function notifications_user_user_access($user, $account) { return $user && $user->uid && ( // Always let users view their own profile. ($user->uid == $account->uid) || // Administrators can view all accounts. user_access('administer users', $account) || // The user is not blocked and logged in at least once. ($user->access && $user->status && user_access('access user profiles', $account)) ); }