Important Notice: Effective immediately, all support will be handled through Discord. Read more about the changes coming to Anodyne's services.

Add "Last Active" to the crew activity report

A place to request Nova MODs. Note: all MOD requests are handled by third party developers, not Anodyne Productions.

jasoncollege24 Thu Mar 19, 2015 8:37 pm

Add "Last Active" to the crew activity report

ok i know that sounds a little weird... allow me to explain.

on the crew activity report page, it shows last login, and last post. With the way that last login works, if a user selects "Remember me" at login time, and this feature is working correctly, a remembered user will never see the login screen again, unless their session is cleared from the database, they clear their login cookies, or they're otherwise logged out.

With this being the case, the last login is not an accurate way of seeing when they were last using the website.

What I'm looking for is a mod that will add a new line right under "Last log in" called "Last Active" which resets to 0 the moment their logged in session is active (eg resets to 0 when they appear in the "Who's Online Now" list in control panel) and base it's color on the last login requirement, so that if the login requirement is two weeks, it turns red after two or more weeks of no activity.

This would make it easier to judge who is actually using the sim, and who is not. It would also make the Crew Activity report page more useful to those who keep an eye on the activity of their players.
Image
User avatar

Posts: 184


AgentPhoenix Thu Mar 19, 2015 9:10 pm

Re: Add "Last Active" to the crew activity report

The autologin method actually calls the login method that's used by the log in page. That method is what sets the last login timestamp.

Obviously you'd need to test it to verify this, but Nova should be updating the last login time even on autologins. So if someone is shown on the activity report as not having logged in in the last month, that should mean they haven't logged in manually or been auto-logged in either.
User avatar

Posts: 7596


jasoncollege24 Fri Mar 20, 2015 12:28 am

Re: Add "Last Active" to the crew activity report

I've tested this just now.

Closed my session by completely closing my browser window, and opened it again, then went straight to the Crew Activity report page. Just as expected, it says that my last login was 16 hours ago, which is correct. My last actual log in was approximately 16 hours ago.

I does not appear to be updating this with an auto login. I've received confirmation that this happens on other sims as well.
Image
User avatar

Posts: 184


AgentPhoenix Fri Mar 20, 2015 7:15 am

Re: Add "Last Active" to the crew activity report

I think it might have something to do with how CI stores the session information in the sessions table. Either way, if you want to do something like what you're talking about, the place to start is with looking at a post_controller hook that updates a column you would create in the users table. It actually wouldn't be very tough to do something like this and would be a good way for you to get your feet wet with building a MOD.

http://www.codeigniter.com/user_guide/g ... hooks.html
User avatar

Posts: 7596


jasoncollege24 Fri Mar 20, 2015 8:02 pm

Re: Add "Last Active" to the crew activity report

I'll look at this when I get a chance, and let you know how it works out. Thanks for the help.
Image
User avatar

Posts: 184



Return to MOD Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron