I figure out a problem with logout, so you have to do something like this.
<in model>
def define_user_session():
if auth.user:
session['my_user_id'] = auth.user.id
auth.settings.login_onaccept.append(lambda x:define_user_session())
</model>
and you got: session['my_user_id']
Bruno Rocha
http://about.me/rochacbruno/bio
2011/1/13 Bruno Rocha <[email protected]>
> Include it in your model, after the auth=Auth(...)
> <model>
> def define_session(user_id):
> session['myuser_id'] = user_id
>
> auth.settings.login_onaccept.append(lambda form:define_session(
> auth.user.id))
> </model>
>
> and, even the user is logget out, you will have the session['myuser_id']
>
> def user():
> if request.args(0) == 'logout':
> db(db.nao.userid==session['myuser_id']).update(db.nao.ipadress="")
> return dict(form=auth())
>
>
> Bruno Rocha
> http://about.me/rochacbruno/bio
>
>
> 2011/1/13 pk <[email protected]>
>
> hi
>>
>> one question:
>> def user():
>> if request.args(0) == 'logout':
>> query
>> return dict(form=auth())
>> what is if i need there the auth.user.id???
>>
>> this is my query:
>> db(db.nao.userid==auth.user.id).update(db.nao.ipadress="")
>>
>> is this possible? if not how can i do this?
>>
>> peter
>
>
>