Esempio n. 1
0
 /**
  * Create POST form filter.
  *
  * @param T_Form_Post  $form  form
  * @param string $lock_to  a value that form can be locked to (e.g. User ID)
  * @param int $timeout  form timeout (seconds), defaults to 15 minutes
  * @param T_Response_Filter $filter  The prior filter object
  */
 function __construct(T_Form_Post $form, T_Environment $env, T_Filter_RepeatableHash $hash, $lock_to = null, $timeout = 900, T_Response_Filter $filter = null)
 {
     parent::__construct($filter);
     $this->env = $env;
     $this->form = $form;
     $this->hash = $hash;
     if (strlen($lock_to) > 0) {
         $this->lock_to = md5($lock_to);
         // protect possibly sensitive user ids, etc.
     }
     $this->timeout = $timeout;
     $this->forward = $this->form->getForward();
     if (!$this->forward) {
         $msg = 'Form ' . $this->form->getAlias() . ' has no forward set';
         throw new InvalidArgumentException($msg);
     }
 }