I'm doing password validation in one of my model - jobseeker.php - which works fine during registration. The problem is when a user is editing his/her profile, it still does validation for same password (entered password do not match error comes up), is there a way to bypass this if just editing profile and use it only during registration?
var $validate = array(
'username' => array(
'unique' => array(
'rule' => array('checkUnique', 'email'),
'message' => 'Email already registered.'
)
),
'password' => array(
'notEmpty' => array(
'rule' => array('minLength', 6),
'required' => true,
'allowEmpty' => false,
'message' => 'Password has to be at least 6 characters long'
),
'password_similar' => array(
'rule' => 'checkPasswords',
'message' => 'Entered passwords do not match'
))
);
function checkPasswords($data) {
if ($this->data['Jobseeker']['password'] == $this->data['Jobseeker']['password2'])
return true;
else
return false;
}