<p>Getter of user name.</p>
@return User name if he/she logged
162652
@Override
  public final String getUserName() {
    if (httpReq.getUserPrincipal() != null) {
      return httpReq.getUserPrincipal().getName();
    }
    return null;
  }
60142
def username(self):
        
        if self._username is None:
            if self.has_logged_in:
                self._username = self._get_username()
            else:
                raise AuthenticationError('Not logged in.')
        return self._username
26638
public String getName()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getName");
    String name = null;
    if(_outputHandler!=null)
    {
      name = _outputHandler.getDestinationName();
    }
    else
    {
      name = _anycastInputHandler.getDestName();
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getName", name);
    return name;  
  }
456174
def get_user_name():
    

    if sys.platform == 'win32':
        #user = os.getenv('USERPROFILE')
        user = os.getenv('USERNAME')
    else:
        user = os.getenv('LOGNAME')

    return user
267553
private String username( String username ) {
        return (username.startsWith("<") && username.endsWith(">")) ? username.substring(1, username.length() - 1) : username;
    }
447200
public Principal getUserPrincipal()
    {
        if (_userPrincipal == __NO_USER) return null;

        if (_userPrincipal == __NOT_CHECKED)
        {
            _userPrincipal = __NO_USER;

            // Try a lazy authentication
            HttpContext context = getHttpResponse().getHttpContext();
            if (context != null)
            {
                Authenticator auth = context.getAuthenticator();
                UserRealm realm = context.getRealm();
                if (realm != null && auth != null)
                {
                    try
                    {
                        // TODO - should not need to recalculate this!
                        String pathInContext = getPath().substring(
                                context.getContextPath().length());
                        auth.authenticate(realm, pathInContext, this, null);
                    }
                    catch (Exception e)
                    {
                        LogSupport.ignore(log, e);
                    }
                }
            }

            if (_userPrincipal == __NO_USER) return null;
        }
        return _userPrincipal;
    }
932652
public String getUserName(boolean notAlternateUser) 
  {
    if (tc.isEntryEnabled()) 
       SibTr.entry(tc, "getUserName", 
         new Object[]{new Boolean(notAlternateUser)});
                   
    String userName = null;
    
    if(!notAlternateUser // this catches the case where we want the
                         // user associated with the subject
       && isAlternateUserBased())                             
    {       
      userName = alternateUser;
    }
    else if(isSubjectBased())
    {     
      if(authorisationUtils != null)
      {
        userName = authorisationUtils.getUserName(subject);
      }      
    }
    else if(isUserIdBased())
    {       
      userName = userId;
    }
    else if(isMsgBased())
    {       
      userName = msg.getSecurityUserid();
    }
 
    if (tc.isEntryEnabled()) 
       SibTr.exit(tc, "getUserName", userName);        
    return userName;
  }
160992
def __getUsername(self):
        """"""

        if self._securityHandler is not None and \
           not self._securityHandler._username is None:
            return self._securityHandler._username
        elif self._securityHandler is not None and \
               hasattr(self._securityHandler, "org_url") and \
               self._securityHandler.org_url is not None:
            from .administration import Administration
            user = Administration(url=self._securityHandler.org_url,
                                  securityHandler=self._securityHandler,
                                  proxy_url=self._proxy_url,
                                  proxy_port=self._proxy_port).portals.portalSelf.user
            return user['username']
        else:
            from .administration import Administration
            url = self._url.lower().split('/content/')[0]
            user = Administration(url=url,
                                  securityHandler=self._securityHandler,
                                  proxy_url=self._proxy_url,
                                  proxy_port=self._proxy_port).portals.portalSelf.user
            return user['username']
481636
public User get(String name) {

        User user = (User) userList.get(name);

        if (user == null) {
            throw Error.error(ErrorCode.X_28501, name);
        }

        return user;
    }
699565
@Nullable
  public IUser getUserOfLoginName (@Nullable final String sLoginName)
  {
    if (StringHelper.hasNoText (sLoginName))
      return null;

    return findFirst (x -> x.getLoginName ().equals (sLoginName));
  }
866468
public Long getLoggedUserId() {
    HttpSession session = getRequest().getSession(false);
    return session == null ? null : (Long) session.getAttribute("loggedUserId");
  }
591537
public String determineUsername() {
		if (CollectionUtils.isEmpty(this.parsedAddresses)) {
			return this.username;
		}
		Address address = this.parsedAddresses.get(0);
		return (address.username != null) ? address.username : this.username;
	}
457821
public String getUserName()
    {
        String strUserName = null;
        Record recUserInfo = (Record)this.getUserInfo();
        if (recUserInfo != null)
            strUserName = recUserInfo.getField(UserInfoModel.USER_NAME).toString();
        if ((strUserName == null) || (strUserName.length() == 0))
            strUserName = super.getUserName();
        return strUserName;
    }
1221070
@Deprecated
    public List<String> getUsers() {
        String value = getParameter(UsernameActivationStrategy.PARAM_USERS);
        if (Strings.isNotBlank(value)) {
            return Strings.splitAndTrim(value, ",");
        }
        return Collections.emptyList();
    }
560882
public static @Nullable @CheckForNull String getCurrentUsername() {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if (authentication == null) {
      return null;
    }
    return getUsername(authentication);
  }
1308769
private static String getCurrentUserName() {
        Authentication a = SecurityContextHolder.getContext().getAuthentication();
        if (a == null) return null;
        org.springframework.security.core.userdetails.User u =
                (org.springframework.security.core.userdetails.User)
                        a.getPrincipal();
        if (u == null) return null;
        return u.getUsername();
    }
1094709
public String getSessionUserName(HttpServletRequest request, HttpServletResponse response)
    {
        HttpSession session = null;

        SessionAffinityContext sac = getSessionAffinityContext(request);

        if (!sac.isFirstSessionIdValid() && !sac.isAllSessionIdsSetViaSet()) { //PM89885
            @SuppressWarnings("rawtypes")
            List allSessionIds = _sam.getAllCookieValues(request);
            sac.setAllSessionIds(allSessionIds);
            _sam.setNextId(sac); // we got rid of the first one in setAllSessionIds, get the next one so that we have an id to work with
        }

        String id = _sam.getInUseSessionID(request, sac);

        if (id != null) {
            session = (HttpSession) _coreHttpSessionManager.getSession(request, response, sac, false); // don't create here
        }
        if( session != null ){
            SessionData sd = (SessionData) session;
            return sd.getUserName();            
        } else{
            return null;
        }
    }