In my application developed using Kohana, I have a form where user enters their registration information, My rules are correctly executing and the error message is displaying correctly if user ignores an important field or enters an email address in inappropriate form.
The problem is that i want to do the same validations while an his personal information at a later point of time, but i want to ignore the password fields which is usually empty when the form loads.
Is it really possible to make kohana ignore the blank password values while updating?
I am using the following code to update user data, I could see no
validation is performed(which is defined in myModel_User) when i useupdate_user()of Auth. Can somebody please throw some light on
potential issues that hinders the execution of validation routines
here?
if(Auth::instance()->logged_in()) {
$values = array();
$now = new DateTime();
$userobj = Auth::instance()->get_user();
//$userobj->updatedon = $now->format('Y-m-d H:i:s'); // need research
try {
$userobj->update_user($_POST, array('email',
'password',
'firstname',
'secondname',
'lastname',
'phone',
'city_id'
));
$values = Auth::instance()->get_user()->as_array();
} catch (ORM_Validation_Exception $e) {
$errors = $e->errors('models');
}
//...