Hello,
i have made an crud to add users to my application, and made a model which is checking if the password length is higher than 6, but before im saving my password i’am hashing it with the md5 wich will make it pass always.
model
array('password', 'length', 'min' => 6),
controller
if (isset($_POST['Users'])) {
$model->attributes = $_POST['Users'];
$model->validate();
$model->Password= md5($model->Password);
if ($model->save())
$this->redirect(array('view', 'id' => $model->id));
}
but it will always pass because the password will be hased to a 32 character long string,
how can i validate the original input string, but still insert the hashed string to the database?
Thanks in advance.