List of currently logged in users?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/19/2006 4:49:26 AM
Gravatar
Total Posts 92

List of currently logged in users?

We have a lot of custom modules for internal company processes such as digital invoice approvals, etc... that have been online for around a year now.
When I'm working on the system I've been accidently restarting the server, or replacing modules when I thought there was nobody online which is causing my users a bit of grief.

I'd like to write a custom admin module to show me a list of who is logged in at that particular moment, and possibly even what module they are currently in.

Joe, since I'm still learning the architecture of the system can you point me in the right direction to start?
5/19/2006 12:47:47 PM
Gravatar
Total Posts 18439

Re: List of currently logged in users?

Hi Richard,

In the 2.0 .NET Membership API there is a feature to get the number of users online. I have implemented this in the 2.1 branch but I haven't yet built the control to show it.

I know you are running on mono so the 2.1 branch of mojoportal is not an option for you yet but its just a matter of time until the mono 2.0 stack will work with mojoportal.

The way the Membership one works is based on a window of time since the last user activity. I think by default if the user has been active within the last 20 minutes he is considered "online", after that he is not until his next web request. So to make this work I had to implement a user property for lastactivitydate and on every page request if the user is authenticated update his lastactivitydate to now.

To do what you are saying, keeping track of what module they are in would mean more points of logging and more data to log. Since the web is stateless you never really know if the user is in the module, you only know he has been in the module within the recent time period you define.

A more simple approach to solve the problem might be something like create a module to enter and update an Admin Message and configure whether the admin message is active. Then you place a control in the header of your skin that when the Admin message is active it always displays in the header of every page. Your message can be I need to restart the app at x o clock please save your work and logout of the system. You might want to do an ajax control so it works even if the user is just sitting there not doing any activity but looking at the page for a long time. The control can make requests to check if the message is active and update it on the page.

Fod for thought anyway.

Cheers,

Joe
5/19/2006 1:52:15 PM
Gravatar
Total Posts 92

Re: List of currently logged in users?

I like the system message idea.  If I can find the time I might just implement it...  

Another option I thought of is creating a custom boolean flag in my custom tables that I turn on when I need to do maintenance.   I can modify my modules to check the flag and if its active they will be shown a nice maintenance message instead of opening the invoice system....   I can tell if anyone is currently active by tailing the module's log for 30 seconds or so.    The biggest hassle I've had is people loading my module while I'm in the middle of table changes, or such.   Just thinking outloud!

I'm not rushing into upgrading my mono.  It seems like everytime they fix something they break many other things that used to work.  It has been very embarassing when previously working code stopped working.  Although it would be nice to drop vs2003 and stick to vs2005!   I hate maintaining two sets of code in my subversion...

Thanks for the input, it's greatly appreciated.
5/19/2006 2:14:40 PM
Gravatar
Total Posts 18439

Re: List of currently logged in users?

Hi Richard,

Yes mono releases have been bumpy to say the least. I think the best thing if you have a beefy developer machine with maybe a nice big external drive is get the free version of VMWare Server and install a virtual machine with your os and mono and your customized mojoportal and test upgrades on that before upgrading your production environment. Then if you encounter a problem on the vm you can post it on the mono dev list so they can fix it and make another release.

Of course the success of such an approach would depend on how much time you have to thoroughly test all the features on the vm for each upgrade. You might even expose it on the network to your users and let them QA test it before upgrading production then they have some ownership in blessing the upgrade. Just depends on your organisation and how much leverage you have to get their cooperation.

Cheers,

Joe
5/20/2006 2:17:47 AM
Gravatar
Total Posts 92

Re: List of currently logged in users?

What I did recently to prevent problems like that happening again is setting up a development server with cron jobs to duplicate the mysql data into a testportal database to use as our development testbed.  That way I'm working on a totally seperate system, seperate mono, apache, xsp, mod_mono, but the same data.  I learned my lesson the hard way.  Just because something worked before doesn't mean it will work again after a mono upgrade, no matter how insignificant!  I also duplicate a similar setup on my home server to test over time in a real life setup that isn't mission critical.

Once I get the company's needs out of the way and find some spare time I'm really looking forward to making some mojoPortal enhancements...   Development isn't my job function, but I try to squeeze it in whenever I find the time.  (Advantage of being the boss I guess, LOL)
You must sign in to post in the forums. This thread is closed to new posts.