Пример #1
0
 /**
  * Performs the server side validation.
  * @since     1.0
  * @return bool
  *   true if no error found
  * @throws    HTML_QuickForm_Error
  */
 public function validate()
 {
     $error = parent::validate();
     $this->validateChainSelectFields();
     $hookErrors = array();
     CRM_Utils_Hook::validateForm(get_class($this), $this->_submitValues, $this->_submitFiles, $this, $hookErrors);
     if (!empty($hookErrors)) {
         $this->_errors += $hookErrors;
     }
     return 0 == count($this->_errors);
 }
Пример #2
0
 function validate()
 {
     $error = parent::validate();
     require_once 'CRM/Utils/Hook.php';
     $hookErrors = CRM_Utils_Hook::validate(get_class($this), $this->_submitValues, $this->_submitFiles, $this);
     if ($hookErrors !== true && is_array($hookErrors) && !empty($hookErrors)) {
         $this->_errors += $hookErrors;
     }
     return 0 == count($this->_errors);
 }
Пример #3
0
 function validate()
 {
     if (count($this->_rules) == 0 && count($this->_formRules) == 0) {
         return true;
     } else {
         return parent::validate();
     }
 }
Пример #4
0
 function validate()
 {
     $error = parent::validate();
     $hookErrors = CRM_Utils_Hook::validate(get_class($this), $this->_submitValues, $this->_submitFiles, $this);
     if (!is_array($hookErrors)) {
         $hookErrors = array();
     }
     CRM_Utils_Hook::validateForm(get_class($this), $this->_submitValues, $this->_submitFiles, $this, $hookErrors);
     if (!empty($hookErrors)) {
         $this->_errors += $hookErrors;
     }
     return 0 == count($this->_errors);
 }
Пример #5
0
 /**
  * Add extra validation rules to the first page
  * Check if both passwords are same
  */
 function validate()
 {
     $this->_errors = array();
     $data = $this->exportValues();
     if (!validate_email($data['email'])) {
         $this->_errors['email'] = get_string('invalidemail');
     } else {
         if (record_exists('user', 'email', $data['email'])) {
             $this->_errors['email'] = get_string('emailexists') . ' <a href="forgot_password.php">' . get_string('newpassword') . '?</a>';
         }
     }
     // validate standard rules
     parent::validate();
     return 0 == count($this->_errors);
 }