Commit 29f793ef authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #94 in ZP/z-push from...

Merge pull request #94 in ZP/z-push from bugfix/ZP-773-autodiscover-needs-timezone-set-for to develop

* commit '19b811fa':
  ZP-773 Removed Berlios reference from contribution, and removed check for function date_default_timezone_set(). Released under the Affero GNU General Public License (AGPL) version 3.
  ZP-773 Autodiscover needs timezone set. Released under the Affero GNU General Public License (AGPL) version 3.
parents abf9cd3a 19b811fa
...@@ -265,4 +265,14 @@ class ZPushAutodiscover { ...@@ -265,4 +265,14 @@ class ZPushAutodiscover {
} }
} }
// set time zone
// code contributed by Robert Scheck (rsc)
if(defined('TIMEZONE') ? constant('TIMEZONE') : false) {
if (! @date_default_timezone_set(TIMEZONE))
throw new FatalMisconfigurationException(sprintf("The configured TIMEZONE '%s' is not valid. Please check supported timezones at http://www.php.net/manual/en/timezones.php", constant('TIMEZONE')));
}
else if(!ini_get('date.timezone')) {
date_default_timezone_set('Europe/Amsterdam');
}
ZPushAutodiscover::DoZPushAutodiscover(); ZPushAutodiscover::DoZPushAutodiscover();
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
/********************************************************************************** /**********************************************************************************
* Default settings * Default settings
*/ */
// Defines the default time zone, change e.g. to "Europe/London" if necessary
define('TIMEZONE', '');
// Defines the base path on the server // Defines the base path on the server
define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']). '/'); define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']). '/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment