Looks up a user by a session identifier.

@return the user associated with the specified session or null of no session exists with the
supplied identifier.
197133
public User loadUserBySession (String sessionKey)
        throws PersistenceException
    {
        User user = load(_utable, "sessions", "where authcode = '" + sessionKey + "' " +
                         "AND sessions.userId = users.userId");
        if (user != null) {
            user.setDirtyMask(_utable.getFieldMask());
        }
        return user;
    }
493802
public static String getCurrentUser() {
        ServiceContext ctx = ServiceContextStore.get();
        String currentUser;
        if (ctx == null) {
            currentUser = ServiceContextFactory.SYSTEM_USER;
        } else {
            currentUser = ctx.getUserId();
        }

        if (currentUser == null) {
            currentUser = ServiceContextFactory.UNKNOWN_USER;
        }
        return currentUser;
    }
62727
public ApiUser getUser(String name) {
        User sfsUser = CommandUtil.getSfsUser(name, api);
        if(sfsUser == null)
            return null;
        return (ApiUser) sfsUser.getProperty(APIKey.USER);
    }
1345432
public User getUser(String name, String password) {

        if (name == null) {
            name = "";
        }

        if (password == null) {
            password = "";
        }

        User user = get(name);

        user.checkPassword(password);

        return user;
    }
527598
protected Integer getUserId() {
        Integer userId = ThreadContext.getContext(UserWebConstant.CTX_USERID);
        if (userId != null) {
            return userId;
        }
        return null;
    }
560882
public static @Nullable @CheckForNull String getCurrentUsername() {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if (authentication == null) {
      return null;
    }
    return getUsername(authentication);
  }
341176
public User get(int id) {
        Connection conn = null;
        User user = null;
        try {
            conn = ConnectionUtils.getConnection();
            user = userDAO.get(conn,id);
        } catch(SQLException e) {
            logger.error(e.getMessage());
        } finally {
            DbUtils.closeQuietly(conn);
        }
        return user;
    }
777242
public Object lookup(Identity oid)
    {
        Object ret = null;
        if (oid != null)
        {
            ObjectCache cache = getCache(oid, null, METHOD_LOOKUP);
            if (cache != null)
            {
                ret = cache.lookup(oid);
            }
        }
        return ret;
    }
889581
def find_user(session, username):
    """"""
    resp = _make_request(session, FIND_USER_URL, username)
    if not resp:
        raise VooblyError('user not found')
    try:
        return int(resp[0]['uid'])
    except ValueError:
        raise VooblyError('user not found')
619967
public static Object getUser()
    {
        HttpSession session = WebContextFactory.get().getSession(true);
        return session.getAttribute(USER);
    }
1017064
function getUser($sid) {
		if ($this->user == null) {
			$this->user = $this->getUserFromSession($sid);
		}
        return $this->user;
    }
189039
def get_user(self, name):
        
        try:
            return self._user_manager.get(name)
        except exc.NotFound:
            raise exc.NoSuchDatabaseUser("No user by the name '%s' exists." %
                    name)
736358
protected function getUser()
    {
        if ($this->_user === null) {
            $this->_user = User::findByUsername($this->username);
        }

        return $this->_user;
    }
1304773
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiUser> T getUserById(int id) {
	    User sfsUser = getZone().getUserById(id);
	    if(sfsUser != null && sfsUser.containsProperty(APIKey.USER))
	        return (T) sfsUser.getProperty(APIKey.USER);
	    return null;
	}
481636
public User get(String name) {

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

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

        return user;
    }
1178008
protected final Object getIdentifier(Object value, SessionFactoryImplementor sessionFactory) throws HibernateException {
		if ( value == null ) {
			return null;
		}

		final EntityPersister persister = sessionFactory.getMetamodel().entityPersister( delegate.getAssociatedEntityName() );
		final String uniqueKeyPropertyName = delegate.getRHSUniqueKeyPropertyName();

		if ( StringHelper.isEmpty( uniqueKeyPropertyName ) ) {
			return persister.getIdentifier( value, null );
		}
		else {
			Object propertyValue = persister.getPropertyValue( value, uniqueKeyPropertyName );
			// We now have the value of the property-ref we reference.  However,
			// we need to dig a little deeper, as that property might also be
			// an entity type, in which case we need to resolve its identifier
			Type type = persister.getPropertyType( uniqueKeyPropertyName );
			GridType gridType = typeTranslator.getType( type );
			if ( gridType.isEntityType() ) {
				propertyValue = getIdentifier( propertyValue, sessionFactory );
			}

			return propertyValue;
		}
	}
1016664
public function getLoggedUser() {
		$session = BUsersSession::getInstanceAndStart();
		if (empty($session)) {
			return NULL;
		}
		return $this->itemGet($session->userid);
	}