Thursday, May 5, 2011

Validation

Inside our blog I have include a page where the user can registered and the admin can also add new users if they want.
Inside the sign in form I have include some validation rules such as :

The name, username and the password has to exist. The form don't admint empty fields.
The username has to be between 4 and 10 characters
The password has to be confirmed and has to match


To do this last point I had to overwrite the hashfunction and also a function to check if the password introduced in the password field is the same than the password introduced in the confirm password field. All of this methods has been impleted inside the user model. 

No comments:

Post a Comment