As a quick solution, store the last visited page in session and check
check in user

is not request.function == 'user':
   session.last_action = request.function

controller A
@auth.requires_login()      --> send to a view user.html specific for
controller A
def myfunctionA():
     return dict()
controller B
@auth.requires.login()      --> send to the default view user.html
def myfunctionB():
     return dict()

def user():
    # use session.last_action
    return dict(form=auth())

On Oct 2, 2:42 am, Julie Bouillon <julie.bouil...@yedia.com> wrote:
> On 10/02/2011 06:53 AM, Massimo Di Pierro wrote:> How do you know if a user 
> that has not yet logged is special or not?
> > Can you provide an example?
>
> > On Oct 1, 1:22 pm, "julie.bouil...@yedia.com"
> > <julie.bouil...@yedia.com>  wrote:
> >> Hi,
>
> >> Is it possible to define different auth page for the same application ? I
> >> mean having an auth page for "regular" user and another one for "special"
> >> user.
>
> >> I tried by adding a user function in a specific controller and added a
> >> user.html for that controller but whenever an authentication is required 
> >> I'm
> >> sent to the default user.html.
>
> I presume the kind of user depending on which view they try to access.
>
> Example:
>
> controller A
> @auth.requires_login()      --> send to a view user.html specific for
> controller A
> def myfunctionA():
>      return dict()
>
> controller B
> @auth.requires.login()      --> send to the default view user.html
> def myfunctionB():
>      return dict()
>
> I know there is the _next value passed to the user.html view, but
> intuitively it feels like a not that good idea to use that... Anything
> more elegant than that ?

Reply via email to