3 include("../config.php");
8 error("You must be an admin");
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 (isset($zone) and confirm_sesskey()) {
23 execute_sql("UPDATE {$CFG->prefix}user SET timezone = '$zone'");
27 $USER->timezone
= $zone;
32 if (abs($user->timezone
) > 13) {
36 $timeformat = get_string('strftimedaytime');
38 for ($tz = -26; $tz <= 26; $tz++
) {
39 $zone = (float)$tz/2.0;
40 $usertime = $timenow +
($tz * 1800);
42 $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT)";
44 $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT$zone)";
46 $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT+$zone)";
50 echo '<center><form action="timezone.php" method="get">';
51 echo "$strusers ($strall): ";
52 choose_from_menu ($timezones, "zone", $user->timezone
, get_string("serverlocaltime"), "", "99");
53 echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\">";
54 echo "<input type=\"submit\" value=\"$strsavechanges\">";
55 echo "</form></center>";