Return a label describing a user.

@param \Platformsh\Client\Model\ProjectAccess $access

@return string
338472
private function getUserLabel(ProjectAccess $access)
    {
        $account = $this->api()->getAccount($access);

        return sprintf('<info>%s</info> (%s)', $account['display_name'], $account['email']);
    }
139498
public function process($access = '')
    {
        if (is_array($access)) {
            if (isset($access['name'])) {
                $name = $access['name'];

                if (isset($this->access[$name])) {
                    $accessInstance = $this->access[$name];
                    $accessInstance = new $accessInstance;

                    if ($accessInstance instanceof MiddlewareInterface) {

                        $role = isset($access['role']) ? $access['role'] : '';
                        $next = isset($access['next']) ? $access['next'] : null;
                        if ($accessInstance->handle($this->request, $role, $next)) {
                            return true;
                        } else {
                            if ($accessInstance instanceof TerminateInterface) {
                                $accessInstance->terminate($this->request);
                            }
                        }
                    }
                }
            }
        }

        return false;
    }
472639
public function indexAction($access)
    {
        $em = $this->getDoctrineManager();
        $sf = $this->container->get('sakonnin.files');
        // Todo: paging or just show the last 20
        $files = $sf->getFilesForLoggedIn();

        if ($this->isRest($access)) {
            return $this->returnRestData($request, $files, array('html' =>'file:_index.html.twig'));
        }
        return $this->render('BisonLabSakonninBundle:SakonninFile:index.html.twig',
            array('files' => $files));
    }
1346397
public static function format($data, $access=null, $fields=null) {
        return [
            'user' => $data->User->URLSegment,
            'token' => $data->Token
        ];
    }
492943
public function getPaths($access = 'rw') {
		$paths = [];
		foreach($this->paths as $p) {
			if($p['access'] === $access) {
				array_push($paths, $p);
			}
		}
		return $paths;
	}
1361469
public function withAccess($access)
    {
        $choices = [
            NewsInterface::ACCESS_REGISTRATION,
            NewsInterface::ACCESS_SUBSCRIPTION,
        ];

        Assertion::choice($access, $choices);

        $instance = clone $this;

        $instance->access = $access;

        return $instance;
    }
826020
public static function validate($access)
    {
        $lowercaseAccess = \strtolower($access);

        if ('subscription' === $lowercaseAccess || 'registration' === $lowercaseAccess) {
            return \ucfirst($lowercaseAccess);
        }

        return false;
    }
353947
public function getUserInfo($accessToken)
    {
        // Get the correct Profile Endpoint URL based off the country/region provided in the config['region']
        $this->profileEndpointUrl();

        if (empty($accessToken)) {
            throw new \InvalidArgumentException('Access Token is a required parameter and is not set');
        }

        // To make sure double encoding doesn't occur decode first and encode again.
        $accessToken = urldecode($accessToken);
        $url          = $this->profileEndpoint . '/auth/o2/tokeninfo?access_token=' . $this->urlEncode($accessToken);

        $httpCurlRequest = new HttpCurl($this->config);

        $response = $httpCurlRequest->httpGet($url);
        $data       = json_decode($response);

        // Ensure that the Access Token matches either the supplied Client ID *or* the supplied App ID
        // Web apps and Mobile apps will have different Client ID's but App ID should be the same
        // As long as one of these matches, from a security perspective, we have done our due diligence
        if (($data->aud != $this->config['client_id']) && ($data->app_id != $this->config['app_id'])) {
            // The access token does not belong to us
            throw new \Exception('The Access Token belongs to neither your Client ID nor App ID');
        }

        // Exchange the access token for user profile
        $url             = $this->profileEndpoint . '/user/profile';
        $httpCurlRequest = new HttpCurl($this->config);

        $httpCurlRequest->setAccessToken($accessToken);
        $httpCurlRequest->setHttpHeader();
        $response = $httpCurlRequest->httpGet($url);

        $userInfo = json_decode($response, true);
        return $userInfo;
    }
521419
protected function getSignature(string $url, array $params, string $method, string $accessTokenSecret = null):string{
		$parseURL = parse_url($url);

		if(!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)){
			throw new ProviderException('getSignature: invalid url');
		}

		parse_str($parseURL['query'] ?? '', $query);

		$signatureParams = array_merge($query, $params);

		if(isset($signatureParams['oauth_signature'])){
			unset($signatureParams['oauth_signature']);
		}

		$key  = implode('&', Psr7\r_rawurlencode([$this->options->secret, $accessTokenSecret ?? '']));
		$data = Psr7\r_rawurlencode([
			strtoupper($method ?? 'POST'),
			$parseURL['scheme'].'://'.$parseURL['host'].($parseURL['path'] ?? ''),
			Psr7\build_http_query($signatureParams),
		]);

		return base64_encode(hash_hmac('sha1', implode('&', $data), $key, true));
	}
309166
protected function createPrivateGedcomRecord(int $access_level): string
    {
        $SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS');

        $rec = '0 @' . $this->xref . '@ FAM';
        // Just show the 1 CHIL/HUSB/WIFE tag, not any subtags, which may contain private data
        preg_match_all('/\n1 (?:CHIL|HUSB|WIFE) @(' . Gedcom::REGEX_XREF . ')@/', $this->gedcom, $matches, PREG_SET_ORDER);
        foreach ($matches as $match) {
            $rela = Individual::getInstance($match[1], $this->tree);
            if ($rela && ($SHOW_PRIVATE_RELATIONSHIPS || $rela->canShow($access_level))) {
                $rec .= $match[0];
            }
        }

        return $rec;
    }
1109505
public function get_label($data) {
        global $DB;

        $role = $DB->get_record('role', array('id' => $data['value']));

        $a = new stdClass();
        $a->label = $this->_label;
        $a->value = '"'.role_get_name($role).'"';

        return get_string('globalrolelabel', 'filters', $a);
    }
1176259
protected function getAcceptHeader()
    {
        return \sprintf(
            'application/%s.%s.%s+%s', $this->getStandardsTree(), $this->getSubtype(), $this->getVersion(), $this->getFormat()
        );
    }
675722
public static function getApplicationName():?string
    {
        if (self::isCliApp()) {
            return self::$APPLICATION_NAME;
        }

        return MSession::get(MCoreApplication::APPLICATION_NAME);
    }
603788
public String getAccessorName()
    {
        StringBuffer sb = new StringBuffer();
        sb.append(_propertySet.getPrefix());
    
        String name = getName();
        sb.append(Character.toUpperCase(name.charAt(0)));
        if (name.length() > 0)
            sb.append(name.substring(1));
        return sb.toString();
    }
1325308
public static function statusLabel($status = null)
    {
        switch ($status) {
            case User::STATUS_ACTIVE:
                $label = 'info';
                $name = ArrayHelper::getValue(User::getStatuses(), $status);
                break;
            case User::STATUS_BANNED:
                $label = 'warning';
                $name = ArrayHelper::getValue(User::getStatuses(), $status);
                break;
            default:
                $label = 'default';
                $name = ArrayHelper::getValue(User::getStatuses(), User::STATUS_REGISTERED);
        }

        return Html::tag('span', $name, ['class' => 'label label-' . $label]);
    }
994742
public static function access()
	{
		// Create the batch selector to change an access level on a selection list.
		$lines = array(
			'<label id="batch-access-lbl" for="batch-access" class="hasTip" title="' . Lang::txt('JLIB_HTML_BATCH_ACCESS_LABEL') . '::' . Lang::txt('JLIB_HTML_BATCH_ACCESS_LABEL_DESC') . '">',
			Lang::txt('JLIB_HTML_BATCH_ACCESS_LABEL'),
			'</label>',
			Access::assetgrouplist(
				'batch[assetgroup_id]', '',
				'class="inputbox"',
				array(
					'title' => Lang::txt('JLIB_HTML_BATCH_NOCHANGE'),
					'id'    => 'batch-access'
				)
			)
		);

		return implode("\n", $lines);
	}
1223769
public function output_user($user) {
        $out = fullname($user, $this->viewfullnames);
        if ($this->extrafields) {
            $displayfields = array();
            foreach ($this->extrafields as $field) {
                $displayfields[] = $user->{$field};
            }
            $out .= ' (' . implode(', ', $displayfields) . ')';
        }
        return $out;
    }