Display user profile
193468
def show
      user = ::User.from_url_component(params[:id])
      return redirect_to root_path, alert: "User '#{params[:id]}' does not exist" if user.nil?
      @presenter = Hyrax::UserProfilePresenter.new(user, current_ability)
    end
371791
def request_profile_view(request):
    '''  '''
    page_name = "Profile Request Page"
    redirect_to = request.GET.get('next', reverse('homepage'))
    if request.user.is_authenticated() and request.user.username != ANONYMOUS_USERNAME:
        return HttpResponseRedirect(redirect_to)
    form = ProfileRequestForm(
        request.POST or None,
        )
    if form.is_valid():
        username = form.cleaned_data['username']
        first_name = form.cleaned_data['first_name']
        last_name = form.cleaned_data['last_name']
        email = form.cleaned_data['email']
        if User.objects.filter(username=username).count():
            reset_url = request.build_absolute_uri(reverse('reset_pw'))
            form_add_error(form, 'username',
                           MESSAGES["USERNAME_TAKEN"].format(username=username))
            messages.add_message(request, messages.INFO,
                                 MESSAGES['RESET_MESSAGE'].format(reset_url=reset_url))
        elif User.objects.filter(email=email).count():
            reset_url = request.build_absolute_uri(reverse('reset_pw'))
            messages.add_message(request, messages.INFO,
                                 MESSAGES['RESET_MESSAGE'].format(reset_url=reset_url))
            form_add_error(form, "email", MESSAGES["EMAIL_TAKEN"])
        elif ProfileRequest.objects.filter(first_name=first_name, last_name=last_name).count():
            form_add_error(
                form, '__all__',
                MESSAGES["PROFILE_TAKEN"].format(first_name=first_name,
                                                 last_name=last_name))
        elif User.objects.filter(first_name=first_name, last_name=last_name).count():
            reset_url = request.build_absolute_uri(reverse('reset_pw'))
            messages.add_message(request, messages.INFO, MESSAGES['PROFILE_REQUEST_RESET'].format(reset_url=reset_url))
        else:
            form.save()
            messages.add_message(request, messages.SUCCESS, MESSAGES['PROFILE_SUBMITTED'])
            if settings.SEND_EMAILS and (email not in settings.EMAIL_BLACKLIST):
                submission_subject = SUBMISSION_SUBJECT.format(house=settings.HOUSE_NAME)
                submission_email = SUBMISSION_EMAIL.format(house=settings.HOUSE_NAME, full_name=first_name + " " + last_name, admin_name=settings.ADMINS[0][0],
                    admin_email=settings.ADMINS[0][1])
                try:
                    send_mail(submission_subject, submission_email, settings.EMAIL_HOST_USER, [email], fail_silently=False)
                    # Add logging here
                except SMTPException:
                    pass # Add logging here
            return HttpResponseRedirect(redirect_to)
    return render(request, 'request_profile.html', {
        'form': form,
        'page_name': page_name,
        'oauth_providers': _get_oauth_providers(),
        'redirect_to': redirect_to,
        })
244463
function getProfile() {

		$profile['users_id'] = $this->userId;
		foreach ( $this->profileMetaKeys as $key => $type ) {
			$profile[ $key ] = get_user_meta( $this->userId, $key, true );
		}

		return $profile;
	}
589866
public function getPostEditUser()
    {
        $this->checkIsLogin();
        $name = $this->di->get('session')->get("user");
        $user = $this->getUserDetails($name);

        $form       = new EditProfileForm($this->di, $name);
        $form->check();

        $views = [
            ["comment/user/profile/edit", ["form" => $form->getHTML(), "user" => $user], "main"]
        ];

        $this->di->get("pageRenderComment")->renderPage([
            "views" =>  $views,
            "title" => "Edit Profile"
        ]);
    }
45628
def show_user(self, user):
        """"""

        url = '/users/show/%s.xml' % (user)
        d = defer.Deferred()

        self.__downloadPage(url, txml.Users(lambda u: d.callback(u))) \
            .addErrback(lambda e: d.errback(e))

        return d
305463
public function getProfile($id)
    {
        $title      = "Profil";
        $view       = $this->di->get("view");
        $pageRender = $this->di->get("pageRender");

        $user = new User();
        $user->setDb($this->di->get("db"));
        $user->find("id", $id);

        $data = [
            "user" => $user
        ];

        $view->add("user/profile", $data);
        
        $pageRender->renderPage(["title" => $title]);
    }
1291732
def _get_userprofile_from_registry(user, sid):
    '''
    
    '''
    profile_dir = __utils__['reg.read_value'](
        'HKEY_LOCAL_MACHINE',
        'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\{0}'.format(sid),
        'ProfileImagePath'
    )['vdata']
    log.debug(
        'user %s with sid=%s profile is located at "%s"',
        user, sid, profile_dir
    )
    return profile_dir
986380
def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs):
    '''
    
    '''
    return __salt__['pagerduty_util.resource_present']('users',
                                                       ['email', 'name', 'id'],
                                                       None,
                                                       profile,
                                                       subdomain,
                                                       api_key,
                                                       **kwargs)
133712
def render_profile_data(self, as_parsed):
        """"""
        try:
            return deep_map(self._render_profile_data, as_parsed)
        except RecursionException:
            raise DbtProfileError(
                'Cycle detected: Profile input has a reference to itself',
                project=as_parsed
            )
492921
def my_profile_view(request):
    '''  '''
    page_name = "Profile Page"
    if request.user.username == ANONYMOUS_USERNAME:
        return red_home(request, MESSAGES['SPINELESS'])
    userProfile = UserProfile.objects.get(user=request.user)
    change_password_form = PasswordChangeForm(
        request.user,
        request.POST if "submit_password_form" in request.POST else None,
        )
    update_email_form = UpdateEmailForm(
        request.POST if "submit_profile_form" in request.POST else None,
        instance=request.user,
        prefix="user",
        )
    update_profile_form = UpdateProfileForm(
        request.POST if "submit_profile_form" in request.POST else None,
        instance=userProfile,
        prefix="profile",
        )
    if change_password_form.is_valid():
        change_password_form.save()
        messages.add_message(request, messages.SUCCESS,
                             "Your password was successfully changed.")
        return HttpResponseRedirect(reverse('my_profile'))
    if update_email_form.is_valid() and update_profile_form.is_valid():
        update_email_form.save()
        update_profile_form.save()
        messages.add_message(request, messages.SUCCESS,
                             "Your profile has been successfully updated.")
        return HttpResponseRedirect(reverse('my_profile'))
    return render_to_response('my_profile.html', {
        'page_name': page_name,
        "update_email_form": update_email_form,
        'update_profile_form': update_profile_form,
        'change_password_form': change_password_form,
        }, context_instance=RequestContext(request))
1046801
def users_view_user(self, ):
        
        i = self.users_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            user = item.internal_data()
            self.view_user(user)
904083
def render(self):
        """"""
        t = template.loader.get_template('support/forms/profile_picture.html')
        return t.render(template.Context({'widget': self, 'MEDIA_URL': settings.MEDIA_URL }))
53875
def manage_profile_requests_view(request):
    '''  '''
    page_name = "Admin - Manage Profile Requests"
    profile_requests = ProfileRequest.objects.all()
    return render_to_response('manage_profile_requests.html', {
        'page_name': page_name,
        'choices': UserProfile.STATUS_CHOICES,
        'profile_requests': profile_requests
        }, context_instance=RequestContext(request))
350742
function getProfile()
    {
        $pclass = Pluf::f('user_profile_class', false);
        if (false === $pclass) {
            throw new Pluf_Exception_SettingError('"user_profile_class" setting not defined.');
        }
        $db = $this->getDbConnection();
        $sql = new Pluf_SQL(sprintf('%s=%%s', $db->qn('user')), array(
            $this->id
        ));
        $users = Pluf::factory($pclass)->getList(array(
            'filter' => $sql->gen()
        ));
        if ($users->count() != 1) {
            throw new Pluf_Exception_DoesNotExist(sprintf('No profiles available for user: %s', (string) $this));
        }
        return $users[0];
    }
988193
def show(config, username):
        """"""
        client = Client()
        client.prepare_connection()
        user_api = API(client)
        CLI.show_user(user_api.show(username))
1144511
def get_users(profile='pagerduty', subdomain=None, api_key=None):
    '''
    
    '''

    return _list_items(
        'users',
        'id',
        profile=profile,
        subdomain=subdomain,
        api_key=api_key,
    )
1322755
public function display_data() {
        // Check if time was specified.
        if (!empty($this->field->param3)) {
            $format = get_string('strftimedaydatetime', 'langconfig');
        } else {
            $format = get_string('strftimedate', 'langconfig');
        }

        // Check if a date has been specified.
        if (empty($this->data)) {
            return get_string('notset', 'profilefield_datetime');
        } else {
            return userdate($this->data, $format);
        }
    }