protected function checkCredentials(Trace $trace)
 {
     if (!$this->clientToken) {
         $this->clientToken = new ClientToken($trace->getWebContext()->getServer()->getClientHash(true));
         $request = $trace->getWebContext()->getRequest();
         try {
             $authkey = $request[self::ADMIN_AUTHORIZED_COOKIE_NAME];
             $this->clientToken->getData($authkey);
             $this->setAdminAuthorized();
         } catch (Exception $e) {
             $this->setAdminNotAuthorized();
         }
     }
 }
 function __construct($message, Trace $trace)
 {
     parent::__construct($message, $trace->getRoute(), $trace->getWebContext());
 }
 /**
  * Helper method that creates an action method result encapsulating redirection
  *
  * @param string $routeName name of the route to use when building an address.
  * 					Route must be presented in IRouteTable
  * @param array $parameters parameters to pass to Route for building an address
  *
  * @return RedirectToRouteResult
  */
 protected function redirect($routeName, array $parameters = array())
 {
     $url = $this->trace->getWebContext()->getRequest()->getHttpUrl()->spawnBase();
     $this->trace->getRouteTable()->getRoute($routeName)->compose($url, $parameters);
     return new RedirectResult($url);
 }
Exemplo n.º 4
0
 function getResponse()
 {
     return $this->trace->getWebContext()->getResponse();
 }
 /**
  * Gets the text representastion of the requested URL
  *
  * @return string
  */
 function getSelfHref()
 {
     Assert::isNotEmpty($this->trace, 'trace is not set');
     return $this->trace->getWebContext()->getRequest()->getHttpUrl()->getUri();
 }