Well be used to set the flash immediately after login. You can put it
anywere you want (models or same controller as user action) and should
work.

On Nov 24, 10:56 am, Richard Vézina <[email protected]>
wrote:
> How do I get the auth.messages.logged_in in response.flash only at login?
>
> I try many different things without success.
>
> Is auth.messages.logged_in as to be put in auth form controller?
>
> On Wed, Nov 24, 2010 at 11:18 AM, mdipierro <[email protected]> wrote:
> > how about something like this?
>
> > auth.messages.logged_in=T('Hello %(first_name)s and welcome on the
> > '+appTitle')
>
> > def index():
> >    """
> >    Index page
> >    """
> >    session.counter = (session.counter or 0) + 1
> >    if auth.user and auth.user.first_name!=0 and session.counter<=0:
> >         pass
> >     elif session.counter>0:
> >        pass
> >    else:
> >         if not response.flash: response.flash = T('Hello')
> >    return dict(message=T(''))
>
> > On Nov 24, 10:05 am, Richard Vézina <[email protected]>
> > wrote:
> > > Hello
>
> > > I need to have a response.flash on index page at login but not when the
> > user
> > > come back on index page during a session. I try to user session.counter
> > but
> > > the session is not reset until the cookies are erase I think.
>
> > > Here my index controller (*not working*) :
>
> > > def index():
> > >     """
> > >     Index page
> > >     """
> > >     session.counter = (session.counter or 0) + 1
> > >     if auth.user and auth.user.first_name!=0 and session.counter<=0:
> > >         response.flash = DIV(T('Hello ')+str(auth.user and
> > > auth.user.first_name),BR(),T('Welcome on the '),appTitle)
> > >     elif session.counter>0:
> > >         pass
> > >     else:
> > >         response.flash = T('Hello')
> > >     return dict(message=T(''))
>
> > > Richard
>
>

Reply via email to