On Thu, Jan 3, 2013 at 4:46 AM, Kevin Parker <[email protected]>wrote:

> But before we do I need to check if anyone is actually using the app. I
> have no idea if and how this can be achieved with CF and would be
> grateful for any tips, ideas, thoughts etc.
>

This can be done a few ways, and the correct solution may depend on scale
of your app as well. Though, if you expect there to be a time when NO ONE
is using your app, I have to assume the scale of users isn't huge. So
(assuming your app's relatively small and limited to one server) in your
case the easiest way may be to use the application scope. If you have
multiple CF servers, you can do this same thing using the database.

Each time a user requests a page, update a variable. This can be something
very simple such as:

application.lastVisit = now();

Then you can just test how long it's been since application.lastVisit and
compare it to your session timeout. If the last visit was longer ago than
the timespan of your session timeout, you can be sure nobody is logged in.

You'll probably want to make sure you are only triggering this for logged
in users (not when Google comes knocking). You'll presumably also want to
exclude yourself from this since you will be logged into the admin at the
time (one user). though, I suppose if you expect to uncheck this box you
will already have devised a way to get into the app which this blockade is
in place.

If you really want to get fancy with it, instead of a checkbox you could
enter the date/time that you'd like to conduct maintenance in the admin.
Use this in your code to start warning users as the login for an hour or
two before the maintenance. Then 15 minutes before that time, start
blocking new logins and warning currently logged in users that they need to
complete their work. Then when the time comes, throw up the wall for
everyone.

-Cameron

-- 
Cameron Childress
--
p:   678.637.5072
im: cameroncf
facebook <http://www.facebook.com/cameroncf> |
twitter<http://twitter.com/cameronc> |
google+ <https://profiles.google.com/u/0/117829379451708140985>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353743
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to