Re: [html-formfu] Constraint for salted hash password

2009-02-27 Thread Carl Franks
2009/2/27 Christian Lackas : > So, MinLength does not apply to the empty string? Why is that? > I would have expected that FormFu complains here also. The Required constraint is the only one that demands the value is entered. MinLength really means "if it's filled-in, then it must be at least X ch

Re: [html-formfu] Constraint for salted hash password

2009-02-27 Thread Christian Lackas
* Carl Franks [090227 15:07]: Hi Carl, thanks for your prompt reply, again. > >    - type: Password > >      name: password > >      label: Password > >      constraint: > >        - type: MinLength > >          min: 6 > >        - type: Regex > >          regex: '\W' > >          message: Must

Re: [html-formfu] Constraint for salted hash password

2009-02-27 Thread Carl Franks
2009/2/27 Christian Lackas : > * Carl Franks [090227 13:25]: > > Hi Carl, > >> You're adding a 2nd validator, so it doesn't have the message set on the 1st. >> That should really be: >>    $field->get_validator({ type => 'Callback' })->callback( sub { >>        return Crypt::SaltedHash->validate($

Re: [html-formfu] Constraint for salted hash password

2009-02-27 Thread Christian Lackas
* Carl Franks [090227 13:25]: Hi Carl, > You're adding a 2nd validator, so it doesn't have the message set on the 1st. > That should really be: >$field->get_validator({ type => 'Callback' })->callback( sub { >return Crypt::SaltedHash->validate($user->password, shift); >}); makes

Re: [html-formfu] Constraint for salted hash password

2009-02-27 Thread Carl Franks
2009/2/27 Christian Lackas : > * Moritz Onken [090227 11:15]: > > Hi Moritz, > >> > My idea was to have this in my form.yml: >> > >> >    - type: Password >> >      name: password_old >> >      label: Old password >> >      filters: >> >        - type: Callback >> >          callback: MyApp::Utils

Re: [html-formfu] Constraint for salted hash password

2009-02-27 Thread Christian Lackas
* Moritz Onken [090227 11:15]: Hi Moritz, > > My idea was to have this in my form.yml: > > > >- type: Password > > name: password_old > > label: Old password > > filters: > >- type: Callback > > callback: MyApp::Utils::hashpassword > > constraint: > >

Re: [html-formfu] Constraint for salted hash password

2009-02-27 Thread Moritz Onken
Am 27.02.2009 um 11:05 schrieb Christian Lackas: Hi Everybody, just working on a user detail form, where the user has to type in his password to be able to store the data. The passwords are stored as a salted hash (using Crypt::SaltedHash and Digest::SHA1) in the database. My idea was to h

[html-formfu] Constraint for salted hash password

2009-02-27 Thread Christian Lackas
Hi Everybody, just working on a user detail form, where the user has to type in his password to be able to store the data. The passwords are stored as a salted hash (using Crypt::SaltedHash and Digest::SHA1) in the database. My idea was to have this in my form.yml: - type: Password nam