The Model_Auth_User class in Kohana uses 'username', 'email','password' to create a new user what if i want it to take only 'email', 'password' and also modify the validation to validate 'email_confirm' instead of 'password_confirm'
how to sign up with different fields in kohana
121 Views Asked by Moustafa Mohamed At
2
There are 2 best solutions below
0
On
Avoid changing of the system folder contents. Otherwise your changes will be lost after the next upgrade. The more correct approach is to override the validation rules.
In file application/classes/Model/user.php:
<?php
class Model_User extends Model_Auth_User
{
public function rules()
{
$rules = parent::rules();
unset($rules['username']);
return $rules;
}
}
?>
Finally i did it, All what I have to doe is to comment some lines which add the rules of validating user input open C:\xampp\htdocs\kohana\modules\orm\classes\Model\Auth\User.php and comment lines from 33:38 inclusive as following:
You only keep the rules for validating what you need