Esempio n. 1
0
 /**
  * For @secure annotated signal handler methods checks if URL parameters has not been changed
  * @param string $signal
  * @throws BadSignalException
  */
 public function signalReceived($signal)
 {
     $methodName = $this->formatSignalMethod($signal);
     if (method_exists($this, $methodName)) {
         $method = $this->getReflection()->getMethod($methodName);
         //            if (Annotation::has($method, 'secured')) {
         if ($method->hasAnnotation('secured')) {
             $protectedParams = array();
             foreach ($method->getParameters() as $param) {
                 $protectedParams[$param->name] = $this->getParam($param->name);
             }
             if ($this->getParam('__secu') !== $this->createSecureHash($protectedParams)) {
                 throw new BadSignalException('Secured parameters are not valid.');
             }
         }
     }
     parent::signalReceived($signal);
 }