2008/11/11 Jens Schwarz <[EMAIL PROTECTED]>:
>
> -------- Original-Nachricht --------
>> Datum: Tue, 11 Nov 2008 13:58:32 +0100
>> Von: "Jens Schwarz" <[EMAIL PROTECTED]>
>> An: [email protected]
>> Betreff: Re: [html-formfu] password element: empty after submission
>
>> (...)
>>   - type: Password
>>     name: mypass
>>     label: Enter password
>>     filters:
>>       - type: Callback
>>         callback: <catalyst root>::Controller::somewhere::myhashedpassword
>> (...)
>
> Hmm, I guess you native-english speakers say something like "Don't count your 
> chickens before they are hatched." :)
> The yml above works fine ... but:
> If I want to add a contraint like ...
>
> constraints:
>  - type: Length
>    min: 8
>    message: Your password should at least be 8 characters long
>
> ... the Callback filter messes up this constraint because it first hashes the 
> password to a 40 characters long SHA1 string which therefor passes the 
> contraint even if the entered string was less than 8 characters. I just tried 
> to dig into Inflator/Validator/Transformer in hope to find something 
> appropriate but I seems there are not many examples.

I suppose a Transformer would be the most appropriate hook for this.
Try just changing the filter config to:

   transformers:
     - type: Callback
       callback: <catalyst root>::Controller::somewhere::myhashedpassword

Carl

_______________________________________________
HTML-FormFu mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to