Ejemplo n.º 1
0
 public function isValid($data)
 {
     if (!parent::isValid($data)) {
         //$this->_incrementCaptcha();
         return false;
     }
     if (!($id = $this->_user_repository->createUser($data['email'], $data['password']))) {
         foreach ($this->_user_repository->getMessages() as $element_name => $message) {
             $this->addErrors(array($message));
         }
         //$this->_incrementCaptcha();
         return false;
     }
     return $id;
 }
Ejemplo n.º 2
0
 public function isValid($data)
 {
     if (parent::isValid($data)) {
         if ($this->_user_repository->authenticate($data['email'], $data['password'])) {
             Zend_Session::namespaceUnset('captcha');
             return true;
         } else {
             $this->setErrors(array('Email o password non validi'));
         }
     }
     /*
             $captcha_session = new Zend_Session_Namespace('captcha');
             if(empty($captcha_session->tries))
             {
                 $captcha_session->tries = 0;
             }
             $captcha_session->tries = $captcha_session->tries + 1;
              * */
     return false;
 }