Get detailed profile information about the current user (including the current user’s username).

@return A {@link GetCurrentUsersProfileRequest.Builder}.
760475
public GetCurrentUsersProfileRequest.Builder getCurrentUsersProfile() {
    return new GetCurrentUsersProfileRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port);
  }
584419
def _get_profile(self, user_account):
        """"""

        try:
            # TODO: Load active profile, not just any
            user_profile = objectmodels['profile'].find_one(
                {'owner': str(user_account.uuid)})
            self.log("Profile: ", user_profile,
                     user_account.uuid, lvl=debug)
        except Exception as e:
            self.log("No profile due to error: ", e, type(e),
                     lvl=error)
            user_profile = None

        if not user_profile:
            default = {
                'uuid': std_uuid(),
                'owner': user_account.uuid,
                'userdata': {
                    'notes': 'Default profile of ' + user_account.name
                }
            }
            user_profile = objectmodels['profile'](default)
            user_profile.save()

        return user_profile
567546
public String getSelectedProfile(PortletRequest request) {

        // if a profile selection exists in the session, use it
        final PortletSession session = request.getPortletSession();
        String profileName =
                (String)
                        session.getAttribute(
                                SessionAttributeProfileMapperImpl.DEFAULT_SESSION_ATTRIBUTE_NAME,
                                PortletSession.APPLICATION_SCOPE);

        // otherwise, set the selected profile to the one currently in use by
        // the user
        if (profileName == null) {
            // get the profile for the current request
            final HttpServletRequest httpServletRequest =
                    portalRequestUtils.getPortletHttpRequest(request);
            final IUserInstance ui = userInstanceManager.getUserInstance(httpServletRequest);
            final IUserProfile profile = ui.getPreferencesManager().getUserProfile();

            // check to see if the profile's fname matches one of the entries in
            // the profile key map used by the session attribute profile mapper
            for (Map.Entry<String, String> entry : mappings.entrySet()) {
                if (entry.getValue().equals(profile.getProfileFname())) {
                    profileName = entry.getKey();
                    break;
                }
            }
        }

        return profileName;
    }
1096791
public function getCurrentUser() {
    if (empty($this->currentUser)) {
      $this->currentUser = \Drupal::service('current_user');
    }
    return $this->currentUser;
  }
26033
public UserInfo getUserTemplate()
    {
        if (userControl == null)
            userControl = new UserControl(this.getOwner().findRecordOwner());
        if (userControl != null)
            if ((userControl.getEditMode() == DBConstants.EDIT_CURRENT) || (userControl.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
        {
            UserInfo userInfo = (UserInfo)((ReferenceField)userControl.getField(UserControl.TEMPLATE_USER_ID)).getReference();
            if (userInfo != null)
                if ((userInfo.getEditMode() == DBConstants.EDIT_CURRENT) || (userInfo.getEditMode() == DBConstants.EDIT_IN_PROGRESS))
                    return userInfo;
        }
        return null;
    }
681228
public GetCurrentUsersSavedAlbumsRequest.Builder getCurrentUsersSavedAlbums() {
    return new GetCurrentUsersSavedAlbumsRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port);
  }
1364290
public User getLoggedInUser() {
    User user = null;

    final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if (authentication != null) {
      final Object principal = authentication.getPrincipal();

      // principal can be "anonymousUser" (String)
      if (principal instanceof UserDetails) {
        user = userDetailsConverter.convert((UserDetails) principal);
      }
    }
    return user;
  }
693842
@Override
    public String getProfileFname(IPerson person, HttpServletRequest request) {
        final String userAgent = request.getHeader(this.userAgentHeader);
        if (userAgent == null) {
            this.logger.debug(
                    "No {} header for {} returning default profile",
                    this.userAgentHeader,
                    person.getUserName());
            return this.defaultProfileName;
        }

        for (final Mapping mapping : this.mappings) {
            final Matcher matcher = mapping.pattern.matcher(userAgent);
            if (matcher.matches()) {
                this.logger.debug(
                        "Matched {} header {} for {} returning profile {}",
                        new Object[] {
                            this.userAgentHeader, person.getUserName(), mapping.profileName
                        });
                return mapping.profileName;
            }
        }

        this.logger.debug(
                "No matching Mapping for {} header for {} returning default profile",
                this.userAgentHeader,
                person.getUserName());
        return defaultProfileName;
    }
1057405
public static FacebookUserProfile getUserProfile(String userId) {
		String pageToken = FbBotMillContext.getInstance().getPageToken();
		BotMillNetworkResponse response = NetworkUtils
				.get(FbBotMillNetworkConstants.FACEBOOK_BASE_URL + userId
						+ FbBotMillNetworkConstants.USER_PROFILE_FIELDS
						+ pageToken);
		FacebookUserProfile user = FbBotMillJsonUtils.fromJson(
				response.getResponse(), FacebookUserProfile.class);
		return user;
	}
853999
@JsonIgnore
	public String getUsername() {
		if (App.isRoot(user.getAppid())) {
			return user.getIdentifier();
		} else {
			return user.getAppid() + "/" + user.getIdentifier();
		}
	}
1046736
protected function getCurrentUser()
    {
        if (!$this->tokenStorage) {
            return;
        }

        if (!$this->tokenStorage->getToken()) {
            return;
        }

        $user = $this->tokenStorage->getToken()->getUser();

        if ($user instanceof UserInterface) {
            return $user;
        }

        return;
    }
799199
public UserProfile fetchUserProfile(final Google google) {
    final UserInfo userInfo = google.oauth2Operations().getUserinfo();
    return new UserProfileBuilder().setUsername(userInfo.getId())
      .setId(userInfo.getId())
      .setEmail(userInfo.getEmail())
      .setName(userInfo.getName())
      .setFirstName(userInfo.getGivenName())
      .setLastName(userInfo.getFamilyName()).build();
  }
627472
public static function CurrentUser()
    {
        if (static::IsAuthenticatedRequest()) {
            $cryptor = new GnCryptor();
            $cookie = $cryptor->decrypt($_COOKIE['GpsNoseAuthentication']);
            $json = json_decode($cookie);
            $gnPrincipal = new GnPrincipal();
            $gnPrincipal->LoginName = $json->{"LoginName"};
            $gnPrincipal->LoginId = $json->{"LoginId"};
            $gnPrincipal->ProfileTags = $json->{"ProfileTags"};
            return $gnPrincipal;
        }
        return NULL;
    }
144036
public function getCurrentUser()
    {
        if ($this->currentuser === null) {
            $hash = $this->getCurrentSessionHash();
            if ($hash === false) {
                return false;
            }

            $uid = $this->getSessionUID($hash);
            if ($uid === false) {
                return false;
            }

            $this->currentuser = $this->getUser($uid);
        }
        return $this->currentuser;
    }
228944
public function getProfile()
    {
        if (!$this->hasProfile()) {
            return null;
        }
        $profileClass = $this->profileClass;
        $profileModel = $profileClass::buildNoInitModel();
        return $this->hasOne($profileClass,
                [$profileModel->createdByAttribute => $this->guidAttribute])->inverseOf('user');
    }
1353476
public static UserProfileDto fromUser(User user) {
    UserProfileDto result = new UserProfileDto();
    result.id = user.getId();
    result.firstName = user.getFirstName();
    result.lastName = user.getLastName();
    result.email = user.getEmail();
    return result;
  }
187242
@Override
    public IPerson getCurrentPerson(final ExternalContext externalContext) {
        final HttpServletRequest servletRequest =
                getServletRequestFromExternalContext(externalContext);
        return personManager.getPerson(servletRequest);
    }