Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » System Shutdown Times
System Shutdown Times [message #1981] Mon, 06 April 2009 11:18 Go to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Tony,

My system is hosted on a server that is in the US rather than in the UK. Is there any way to change the shutdown messages to cater for the time difference (otherwise the user sees a shutdown time that doesn't actually match the shutdown experience)?

Thanks
Re: System Shutdown Times [message #1982 is a reply to message #1981] Mon, 06 April 2009 17:59 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
Not at present, but I'll look into it.

Re: System Shutdown Times [message #2109 is a reply to message #1982] Thu, 04 June 2009 12:56 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
The attached update is a preview of the next release which includes timezone support, but only if your PHP version is 5.2 or greater. Give it a try to see if it solves your issue.

Re: System Shutdown Times [message #2116 is a reply to message #1981] Mon, 08 June 2009 12:23 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Thanks Tony, I've tried this now.

It half solves the problem. If the user is logged in then they will see the shutdown times in the correct timezone if it is within the warning period. However, once the system is shutdown, they are be definition logged out, so the system displays the time the system is available again using the default server timezone. Not sure what the solution to this might be!

Similarly, if the user is logged out (e.g. coming to the login screen for the first time, or at the login screen having just logged out) and the time is within the warning period, then the times will not be in the relevant timezone. An easy get out solution to this is not to display the warning messages on these types of screens (login, password reminder etc), although I think that would be a shame.

Maybe you have a proper solution?
Re: System Shutdown Times [message #2117 is a reply to message #2116] Mon, 08 June 2009 13:50 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
This is tricky as I don't know the user's time zone until after he/she has logged on, but if the system is in a shutdown state then he/she cannot log on. There is no information available in the HTTP headers, but I've just tried a solution which I think will work.

When a user logs on I set a cookie called 'timezone_client', so this information will always be available on the logon screen. This assumes, of course, that the same device is not used by people in different time zones.

See the attached file for the changed scripts.


Re: System Shutdown Times [message #2118 is a reply to message #1981] Mon, 08 June 2009 14:07 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
A suggestion in addition to the cookie solution:

What about the ability to set a default client timezone in the system configuration. This would be better than assuming the server location is the most appropriate default timezone.

The cookies would override this if necessary. In the cases where cookies are disabled or don't work for any reason, at least the developer controlled default would cater for more clients than the server default.

Graham
Re: System Shutdown Times [message #2119 is a reply to message #2118] Mon, 08 June 2009 15:00 Go to previous message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
There is only one server time zone, and this is obtained using the date_default_timezone_get() function, although this can be overridden with the $GLOBALS['server_timezone'] variable in the config.inc file.

Advise your users not to disable cookies, at least for this one domain, and the setting for client timezone on each MNU_USER record will always be available and will always be accurate. This would make a default setting for the client time zone completely redundant.


Previous Topic: Display a message in an ADD2 transaction
Next Topic: Question about the session page stack
Goto Forum:
  


Current Time: Sun Nov 24 00:22:56 EST 2024

Total time taken to generate the page: 0.01243 seconds