python - Inserting email into auth_user in web2py on first time login while using pam_auth -


i using pam_auth login web2py installation. when user logs in first time, want store email obtain ldap query. how can in web2py.

in other words, want execute piece of ldap query in python @ time of first login user.

web2py default authentication system has event table, stores every event user. i.e stores events registration, login, logout, etc.

so can see if first time login querying table.

user_id = #get user id query = (db.auth_event.description.like('%logged-in%'))&(db.auth_event.user_id==user_id)  if db(query).count() == 1:     #this first login of user     ldap_mail = #call ldap email      #store email adress in auth_user     db(db.auth_user.id==user_id).update(email=ldap_mail) 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -