[Grok-dev] login event and subscribe to

Jens Adner j.adner at fh-sm.de
Tue Jun 9 07:50:33 EDT 2009


Hello,

I've got a question about the event "IPrincipalCreated".

In my app, I use this event for putting a role to a principal:

@grok.subscribe(IPrincipalCreated)
def update_principal_info_from_ldap(event):
  principal = event.principal
  ...
  prm.assignRoleToPrincipal("adminrole", principal.id)

All works fine.

But this event is fireing up for every grok view. I need an event for
saving some data (login time, logout time, etc.) only for the first
successful auth of the user.

I don't understand why the principal is creating for every view again
and again or why the event "knock on my door".

Has anyone some hints? Is there another event I could use for logging
user infos at login and logout?

Thanks
Jens



-- 
++++++++ Jens Adner IuK-Zentrum Fachhochschule Schmalkalden +++++++++
++++++++ Fon: +49 3683688 9201  Fax: +49 3683688 989201     +++++++++


More information about the Grok-dev mailing list