Show.. http://s5.tinypic.com/23r93wl.jpg
This dialog pops up when the "preferences" (aka imposatzioni) link is clicked. Incorrect passwords just display an error message, there is the cancel button to go back or the save button to try again. http://i41.tinypic.com/epr51u.png This is the form guarded by the previous QF. It uses templates views, but the dataform (quickform, rather) is standard. A simple hack to weblocks run-view-validators allows us to insert per- field error messages in form-validation. http://i42.tinypic.com/1zqaf5y.png code-wise, it's not as clean as a single :satisfies, because there is a function that procedurally decides where to insert the messages, but it turns out that's what my users want (silly wuser!). http://i39.tinypic.com/15ikqp.png Another validation: the user can change their login id, but only if it's available. Race conditions are possible... and tell .. code snippets at http://paste.lisp.org/display/76202#2 A few notes about the code -- it's terrible enough that I feel embarrassed for posting it, but specifically: a. ignore the initial flowable-widget, it was an attempt to widgetize this pattern, but something broke and I dropped it. It is worth finishing though, as so often you want to flow on a widget, but the context it's in means you don't know its parent, so it's nice to create a composite-widget parent for it, so that you can do (with-flow parent). Since I use both the settings and login within a dialog, this seems the best way to do it. b. custom-prefs is a widget with a slot second-attempt -- it makes much more sense if you read that as "cerberus-form-attempt" -- it's the gatekeeper form which tests the password. c. lastly, since we don't store passwords (just their MD5 hashes) -- user password-changing has to involve some sleight-of-hand to give an illusion of 'security' and 'oh-I'm-changing-my-old-password' -- this is done by storing the length of the original password and making up a string of A's of the same length. If the password value in the form does not match the A-string we assume the user wants to change it. For similar reasons we have to hack in sending back the changed value in handler-prefs-ok-modif ... luckily currying helps enormously in this because it was baked-in later [1]. Although render-password has an option to show a checkbox which toggles the presentation, most users are resigned to the super-dumb "double password" field method, so we'll probably add that later. Yay for curry! (weblocks::curry, iirc). Lastly, here are some screenshots of the dialog process (same lisppaste, earlier annotations). http://i39.tinypic.com/95t0ds.png http://i41.tinypic.com/214476p.png http://i43.tinypic.com/sy19ms.png cheers, Nandan [1] [previous versions had the form flip-flopping. At first it would show fake-password (eg "AAA") -- then the user would type "A" and it would be rejected of course, as being too short, but the form would reset to showing the password-field-obfuscated "AAA" string. Confusing for the user, eminently logical to the programmer :) ] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "weblocks" 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/weblocks?hl=en -~----------~----~----~----~------~----~------~--~---
