This is perfect, I missed it, Thank you!! On Tue, Jun 18, 2019, 2:25 AM 'Annet' via web2py-users < [email protected]> wrote:
> Web2py has auth.settings I used them to solve your problem > > > auth.settings.login_onaccept = lambda form: __on_login() > auth.settings.logout_onlogout = lambda user: __on_logout() > > and then in the functions the task you want to perform, in my case > some set up things and messages, something like: > > > def __on_login(): > # set up code > > # messages > if auth.user.first_name: > name = auth.user.first_name + ' ' > elif auth.user.title: > name = auth.user.title + ' ' > if auth.user.familyNamePreposition: > name += auth.user.familyNamePreposition + ' ' > name += auth.user.last_name > > session.messages_logged_out = 'You have successfully logged out, > goodbye %s' %(name) > session.flash = 'You have successfully logged in, welcome %s' %(name) > > return None > > > def __on_logout(): > if session.forced_logout: > auth.messages.logged_out = session.forced_logged_out_message > else: > auth.messages.logged_out = session.messages_logged_out > > return None > > > Kind regards, > > Annet > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/web2py/sai3zh46gvQ/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/web2py/4cb15666-ee77-41c9-b769-70324770b90e%40googlegroups.com > <https://groups.google.com/d/msgid/web2py/4cb15666-ee77-41c9-b769-70324770b90e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CABZ%2BKCBYcPBgqYfq6R1M%2BipOB8%2BF8pJo4E3FJO%3Dh%2B%2B8cyF9uHg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

