Ejemplo n.º 1
0
 /**
  * validate
  *
  * Run validation process
  *
  * @return null
  */
 public function validate()
 {
     parent::validate();
     // compare protection code
     if (property_exists($this->_data, 'protection_code')) {
         $protectionCode = \Storage::read('protection-code-register');
         \Storage::remove('protection-code-register');
         if ($this->_data->protection_code !== $protectionCode) {
             $this->addMessage('protection_code', \View::$language->register_form_protection_code_invalid);
         }
     }
     // compare password confirmation
     if (property_exists($this->_data, 'password') && property_exists($this->_data, 'confirm_password') && $this->_data->password !== $this->_data->confirm_password) {
         $this->addMessage('confirm_password', \View::$language->register_form_password_confirm_mismatch);
     }
     // check for existence
     if ($this->isValid()) {
         $checkedFields = array('email', 'login');
         $UserModel = \App::getInstance('common\\UserModel');
         foreach ($checkedFields as $fName) {
             if ($UserModel->isExists($fName, $this->_data->{$fName})) {
                 $mKey = 'register_form_' . $fName . '_is_exists';
                 $this->addMessage($fName, \View::$language->{$mKey});
             }
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * validate
  *
  * Run validation process
  *
  * @return null
  */
 public function validate()
 {
     parent::validate();
     $availableFilters = \App::getConfig('forum')->tracker_filters;
     if (!in_array($this->_data->by, $availableFilters, true)) {
         $this->_isValid = false;
     }
 }
Ejemplo n.º 3
0
 /**
  * validate
  *
  * Run validation process
  *
  * @return null
  */
 public function validate()
 {
     parent::validate();
     // compare protection code
     if (property_exists($this->_data, 'protection_code')) {
         $protectionCode = \Storage::read('protection-code-sign-in');
         \Storage::remove('protection-code-sign-in');
         if ($this->_data->protection_code !== $protectionCode) {
             $this->addMessage('protection_code', \View::$language->sign_in_form_protection_code_invalid);
         }
     }
     // remove sign in counter data
     if ($this->isValid()) {
         \Storage::remove('sign-in-tries');
     }
 }