[Zope-CMF] Fixed member's login_time
Duane Raymond
duane.raymond at gmail.com
Sat Oct 16 16:55:41 EDT 2004
Hi,
I noticed that a member's login_time and last_login_time properties
weren't updated when a member logged in. I solved the issue by
editing the logged_In python script with the code below. However I
would have thought this was supposed to be standard considering the
fields are already there. Have I missed something?
If this is missing - perhaps someone with check-in rights could check
this code and include it in the logged_in script for future versions?
Cheers,
Duane
# Updates member's login_time and last_login_time date-time once they
are loggin in.
# It seems when membership failes, member.id = 'acl_users'
setMemberProperties=context.plone_utils.setMemberProperties
now = DateTime()
previouslogin = member.login_time
if member.id is not None and member.id != 'acl_users':
setMemberProperties(member.id, login_time=now)
setMemberProperties(member.id, last_login_time=previouslogin)
More information about the Zope-CMF
mailing list