Noted that xml format can now handle images.
[moodle-linuxchix.git] / admin / timezone.php
blob66084b93225ad41004dfdb3efddffa8f16065e9a
1 <?php // $Id$
3 require_once('../config.php');
5 $zone = optional_param('zone', '', PARAM_PATH); //not a path, but it looks like it anyway
7 require_login();
9 if (!isadmin()) {
10 error("You must be an admin");
13 $strtimezone = get_string("timezone");
14 $strsavechanges = get_string("savechanges");
15 $strusers = get_string("users");
16 $strall = get_string("all");
18 print_header($strtimezone, $strtimezone, $strtimezone);
20 print_heading("");
22 if (!empty($zone) and confirm_sesskey()) {
23 $db->debug = true;
24 echo "<center>";
25 execute_sql("UPDATE {$CFG->prefix}user SET timezone = '$zone'");
26 $db->debug = false;
27 echo "</center>";
29 $USER->timezone = $zone;
32 require_once($CFG->dirroot.'/calendar/lib.php');
33 $timezones = get_list_of_timezones();
35 echo '<center><form action="timezone.php" method="get">';
36 echo "$strusers ($strall): ";
37 choose_from_menu ($timezones, "zone", 99, get_string("serverlocaltime"), "", "99");
38 echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\">";
39 echo "<input type=\"submit\" value=\"$strsavechanges\">";
40 echo "</form></center>";
42 print_footer();