Featured Idea - Last Logged In...

By rjbathgate - April 28, 2011 - edited: April 28, 2011

Hello,

Just a nice featured/addon idea which I think would be great...

"Last Logged In"

I.e. stores date and time in a field within the Accounts table for when that user last logged in.

Ideally either when logging in through the Website Membership function, and also straight into cmsb admin back end.

Would be very handy for CRM type setups :)

I was thinking it'd be quite easy to do as a hack into the Login function, but I'm not sure how to do it as a plugin which doesn't loose the hack up CMSB update ;)

That's my friday 2 cents :)

Cheers!!
Rob

EDIT:

I should really search the forum before posting...

http://www.interactivetools.com/iforum/Products_C2/CMS_Builder%3A_Plugins_%26_Add-ons_F40/gforum.cgi?post=81869;search_string=last%20logged%20in;t=search_engine#81869

I see it's already part of the Membership Plugin.

Oppps.

Re: [rjbathgate] Featured Idea - Last Logged In...

By Dave - April 29, 2011

Hi Rob,

We also added it in 2.08 as a default field under User Accounts that is also updated when you login to the CMS.

Hope that helps! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Featured Idea - Last Logged In...

By rjbathgate - May 1, 2011

bonza, thanks :)

Re: [Dave] Featured Idea - Last Logged In...

By gversion - March 20, 2012

Hi David,

I can see the field "Last Login", which is great!

Can you tell me how I can setup this to be included as an "Advanced Search" field so that I can list all users that haven't logged in since a particular date?

Or to put it another way, I'd like to be able to list all users that logged in before a certain date and all users that logged in after a certain date.

Thank you,
Greg

Re: [Dave] Featured Idea - Last Logged In...

By gversion - March 20, 2012

Hi Dave,

Thanks for your advice.

I have turned on Date Picker but the date icon is not appearing... any ideas what might be the problem? The "lastLoginDate" field type is setup to be "date/time" and there is a tick in the box allowing the user to specify a time and a tick in the "seconds" box too.

Also, do I need to include the first line you mentioned?
_all_

Is this just so I can do keyword search on any field or is it required for the lastLoginDate search to work?

Thank you,
Greg

Re: [gversion] Featured Idea - Last Logged In...

By Dave - March 20, 2012

Hi Greg,

You don't need the _all_ on the first line and can remove that if needed. It's just for keywords searches.

The date icon doesn't appear on those search fields but I've added it to the next release.

If you are comfortable modifying PHP code you can try adding it yourself. Just open /cmsAdmin/lib/menus/default/list_functions.php then:
- Search for: jqueryUI
- Replace this
// custom datepicker code - this is only called is jqueryUI datepicker is loaded
$html .= "\n<script type='text/javascript'>";
$html .= " $(function() { ";
$html .= " if ($.datepicker != undefined) { $('[name={$name}]').datepicker({ dateFormat: 'yy-mm-dd' }); }";
$html .= " });";
$html .= "</script>\n";
}

- With this:
// custom datepicker code - this is only called is jqueryUI datepicker is loaded
$jsDateFormat = @$fieldSchema['showTime'] ? "yy-mm-dd 00:00:00" : "yy-mm-dd";
$html .= <<<__HTML__
<script type='text/javascript'><!--
$(function() {
if ($.datepicker != undefined) {
$('[name={$name}]').datepicker({
showOn: 'button',
buttonImage: '3rdParty/jqueryUI/calendar.gif',
buttonImageOnly: true,
dateFormat: '$jsDateFormat'
});
}
});
//--></script>
__HTML__; // make sure there are no spaces to the left of __HTML__;
}


Hope that helps! Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com