- // Set up the language
- // i18n.php was included by auth.php
- global $username, $data_dir;
- set_up_language(getPref($data_dir, $username, 'language'));
+/**
+* Everyone needs stuff from config, and config needs stuff from
+* strings.php, so include them both here. Actually, strings is
+* included at the top now as the string array functions have
+* been moved into it.
+*
+* Include them down here instead of at the top so that all config
+* variables overwrite any passed in variables (for security).
+*/
+require_once('../config/config.php');
+require_once('../src/load_prefs.php');
+require_once('../functions/page_header.php');
+require_once('../functions/prefs.php');
+
+/* Set up the language (i18n.php was included by auth.php). */
+global $username, $data_dir;
+set_up_language(getPref($data_dir, $username, 'language'));
+
+$timeZone = getPref($data_dir, $username, 'timezone');
+if ( $timeZone ) {
+ putenv("TZ=".$timeZone);
+}