Отрисовка страницы аутентификации

@return Eresus_HTTP_Response

@since 3.01
324385
private function authAction()
    {
        $data = array('errors' => array(), 'user' => '', 'autologin' => '');

        $legacyKernel = Eresus_CMS::getLegacyKernel();
        $req = $this->getRequest();
        if ($req->getMethod() == 'POST')
        {
            $user = $req->request->filter('user', null, FILTER_REGEXP, '/[^a-z0-9_\-\.\@]/');
            $password = $req->request->get('password');
            $autologin = $req->request->get('autologin');
            if ($legacyKernel->login($user, $legacyKernel->password_hash($password), $autologin))
            {
                return new Eresus_HTTP_Redirect($legacyKernel->root . 'admin.php');
            }
            $data['user'] = $user;
            $data['autologin'] = $autologin;
        }

        $data['errors'] = $this->getPage()->getErrorMessages();
        $this->getPage()->clearErrorMessages();
        if (isset($legacyKernel->session['msg']['errors']) &&
            count($legacyKernel->session['msg']['errors']))
        {
            $data['errors'] = $legacyKernel->session['msg']['errors'];
            $legacyKernel->session['msg']['errors'] = array();
        }

        $tmpl = Eresus_Template::loadFromFile('core/templates/auth.html');
        $html = $tmpl->compile($data);
        $response = new Eresus_HTTP_Response($html);
        return $response;
    }
32283
public function versionsAction()
    {
        $versions = [
            'versions' => $this->versionInformation
        ];

        $response = $this->getResponse()
                         ->setStatusCode(Response::HTTP_OK)
                         ->setContent(json_encode($versions));

        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }
1194476
protected function getResponse()
    {
        if ($this->response === null) {
            $this->response = $this->client->send($this->request);
        }

        return $this->response;
    }
353820
public function request()
    {
        $reqUrl = sprintf('%s?APIKEY=%s', self::END_POINT_URL, rawurlencode($this->apikey));
        $reqBody = json_encode($this->getParameter()->makeParameter());

        $curl = new Curl();
        $curl->setHeader('Content-Type', 'application/json; charset=UTF-8');
        $ret = $curl->post($reqUrl, $reqBody);
        if ($curl->error) {
            trigger_error('docomo dialogue: Error ' . $curl->errorCode . ': ' . $curl->errorMessage, E_USER_WARNING);
            return false;
        }
        return new Response($ret);
    }
220515
public function handler(): Response
    {
        $member = Member::search($this->getParameter('username'));
        if (!$member) {
            throw new HttpNotFoundException();
        }
        $r = $member->getRole();
        return response([
            'id' => $member->getId(),
            'username' => $member->getUsername(),
            'email' => $member->getEmail(),
            'phone' => $member->getPhone(),
            'name' => $member->getName(),
            'gender' => $member->getGender(),
            'role' => [
                'name' => $r->getName(),
                'color' => $r->getColor(),
                'icon' => $r->getIcon(),
                'slug' => $r->getSlug()
            ]
        ]);
    }
665532
public function resourceAction()
    {
        // Handle a request for an OAuth2.0 Access Token and send the response to the client
        if (!$this->server->verifyResourceRequest($this->getOAuth2Request())) {
            $response   = $this->server->getResponse();
            $parameters = $response->getParameters();
            $errorUri   = isset($parameters['error_uri']) ? $parameters['error_uri'] : null;
            return new ApiProblemResponse(
                new ApiProblem(
                    $response->getStatusCode(),
                    $parameters['error_description'],
                    $errorUri,
                    $parameters['error']
                )
            );
        }
        $httpResponse = $this->getResponse();
        $httpResponse->setStatusCode(200);
        $httpResponse->getHeaders()->addHeaders(array('Content-type' => 'application/json'));
        $httpResponse->setContent(
            json_encode(array('success' => true, 'message' => 'You accessed my APIs!'))
        );
        return $httpResponse;
    }
1284640
protected function getStatusResponse()
    {
        $request = new Request(
            'PUT',
            $this->resumeUri,
            ['Content-Range' => 'bytes */*']
        );

        return $this->requestWrapper->send($request, $this->requestOptions);
    }
1306039
public function versionsSchemaAction()
    {
        $response = $this->getResponse()
                         ->setStatusCode(Response::HTTP_OK)
                         ->setContent(json_encode($this->getModel()->getSchema()));
        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }
758145
public function getResponse()
    {
        $curl = curl_init();

        $this->addParameters()->addHeaders();
        $this->options[CURLOPT_RETURNTRANSFER] = true;
        curl_setopt_array($curl, $this->options);

        $response = curl_exec($curl);

        $this->meta = array(
            'info'             => curl_getinfo($curl, CURLINFO_HTTP_CODE),
            'error_message'    => curl_errno($curl),
            'error_code'    => curl_error($curl));

        curl_close($curl);
        unset($curl);

        return $response;
    }
417066
public function send()
    {
        if ($this->options instanceof Options) {
            $this->options->applyTo($this);
        }
        $content = curl_exec($this->ch);

        $response = new Response($this, $content);
        $errorCode = curl_errno($this->ch);
        if ($errorCode !== CURLE_OK) {
            $response->setError(new Error(curl_error($this->ch), $errorCode));
        }
        return $response;
    }
1229011
public function send()
    {
        $request = $this->createRequest();

        $response = $this->httpClient->sendRequest($request);

        return $this->mapResponse((array) $this->parseResponse($response));
    }
1115902
public function getResponse()
	{
	    $name = 'web.response';
	    if (!Ioc::has($name)) {
	        Ioc::setShared($name, function () {
	            //$headers = new Headers(['Content-Type' => 'text/html; charset=UTF-8']);
	            $response = new Response(200);
	            return $response->withProtocolVersion(Config::getCommon('http.version'));
	        });
	    }
	    
	    return Ioc::get($name);
	}
1128103
public function indexAction()
    {
        $response = $this->response;

        $mainPage = new \stdClass();
        $mainPage->services = $this->determineServices(
            $this->restUtils->getOptionRoutes()
        );

        $mainPage->thirdparty = $this->registerThirdPartyServices();

        $response->setContent(json_encode($mainPage));
        $response->setStatusCode(Response::HTTP_OK);
        $response->headers->set('Link', $this->prepareLinkHeader());

        // todo: make sure, that the correct content type is set.
        // todo: this should be covered by a kernel.response event listener?
        $response->headers->set('Content-Type', 'application/json');

        return $response;
    }
562165
public function getContent(): Response {
        $uri     = $this->fedora->sanitizeUri($this->uri);
        $request = new Request('GET', $uri);
        return $this->fedora->sendRequest($request);
    }
1229063
public function response()
    {
        return new MultiErrorResponse($this->httpStatusCode, $this->code, $this->message, $this->validationMessages);
    }
403982
public function explain()
    {
        $url = $this->url . '?' . http_build_query(array(
            'operation' => 'explain',
            'version' => $this->version,
        ));

        $body = $this->request('GET', $url);

        return new ExplainResponse($body, $this);
    }
1096413
public function getResponse()
	{
		if (method_exists($this->controller, 'getResponse'))
		{
			/** @var HttpResponse $response */
			$response = $this->controller->getResponse();
		}
		else
		{
			$response = new HttpResponse;
		}

		$fp = fopen('php://output', 'w');
		ob_start();
		fputcsv($fp, $this->header, $this->delimiter, $this->enclosure);
		foreach ($this->content as $i => $item)
		{
			try
			{
				$fields = $this->callback ? call_user_func($this->callback, $item) : $item;
				if (!is_array($fields))
				{
					throw new \RuntimeException('CsvExport can only accept arrays, '. gettype($fields) .' provided at index '. $i .'. Either use arrays when setting the records or use a callback to convert each record into an array.');
				}
				fputcsv($fp, $fields, $this->delimiter, $this->enclosure);
			}
			catch (\Exception $ex)
			{
				ob_end_clean();
				throw $ex;
			}
		}
		fclose($fp);
		$response->setContent(ob_get_clean());

		$response->getHeaders()->addHeaders(array(
			'Content-Type' => 'text/csv',
			'Content-Disposition' => 'attachment;filename="'. str_replace('"', '\\"', $this->name) .'.csv"',
		));

		return $response;
	}