Adam

I created an article for full Validation of User Models.

It includes the methods to validate username , email,  require special
characters, length and matching passwords passwords. It also takes
care to ensure that emails and usernames are unique.

It also has some logic to ignore these fields on login pages, which is
another common question I see around here.

http://edwardawebb.com/programming/php-programming/cakephp/complex-validation-cakephp-12

hth - Eddie


On Jan 21, 4:14 pm, aranworld <[email protected]> wrote:
> Yes, you can do this.
>
> In my User model, I have a series of validation rules for a field
> called "new_passwd".
>
> After this field is validated for things like minimum length I then
> have it hashed into the string that gets stored in the database.
>
> Here is a bakery article that can show how to do some validation on a
> field that does not reflect a database column:
>
> http://bakery.cakephp.org/articles/view/using-equalto-validation-to-c...
>
> On Jan 21, 8:21 am, adam <[email protected]> wrote:
>
> > New question:
>
> > Can you add validate data in your model that is absent from your
> > database?  So if I try to solve this problem by creating a form field
> > called password_confirm, would I be able to validate it in my model
> > even though there isn't a corresponding spot in the database?
>
> > On Jan 21, 10:08 am, adam <[email protected]> wrote:
>
> > > I just searched the group, so nevermind this post.
>
> > > On Jan 21, 9:49 am, adam <[email protected]> wrote:
>
> > > > Could someone explain to me how to validate a 'password' field for
> > > > 'minLength'?  I'm presuming that it is hashing the password before
> > > > validating 'minLength'.  There must be some means to get around this.
>
> > > > Thanks in advance,
> > > > Adam
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to