Thank you very much! It does exactly what I needed. After reading your message I came back to "Settings and Messages" in your book (pages 237-241) and it has always been there. You may have won a convert today, although not a brilliant one.
cpicada.wordpress.com (aka "blind and slow") On Oct 30, 6:41 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > On Oct 30, 12:05 pm, cpicada <cpic...@gmail.com> wrote: > > > I just want to know if the built-in authentication system has a hook > > somewhere so I can do it easily. > > As I said, I am very new to this framework. I am still in the phase in > > which I risk reinventing the wheel ten times a day if I don't refrain > > from being too "creative". > > > - Is there something like auth.settings.register_onvalidation? (It > > seems to me that there is not, but I may be wrong) > > there is, it just defaults to None > > > - Should I subclass Auth and make a new register() method? > > - Should I mess around with Auth.register() itself? > > - Should I play with get_or_create_user()? > > > cpicada.wordpress.com > > > On 30 oct, 15:33, Yarko Tymciurak <resultsinsoftw...@gmail.com> wrote: > > > > On Fri, Oct 30, 2009 at 9:23 AM, cpicada <cpic...@gmail.com> wrote: > > > > > Yes, but it doesn't do exactly what I am looking for. I need to > > > > compute values *before* the registration happens, and in this case it > > > > works at login and only if the user was registered and logged out > > > > already. If I have: > > > > > def f(form): form.vars.username='apu' > > > > auth.settings.login_onvalidation=f > > > > I think this misses the point - you can do exactly what you want; it's in > > > the logic you setup > > > around your code (and you just have to work out that logic). > > > > The above is _one_ example of a mechanism by which to do something like > > > this. > > > > > ... and I register with username 'xxx', the username record at > > > > auth_user contains 'xxx', but not 'apu', and the system logs me in as > > > > 'xxx' *at registration* > > > > If I log out and try to log in as 'xxx', then it doesn't allow me, as > > > > expected, but I can fake a login by having an 'apu' user already > > > > registered and entering the username 'xxx' with the password of the > > > > registered 'apu'. > > > > > I'm sorry if this looks confusing. I appreciate the time and interest > > > > that you take in addressing my doubts. > > > > > cpicada.wordpress.com > > > > > On Oct 30, 2:18 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > yes > > > > > > def f(form): form.vars.two = form.vars.one+1 > > > > > auth.settigns.login_onvalidation = f > > > > > > and on the right side a function that can computes new form.vars from > > > > > existing form.vars. > > > > > > On Oct 30, 4:21 am, cpicada <cpic...@gmail.com> wrote: > > > > > > > Is there a way to process the data entered at the register form > > > > > > before > > > > > > doing the actual registration? > > > > > > > I am looking for a way to add computed values to a user record > > > > > > during > > > > > > registration, login and profile modification. > > > > > > > I am sorry if this is a silly question. I am very new to web2py (I > > > > > > have been working with django until now). I bought and read the > > > > > > e-book > > > > > > sold at Lulu and I also made some searches in this group, but I > > > > > > don't > > > > > > seem to get it right. > > > > > > Regards, > > > > > > > cpicada.wordpress.com > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---