3 require_once('../config.php');
5 $zone = optional_param('zone', '', PARAM_PATH
); //not a path, but it looks like it anyway
9 require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM
, SITEID
));
11 $strtimezone = get_string("timezone");
12 $strsavechanges = get_string("savechanges");
13 $strusers = get_string("users");
14 $strall = get_string("all");
16 print_header($strtimezone, $strtimezone, $strtimezone);
20 if (!empty($zone) and confirm_sesskey()) {
23 execute_sql("UPDATE {$CFG->prefix}user SET timezone = '$zone'");
27 $USER->timezone
= $zone;
30 require_once($CFG->dirroot
.'/calendar/lib.php');
31 $timezones = get_list_of_timezones();
33 echo '<center><form action="timezone.php" method="get">';
34 echo "$strusers ($strall): ";
35 choose_from_menu ($timezones, "zone", 99, get_string("serverlocaltime"), "", "99");
36 echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />";
37 echo "<input type=\"submit\" value=\"$strsavechanges\" />";
38 echo "</form></center>";