public function processInput(array $postData)
 {
     parent::processInput($postData);
     foreach ($this->getData()->parent->getComponent()->getFormComponents() as $form) {
         $form->processInput($postData);
     }
 }
 public function processInput(array $postData)
 {
     parent::processInput($postData);
     if (!Kwf_Registry::get('userModel')->getAuthedUser()) {
         throw new Kwf_Exception('not logged in');
     }
 }
 public function processInput(array $postData)
 {
     parent::processInput($postData);
     $this->_accessByMailRow = false;
     if (isset($postData['key'])) {
         $s = new Kwf_Model_Select();
         $s->whereEquals('key', $postData['key']);
         $s->where(new Kwf_Model_Select_Expr_Higher('date', new Kwf_Date(time() - 24 * 60 * 60)));
         $this->_accessByMailRow = Kwf_Model_Abstract::getInstance('Kwf_Component_Plugin_AccessByMail_Model')->getRow($s);
         if (!$this->_accessByMailRow) {
             $this->_errors[] = array('message' => trlKwf("Invalid or expired Link. Please request a new one."));
         } else {
             $session = new Kwf_Session_Namespace('kwc_' . $this->getData()->parent->componentId);
             $session->login = true;
             $session->key = $postData['key'];
         }
     } else {
         $session = new Kwf_Session_Namespace('kwc_' . $this->getData()->parent->componentId);
         if ($session->login) {
             $s = new Kwf_Model_Select();
             $s->whereEquals('key', $session->key);
             $this->_accessByMailRow = Kwf_Model_Abstract::getInstance('Kwf_Component_Plugin_AccessByMail_Model')->getRow($s);
         }
     }
 }
 public function processInput(array $postData)
 {
     if (!$this->_recipient && isset($postData['d'])) {
         /**
          * 0 = redirectId
          * 1 = recipientId
          * 2 = recipientModelShortcut
          * 3 = hash
          */
         $params = explode('_', $postData['d']);
         if (count($params) >= 4 && $params[3] == $this->_getHash(array($params[0], $params[1], $params[2]))) {
             $c = Kwf_Component_Data_Root::getInstance()->getComponentByClass('Kwc_Newsletter_Detail_Mail_Component', array('limit' => 1, 'subroot' => $this->getData()));
             if ($c) {
                 $model = null;
                 foreach ($c->getComponent()->getRecipientSources() as $key => $value) {
                     if (is_array($value) && $key == $params[2]) {
                         $model = $value['model'];
                     }
                 }
                 if ($model) {
                     $this->_recipient = Kwf_Model_Abstract::getInstance($model)->getRow($params[1]);
                 }
             }
         }
     }
     parent::processInput($postData);
 }
 public function processInput(array $postData)
 {
     parent::processInput($postData);
     if (isset($postData['code'])) {
         $code = $postData['code'];
         $this->getForm()->getRow()->code = $code;
     } else {
         if (isset($postData['form_code'])) {
             $code = $postData['form_code'];
             $this->getForm()->getRow()->code = $code;
         } else {
             $code = $this->getForm()->getRow()->code;
         }
     }
     if (!preg_match('#^(.*)-(\\w*)$#', $code, $m)) {
         $this->_errors[] = array('message' => $this->_getErrorMessage(self::ERROR_DATA_NOT_COMPLETE));
         $this->_hideForm = true;
     } else {
         $userId = $m[1];
         $code = $m[2];
         $userModel = Zend_Registry::get('userModel');
         $this->_user = $userModel->getRow($userId);
         if (!$this->_user) {
             $this->_errors[] = array('message' => $this->_getErrorMessage(self::ERROR_DATA_NOT_COMPLETE));
             $this->_hideForm = true;
         } else {
             if (!$this->_user->validateActivationToken($code) && $this->_user->isActivated()) {
                 $this->_errors[] = array('message' => $this->_getErrorMessage(self::ERROR_ALREADY_ACTIVATED));
                 $this->_hideForm = true;
             } else {
                 if (!$this->_user->validateActivationToken($code)) {
                     $this->_errors[] = array('message' => $this->_getErrorMessage(self::ERROR_CODE_WRONG));
                     $this->_hideForm = true;
                 }
             }
         }
     }
     if ($this->_user && $this->isSaved()) {
         $userModel->setPassword($this->_user, $this->_form->getRow()->password);
         $this->_user->clearActivationToken();
         $this->_afterLogin(Kwf_Registry::get('userModel')->getAuthedUser());
     }
 }