issue #43: add warning to install page and set default timezone when no timezone has been set in the php.ini file

This commit is contained in:
Pepijn Over 2014-04-01 12:39:58 +02:00
parent a120c877bb
commit d90afdc5c7
2 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,10 @@ define('PSM_USER_ADMIN', 10);
define('PSM_USER_USER', 20);
define('PSM_USER_ANONYMOUS', 30);
if(function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) {
date_default_timezone_set(@date_default_timezone_get());
}
// find config file
$path_conf = PSM_PATH_SRC . '../config.php';
if(file_exists($path_conf)) {

View File

@ -103,6 +103,9 @@ class InstallController extends AbstractController {
$errors++;
$this->addMessage('The PDO MySQL driver needs to be installed.', 'error');
}
if(!ini_get('date.timezone')) {
$this->addMessage('You should set a timezone in your php.ini file (e.g. \'date.timezone = UTC\'). See <a href="http://www.php.net/manual/en/timezones.php" target="_blank">this page</a> for more info.', 'warning');
}
if($errors > 0) {
$this->addMessage($errors . ' error(s) have been encountered. Please fix them and refresh this page.', 'error');