コード例 #1
0
 /**
  * Invoked to modify the controller that should be executed.
  *
  * @param ResponseEvent $event The event
  * 
  * @return void
  * @author Etienne de Longeaux <*****@*****.**>
  */
 public function onPiLoginFailureResponse(ResponseEvent $event)
 {
     $response = $event->getResponse();
     if ($this->login_failure && !empty($this->login_failure_time_expire)) {
         $value = $this->getKeyValue();
         if (!empty($value)) {
             if ($value == 'stop-client') {
             } elseif (intval($value) >= $this->login_failure_connection_attempts) {
                 $this->container->get("sfynx.cache.filecache")->getClient()->changeValue($this->setKey(), 'stop-client');
             } else {
                 $this->container->get("sfynx.cache.filecache")->getClient()->changeValue($this->setKey(), $value + 1);
             }
         } else {
             $this->container->get("sfynx.cache.filecache")->set($this->setKey(), 1, $this->getTtl());
         }
     }
     $event->setResponse($response);
 }
コード例 #2
0
 /**
  * Sets request
  *
  * @access protected
  * @return void
  * @author Etienne de Longeaux <*****@*****.**>
  */
 protected function setRequest(ResponseEvent $event)
 {
     $request = $event->getRequest();
     $request->attributes->set('sfynx-layout', $this->layout);
     //
     $event->setRequest($request);
 }