Can a site admin know when a new user has activated their account?

Hi, when a site admin adds a new user from the site admin panel, the new user immediately appears in the list.

  1. as a test, I tried logging into the site as a user I had been created but not yet activated. I got the "insufficient privileges" Makes sense.
    2) looking at the listing of users the site admin sees, I don't see anyway to know which users have been activated by the user following the link. Is there a way to know which users have activated their account?

@rileydog at least in previous versions of plone last login date was recorded on the user object. I forget where in the UI that was shown though.

I don't think this data was shown in UI anywhere, but it's saved on user object properties

Yeah, it isn't shown anywhere. I think this is a possible UI improvement.

I think this is quite important to a site admin because I have no way of knowing which of the users I've added have completed the registration process. Without this, I don't know who I have to follow up on.

The solution seems straight forward (assuming the login date is recorded on object). a) no login date (user created but account not activated): user name displayed as red; b) user login at least once (activated user): user name displayed green. c) if user not logged in for xx days (might be important for some project managers to know their project members are checking in every xx days) then user name displayed as orange (optional - would need configlet to define the day limit).

I would like to investigate this:

  1. could anyone suggest where the log-in date hook is stored? Simply look in the user object?
  2. any issues to consider other than what I've listed?
  3. This seems too simple to make it a full blown product; however, would like to offer it to Plone community. Suggestions on what form such a "product" would take to minimize development costs for me; however, to make it usable by the Plone community (note: I would only make this work in Plone 5)


Please note that this information is not coherent and not working as expected.

You have two different properties for this:

  • last_login_time
  • login_time

I don't fully remember details but they are not updated in a way that seems logical.

@keul thanks for the information.
1) am I understanding correctly, Plone 5 uses the two properties you've listed; however, it isn't clear the logic Plone uses. Is my understanding correct?
2) might 'last_..." be the last time you logged in and "login_..." be all times you've logged in? I'm just guessing.
3) Do you think this will prevent me from moving forward? Might I simply be able to have the code look at both and if either/both are set, then the user has logged in and would be displayed as green. If no value for either, display value is red. Might this work.

the answer, at least for Plone 4, seems to be in the following code:

so, login_time stores the last time the user logged in and last_login_time stores the previous one; if a user has never logged in, then login_time will be '2000/01/01'.

@tomgross removed the dependency on Products.CMFDefault for Plone 5, but I don't see any code related with login_time nor last_login_time on it:

it may be a regression; open an issue if that's the case.

@hvelarde thanks, we're getting somewhere.

So, if login_time = '2000/01/01 user has never logged in and the account hasn't been activated. (name greyed out)

if login_time = anything but the above the user has logged in at least once and the account is activated, the user shows in current font/color (blue)
if login_time = more than the number of days defined in configlet, color is yellow/orange. (this is feature is optional. Or, maybe hard code it as 7 days)

So, I need code to check this value. Would this checking be done in the theme? because to change the color (or make greyed out) this would be a theme/css thing, right?

Also, I'll need to have them check is the code is the same in P5.

Appreciate the help.

It is - easy to dump to csv with something like this (but possibly less ugly!)

for member in context.portal_membership.listMembers():

row =  member.getProperty('id')

row = row + ', ' + member.getProperty('email') 

if not member.getProperty('login_time').strftime('%Y') == '2000': 
    row = row + ', ' + member.getProperty('login_time').strftime('%c') 
    row = row + ', No Login'        

if not member.getProperty('last_login_time').strftime('%Y') == '2000': 
    row = row + ', ' + member.getProperty('last_login_time').strftime('%c') 
    row = row + ', No Last Login'        

row = row + ', ' + member.getProperty('fullname')

print row

return printed