$_POST['check_version'] = $_POST['check_version'] ? 1 : 0;
$_POST['fs_versioning'] = $_POST['fs_versioning'] ? 1 : 0;
$_POST['enable_mail_queue'] = $_POST['enable_mail_queue'] ? 1 : 0;
- $_POST['display_name_format'] = $_POST['display_name_format'];
+ $_POST['display_name_format'] = intval($_POST['display_name_format']);
if (!isset($display_name_formats[$_POST['display_name_format']])) {
$_POST['display_name_format'] = $_config_defaults['display_name_format'];
$_POST['home_url'] = $addslashes($_POST['home_url']);
$_POST['default_language'] = $addslashes($_POST['default_language']);
$_POST['contact_email'] = $addslashes($_POST['contact_email']);
+ $_POST['time_zone'] = $addslashes($_POST['time_zone']);
foreach ($_config as $name => $value) {
// the isset() is needed to avoid overridding settings that don't get set here (ie. modules)
<input type="text" name="contact_email" id="cemail" size="40" value="<?php if (!empty($_POST['email'])) { echo $stripslashes(htmlspecialchars($_POST['email'])); } else { echo $_config['contact_email']; } ?>" />
</div>
+ <div class="row">
+ <div class="required" title="<?php echo _AT('required_field'); ?>">*</div><label for="time_zone"><?php echo _AT('time_zone'); ?></label><br />
+ <?php
+ @putenv("TZ=UTC");
+ $before = date('O');
+ @putenv("TZ=US/Eastern");
+ $after = date('O');
+ @putenv("TZ={$_config['time_zone']}");
+
+ $sql = "SELECT Name FROM mysql.time_zone_name ORDER BY Name";
+ $result = mysql_query($sql, $db);
+ ?>
+ <?php if ($result && mysql_num_rows($result) && ($before != $after)): ?>
+ <select name="time_zone" id="time_zone">
+ <option value="" <?php if (!$_config['time_zone']) { echo 'selected="selected"'; } ?>><?php echo _AT('use_system_time'); ?></option>
+ <option value=""></option>
+ <?php while ($row = mysql_fetch_assoc($result)): ?>
+ <option <?php if ($_config['time_zone'] == $row['Name']) { echo 'selected="selected"'; } ?>><?php echo $row['Name']; ?></option>
+ <?php endwhile; ?>
+ </select>
+ <?php else: ?>
+ <?php echo _AT('time_zones_not_supported'); ?>
+ <?php endif; ?>
+ </div>
+
<div class="row">
<label for="maxfile"><?php echo _AT('maximum_file_size'); ?></label> (<?php echo _AT('default'); ?>: <?php echo $_config_defaults['max_file_size']; ?>)<br />
<input type="text" size="10" name="max_file_size" id="maxfile" value="<?php if (!empty($_POST['max_file_size'])) { echo $stripslashes(htmlspecialchars($_POST['max_file_size'])); } else { echo $_config['max_file_size']; } ?>" /> <?php echo _AT('bytes'); ?>
<dt>Contact Email</dt>
<dd>The reply address used for emails sent for instructor requests and other system emails.</dd>
+ <dt>Time Zone</dt>
+ <dd>Changing ATutor's time zone to one other than that specific by the server requires MySQL 4.1.3+ and PHP's <kbd>putenv</kbd> command must be allowed. Additionally MySQL's time zone tables must be loaded; see <a href="http://dev.mysql.com/doc/refman/4.1/en/time-zone-support.html" target="_new">MySQL Server Time Zone Support</a> for additional details. This option is available in ATutor 1.5.3.3+.</dd>
+
<dt>Maximum File Size</dt>
<dd>Maximum allowable file size in Bytes that can be uploaded to the course's File Manager. This does not override the value set for <kbd>upload_max_filesize</kbd> in <kbd>php.ini</kbd>.</dd>
$_config['home_defaults'] .= (isset($_config['home_defaults_2']) ? $_config['home_defaults_2'] : '');
$_config['main_defaults'] .= (isset($_config['main_defaults_2']) ? $_config['main_defaults_2'] : '');
-$_config['time_zone'] = 'America/Toronto';
-
if ($_config['time_zone']) {
$sql = "SET time_zone='{$_config['time_zone']}'";
mysql_query($sql, $db);
- putenv("TZ={$_config['time_zone']}");
+ @putenv("TZ={$_config['time_zone']}");
}
/***** 7. start language block *****/