[web2py] Re: Frivolous request for login/logout

2010-06-03 Thread weheh
Annet, as I state in my previous post, I had tried your approach before first posting this thread and discovered it didn't work for exactly the reasons that hamdy lists. Massimo, thanks for the response, too. Looks like you are suggesting exactly hamdy's solution, which I have implemented, and it

[web2py] Re: Frivolous request for login/logout

2010-06-03 Thread hamdy.a.farag
on the ideal case , most people don't force login_url because suppose for example, you've a login form above in the banner of your web app and when user stands in a specific page and enters his user/pass in login form , ...you don't want him to leave the current page right? moreover your web site

[web2py] Re: Frivolous request for login/logout

2010-06-03 Thread hamdy.a.farag
Hi annet Saying it's useless I meant that setting the message after logging in , I didn't mean to be mean at all, sorry that you misunderstood me :) Now let's rethink you solution : It will work right ? but when ? it will work if you just in the index page made something like: def index():

[web2py] Re: Frivolous request for login/logout

2010-06-03 Thread annet
> This's not working !! you need to set the message before actually logged in !! Why is that? I welcome a user who logs in so setting auth.messages.logged_in works. When does auth.user provide you with values for first_name and last_name in your solution? Before logging in? > your solution just

[web2py] Re: Frivolous request for login/logout

2010-06-03 Thread mdipierro
def set_welcome(form): session.flash=T('hello %(name)s', dict(name=auth.user.first_name)) auth.settings.login_onaccept=set_welcome On Jun 3, 5:22 am, "hamdy.a.farag" wrote: > This's not working !! > > you need to set the message before actually logged in !! > your solution just set the mess

[web2py] Re: Frivolous request for login/logout

2010-06-03 Thread hamdy.a.farag
This's not working !! you need to set the message before actually logged in !! your solution just set the message after user is actually logged in so it's useless moreover, setting the logout message will not work, unless the index page itself has no flash message set or else the flash message in

[web2py] Re: Frivolous request for login/logout

2010-06-03 Thread weheh
Curious - I tried something like this earlier and had trouble with it. For now, I like hamdy's solution. On Jun 3, 4:33 am, annet wrote: > It's probably not the most elegant of solutions, but in db.py I simply > set: > > if auth.is_logged_in(): >     auth.messages.logged_in='Logged in successfull

[web2py] Re: Frivolous request for login/logout

2010-06-03 Thread annet
It's probably not the most elegant of solutions, but in db.py I simply set: if auth.is_logged_in(): auth.messages.logged_in='Logged in successfully, welcome ' + auth.user.first_name + ' ' + auth.user.last_name auth.messages.logged_out='Logged out successfully, until next time ' + auth.use

[web2py] Re: Frivolous request for login/logout

2010-06-02 Thread Yarko Tymciurak
On Jun 2, 1:52 pm, weheh wrote: > @hamdy.a.farag: swet. One of these days I have to memorize the > bazillion or so auth.settings. or simply use an IDE / debugger which will do completions for you! > > On Jun 2, 12:53 pm, "hamdy.a.farag" wrote: > > > in your model add something like >

[web2py] Re: Frivolous request for login/logout

2010-06-02 Thread weheh
@hamdy.a.farag: swet. One of these days I have to memorize the bazillion or so auth.settings. On Jun 2, 12:53 pm, "hamdy.a.farag" wrote: > in your model add something like > > def set_message(form): >     session.flash = T('hello %(name)s', dict(name=auth.user and > auth.user.first_name)) > >

[web2py] Re: Frivolous request for login/logout

2010-06-02 Thread hamdy.a.farag
in your model add something like def set_message(form): session.flash = T('hello %(name)s', dict(name=auth.user and auth.user.first_name)) auth.settings.login_onaccept = set_message

[web2py] Re: Frivolous request for login/logout

2010-06-02 Thread mdipierro
hmmm. let me think about it. On Jun 2, 2:04 am, weheh wrote: > I suppose there's no easy way to get your login message to say > something like this: > > auth.messages.logged_in=T('Welcome ')+auth.user.username > > Without fully customizing the login controller. Right? > > Same goes for logout.