Determine the name to use in the password reset email that identifies the users whose
password has been reset.

@param person the account that has had its password reset
@return the account holders name
494914
protected String findDisplayNameFromLocalAccountPerson(ILocalAccountPerson person) {
        Object name = person.getAttributeValue(ILocalAccountPerson.ATTR_DISPLAY_NAME);
        if ((name instanceof String) && !StringUtils.isEmpty((String) name)) {
            return (String) name;
        }

        // if display name is not set, just return username.
        return person.getName();
    }
686680
public DOAuth2User findByEmail(java.lang.String email) {
    return queryUniqueByField(null, DOAuth2UserMapper.Field.EMAIL.getFieldName(), email);
  }
314362
public static String fullName(User user) {
    StringJoiner name = new StringJoiner(" ");

    if (!isEmpty(user.getFirstName()))
      name.add(user.getFirstName());
    if (!isEmpty(user.getLastName()))
      name.add(user.getLastName());

    return name.toString();
  }
821530
public String getUserName(CmsObject cms) {

        String userName = getUserId().toString();
        try {
            userName = cms.readUser(getUserId()).getName();
        } catch (CmsException e) {
            // ignore
        }
        return userName;
    }
1161878
async def reset_user_password(self, username):
        
        user_facade = client.UserManagerFacade.from_connection(
            self.connection())
        entity = client.Entity(tag.user(username))
        results = await user_facade.ResetPassword([entity])
        secret_key = results.results[0].secret_key
        return await self.get_user(username, secret_key=secret_key)
353801
def get_user(self, name):
        """"""
        users = self.data['users']
        for user in users:
            if user['name'] == name:
                return user
        raise KubeConfError("user name not found.")
1074483
private String primGetName(String key) {
        String name = key;
        final IPersonAttributes personAttributes = this.paDao.getPerson(name);
        if (personAttributes != null) {
            Object displayName = personAttributes.getAttributeValue("displayName");
            String displayNameStr = "";
            if (displayName != null) {
                displayNameStr = String.valueOf(displayName);
                if (StringUtils.isNotEmpty(displayNameStr)) {
                    name = displayNameStr;
                }
            }
        }
        return name;
    }
3747
@Override
    public String getUserName(HttpServletRequest req) {
        Principal princ = null;
        if (req != null && (princ = req.getUserPrincipal()) != null) {
            String userName = princ.getName();
            if (userName != null && !userName.isEmpty()) {
                LOG.debug("HTTP request had user (" + userName + ")");
                return userName;
            }
        }
        return null;
    }
1262287
private function emailToUsername($email = null)
    {
        if ($user = get_user_by('email', $email)) {
            if (isset($user->user_login)) {
                return $user->user_login;
            }
        }

        return null;
    }
1253254
protected IAuthorizationPrincipal getPrincipalForUser(final IPerson person) {
        final EntityIdentifier ei = person.getEntityIdentifier();
        return AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType());
    }
1368929
def user_name(self, user_id):
        """"""
        user = self.users.get(user_id)

        if user is None:
            return "Unknown user ({})".format(user_id)

        return user["name"]
838885
protected String getDnForUser(String userId) {
    LdapUserEntity user = (LdapUserEntity) createUserQuery(org.camunda.bpm.engine.impl.context.Context.getCommandContext())
      .userId(userId)
      .singleResult();
    if(user == null) {
      return "";
    } else {
      return user.getDn();
    }
  }
20919
public User findUser(final String userIdentifier)
    {
        User result = null;
        User user;
        
        for(int i = 0; (result == null) && (i < this.getUsers().size()); i++)
        {
            user = this.getUsers().get(i);
            
            if(user.getIdentifier().equals(userIdentifier))
            {
                result = user;
            }
        }
        
        return result;
    }
366169
public User get(String loginname, String password) {
        Connection conn = null;
        User user = null;
        if (loginname == null || password == null) return null;
        String cryptpassword = MD5.encodeString(password,null);
        try {
            conn = ConnectionUtils.getConnection();
            user = userDAO.get(conn,loginname,cryptpassword);
        } catch(SQLException e) {
            logger.error(e.getMessage());
        } finally {
            DbUtils.closeQuietly(conn);
        }
        return user;
    }
176053
public Person nextPerson() {
		if(!initialized) { init(); }

		Person person = new Person();
		Gender gender = this.gender == null ? (random.nextBoolean() ? Gender.FEMALE : Gender.MALE) : this.gender;
		person.setGender(gender);
		List<String> givenNamesPool = gender == Gender.FEMALE ? givenFemaleNames : givenMaleNames;
		List<String> givenNames = new ArrayList<String>(2);
		givenNames.add(getNameWord(givenNamesPool));
		givenNames.add(getNameWord(givenNamesPool));
		person.setGivenNames(givenNames);
		person.setLastName(getNameWord(lastNames));
        generateDOB(person);
        Map<String, Object> spewDetails = generateSpewDetails(person);
        person.setUsername(usernameGenerator.nextLine(spewDetails));
        spewDetails.put("USERNAME", person.getUsername());
        person.setEmail(emailGenerator.nextLine(spewDetails));
        person.setTwitterUsername(random.nextInt(2) == 1 ? "@" + usernameGenerator.nextLine(spewDetails) : null);
        return person;
	}
1228409
public static String getUserName() throws Exception {
        Subject subject = getRunAsSubjectInternal();
        if (subject == null) {
            return null;
        }
        Set<Principal> principals = subject.getPrincipals();
        Iterator<Principal> principalsIterator = principals.iterator();
        if (principalsIterator.hasNext()) {
            Principal principal = principalsIterator.next();
            return principal.getName();
        }
        return null;
    }
869394
@Override
    public IPersonAttributes getOriginalUserAttributes(String uid) {
        final IPersonAttributeDao delegatePersonAttributeDao =
                this.portalRootPersonAttributeDao.getDelegatePersonAttributeDao();
        return delegatePersonAttributeDao.getPerson(uid);
    }